Create WebSocket Ticket
A WebSocket connection must first exchange the access token for a one-time wsTicket through this REST endpoint.
Endpoint
http
POST /wlte/v1/ws/ticketPurpose
Use the access token to create a one-time wsTicket.
The client must obtain a wsTicket first and then use that ticket to establish the WebSocket connection.
text
accessToken -> wsTicket -> WebSocket authenticated sessionRequest
Full URL:
http
POST {baseUrl}/wlte/v1/ws/ticketRequest headers:
http
Authorization: Bearer {accessToken}
Content-Type: application/json
Accept: application/jsonRequest body:
json
{}Success Response
HTTP status:
text
200 OKResponse body:
json
{
"code": "SUCCESS",
"message": "OK.",
"requestId": "req_001",
"data": {
"ticket": "wst_01HX...",
"expiresIn": 60
}
}Response data Schema
| Field | Type | Required | Description |
|---|---|---|---|
ticket | string | Yes | One-time WebSocket connection credential |
expiresIn | integer | Yes | Ticket lifetime, in seconds |
Ticket Rules
- A
wsTicketcan only be used once - A
wsTicketis only used to establish a WebSocket connection and is not used for REST API calls - A
wsTicketexpires afterexpiresInif it is not used - The ticket lifetime never exceeds the remaining lifetime of the access token used to create it
- The
wsTicketbecomes invalid immediately after a successful connection is established - If connection establishment fails, the client must call this endpoint again to obtain a new ticket
Error Responses
Possible responses:
400 INVALID_REQUEST401 AUTH_REQUIRED401 AUTH_INVALID401 AUTH_EXPIRED429 RATE_LIMITED500 INTERNAL_ERROR
