Create a new case and associate it with a parent.
It 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
.
EXAMPLES:
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 request
POST https://cloudsupport.googleapis.com/v2/{parent=*/*}/cases
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
parent |
Required. The name of the parent under which the case should be created. |
Request body
The request body contains an instance of Case
.
Response body
If successful, the response body contains a newly created instance of Case
.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/cloudsupport
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.