Realtime API
The Realtime API provides programmatic access to ongoing activity in your Tiledesk server.
The Realtime API is implemented using WebSocket technology.
You can use the API to do the following:
Display requests data
Display agents data
Create and display a real-time dashboard
Predict or estimate capacity and other derived metrics
The Realtime API allows you to receive events from Tiledesk after you subscribe to one or more topics.
This API is an SSL-only API. You must be a verified user to make API requests. You can authorize against the API using JWT token.
Topics
Topic | Description |
---|---|
/PROJECT_ID/requests | Get the last open requests of a project |
/PROJECT_ID/requests/REQUEST_ID | Get the requests detail |
/PROJECT_ID/requests/REQUEST_ID/messages | Get the request messages |
/PROJECT_ID/project_users/PROJECT_USER_ID | Get the agents info |
Rate Limiting
We only allow a certain number of new connections per minute. The number of new connections to the Realtime API is restricted by REST API rate limits. We also allow a certain number of concurrently running connections to the Realtime API.
We reserve the right to adjust the rate limit for given endpoints in order to provide a high quality of service for all clients. If the rate limit is exceeded, Tiledesk will respond with a body that details the reason for the rate limiter kicking in.
We also limit the total amount of data exchanged through real time APIs. For example the number of Realtime requests exchanged can’t exceed a certain number of items. If this number is exeeded you can always use REST APIs to get additional data or to make more complex queries.
Using The API
Establish an authenticated WebSocket connection to
wss://eu.rtmv3.tiledesk.com/api/
.Subscribe to one or several topics.
Process incoming events.
Unsubscribe to topics.
Allowed For
Owner
Administrator
Agent
Establish Connection
Connect to the wss://eu.rtmv3.tiledesk.com/api/ WebSocket endpoint using your JWT token.
Subscribe to a topic
Once connection is established, you can send messages to subscribe to individual topics. Refer to Topics for the topic key.
To subscribe to a topic you can execute :
Example:
Process Incoming Events
Once you have subscribed to one or several topics, listen to subsequent messages to start collecting data.
The following are sample messages received after subscribing to requests topic:
Unsubscribe
Once you stop processing some data, you can individually unsubscribe from a topic. Events will then stop being pushed on the connection.
Example
You can find a simple example of the Tiledesk Realtime API here
Last updated