Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Erstellen Sie einen neuen Fall und verknüpfen Sie ihn mit einem übergeordneten Fall.
Folgende Felder müssen festgelegt sein: displayName, description, classification und priority. Wenn Sie nur die API testen und den Fall nicht an einen Agent weiterleiten möchten, legen Sie testCase=true fest.
BEISPIELE:
cURL:
parent="projects/some-project"
curl \
--request POST \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
--header 'Content-Type: application/json' \
--data '{
"displayName": "Test case created by me.",
"description": "a random test case, feel free to close",
"classification": {
"id":
"100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8"
},
"timeZone": "-07:00",
"subscriberEmailAddresses": [
"foo@domain.com",
"bar@domain.com"
],
"testCase": true,
"priority": "P3"
}' \
"https://cloudsupport.googleapis.com/v2/$parent/cases"
Python:
import googleapiclient.discovery
apiVersion = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version=apiVersion,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={apiVersion}",
)
request = supportApiService.cases().create(
parent="projects/some-project",
body={
"displayName": "A Test Case",
"description": "This is a test case.",
"testCase": True,
"priority": "P2",
"classification": {
"id":
"100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8"
},
},
)
print(request.execute())
HTTP-Anfrage
POST https://cloudsupport.googleapis.com/v2beta/{parent=*/*}/cases
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2024-04-25 (UTC)."],[],[],null,["# Method: cases.create\n\nCreate a new case and associate it with a parent.\n\nIt must have the following fields set: `displayName`, `description`, `classification`, and `priority`. If you're just testing the API and don't want to route your case to an agent, set `testCase=true`.\n\nEXAMPLES:\n\ncURL: \n\n parent=\"projects/some-project\"\n curl \\\n --request POST \\\n --header \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"displayName\": \"Test case created by me.\",\n \"description\": \"a random test case, feel free to close\",\n \"classification\": {\n \"id\":\n \"100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8\"\n },\n \"timeZone\": \"-07:00\",\n \"subscriberEmailAddresses\": [\n \"foo@domain.com\",\n \"bar@domain.com\"\n ],\n \"testCase\": true,\n \"priority\": \"P3\"\n }' \\\n \"https://cloudsupport.googleapis.com/v2/$parent/cases\"\n\nPython: \n\n import googleapiclient.discovery\n\n apiVersion = \"v2\"\n supportApiService = googleapiclient.discovery.build(\n serviceName=\"cloudsupport\",\n version=apiVersion,\n discoveryServiceUrl=f\"https://cloudsupport.googleapis.com/$discovery/rest?version={apiVersion}\",\n )\n request = supportApiService.cases().create(\n parent=\"projects/some-project\",\n body={\n \"displayName\": \"A Test Case\",\n \"description\": \"This is a test case.\",\n \"testCase\": True,\n \"priority\": \"P2\",\n \"classification\": {\n \"id\":\n \"100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8\"\n },\n },\n )\n print(request.execute())\n\n### HTTP request\n\n`POST https://cloudsupport.googleapis.com/v2beta/{parent=*/*}/cases`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains an instance of [Case](/support/docs/reference/rest/v2beta/cases#Case).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Case](/support/docs/reference/rest/v2beta/cases#Case).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloudsupport`\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]