Rate limit (DRAFT)
To receive updates on API request-limit consumption, the client must connect via WebSocket using the ratelimit topic (or without specifying any topic).
A message of type ratelimit is sent to the client after the connection is established with the ratelimit topic or with no topic specified. This message represents the current state of API request-limit consumption at that moment.
The ratelimitstep query parameter defined in the connection URL specifies how many client requests must be consumed within the limit time window before the server sends a ratelimit message. For example, rateLimitStep=1 means a notification is sent after every request, while rateLimitStep=160 means a notification is sent after 160 consumed requests (for a policy of 200;w=10, a value of 160 represents 80% of the threshold).
The client can request the current consumption state at any time by sending a message of type ratelimit.
WS wss://isot.okte.sk/api/v1/idm/ws?topics=ratelimit
Ratelimit message example DRAFT
{
"type": "ratelimit",
"payload": {
"policy": "50;w=10",
"limit": "50",
"remaining": "10",
"reset": "3"
}
}
Message fields description
| Field | Description | Format |
| type | Message type for snapshot | Enum (ratelimit) |
| payload | Message data | Ratelimit object |
| Ratelimit | ||
| correlationId | Client's request message identifier | String or null |
| policy | Number per time window in seconds (e.g., “50;w=10” means 50 requests every 10 seconds) | <limit>;w=<seconds> |
| limit | Allowed number of requests in the given interval (e.g., 20 requests per 60 seconds) | Integer number |
| remaining | Number of remaining requests the client can send before reaching the limit | Integer number |
| reset | Time in seconds until the limit is reset | Float number |
Ratelimit request message example DRAFT
{
"type": "ratelimit"
}