Establish Connection
Use a wsTicket to establish an authenticated WebSocket connection. This page describes the connection URL, session lifetime, and security requirements.
Connection URL
WebSocket uses the wss protocol.
text
wss://api.example.com/wlte/v1/ws?ticket={ticket}The environment domain is provided when the API environment is enabled. The path is fixed as:
text
/wlte/v1/wsEstablishment Flow
- Call Create WebSocket Ticket to obtain a one-time
wsTicket. - Establish the WebSocket connection using the
ticketquery parameter. - After the connection succeeds, the connection becomes an authenticated session.
- The client may send Session Ping to confirm that the session is available.
Examples
Browser example:
js
const socket = new WebSocket(
'wss://api.example.com/wlte/v1/ws?ticket=wst_01HX...'
);Node.js example using the ws library:
js
import WebSocket from 'ws';
const socket = new WebSocket(
'wss://api.example.com/wlte/v1/ws?ticket=wst_01HX...'
);Session Lifetime
The WebSocket session lifetime is constrained by the access token.
- A WebSocket session cannot outlive the access token used to create the ticket
- When the access token expires, the corresponding WebSocket session is closed
- Existing connections may be closed when the access token is revoked, the API client is disabled, or permissions are changed
- After a connection closes, obtain a new access token or a new
wsTicketand establish a new connection if WebSocket access is still needed
Security Requirements
- Use
wssonly - Do not log the full
ticketoraccessTokenin pages, logs, error reports, or monitoring systems - Do not expose
clientSecretto browsers, mobile apps, or public code repositories - Server-side access logs should avoid recording the full
ticketin URL query parameters
Reconnection
After the connection closes, the client should follow Heartbeat and Reconnection.
