Updated on 2025-02-25 GMT+08:00

Creating a Ticket

Function

This API is used to create a ticket.

URI

POST /v1/{project_id}/tickets

Table 1 URI parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For how to obtain the project ID, see Obtaining a Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. Obtain a user token by calling IAM's "Obtaining a User Token" API. X-Subject-Token in the response header is the desired user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

embed_id

Yes

String

Embedded analytics ID.

user_id

Yes

String

User ID.

group_ids

No

Array of strings

List of user group IDs.

ticket_num

No

Integer

Number of times the ticket has been used.

session_auto_renew

No

Boolean

Whether to automatically renew the session.

Default value: false

Response Parameters

Status code: 200

Table 4 Response body parameter

Parameter

Type

Description

ticket

String

Generated ticket.

Example Request

Create a ticket.

POST https://{endpoint}/v1/{project_id}/tickets 
 
{ 
  "user_id" : "aaa18eb155xxxxxxxxxxxxxxxxxxx", 
  "ticket_num" : 1000, 
  "embed_id" : "8e59605cxxxxxxxxxxxx" 
}

Example Response

Status code: 200

The ticket is created.

{ 
  "ticket" : "dea43d00388xxxxxxxxxxxxxx" 
}

Status Codes

Status Code

Description

200

The ticket is created.

Error Codes

See Error Codes.