REST API

The REST API lets you push data to rooms as HTTPS POST requests. If you need to receive messages look at the client libraries.

Authentication

Whether your REST requests need to be authenticated or not depends on your channel's authentication settings. If you are unsure whether to authenticate or not, we recommend using the Basic Authorization header for all REST requests.

Pushing data to clients

POST https://api2.scaledrone.com/[channel_id]/[room_name]/publish
Body: {"hello": "from REST"}

Headers

Header Required Value Description
Content-Type application/json Send the message as JSON
Authorization Basic QWxhZijpbjpA... Read more about Basic Authentication
Authorization Bearer eyJ0eXAiOiJ... Read more about JWT Authentication

Response codes

Code Description
200 Everything went OK, the message was published
400+ Error, response message gives a more detailed error message

Pushing the same message to multiple rooms

POST https://api2.scaledrone.com/[channel_id]/publish/rooms?r=room1&r=room2
Body: {"hello": "from REST"}

Headers

Header Required Value Description
Content-Type application/json Send the message as JSON
Authorization Basic QWxhZijpbjpA... Read more about Basic Authentication
Authorization Bearer eyJ0eXAiOiJ... Read more about JWT Authentication

Response codes

Code Description
200 Everything went OK, the message was published
400+ Error, response message gives a more detailed error message

Getting the number of users in a channel

Request

GET https://api2.scaledrone.com/[channel_id]/stats

Response

{
  "users_count": 20
}

Getting the list of users from all rooms

Users in rooms might be different from users in a channel as some users might not have joined any rooms.

Request

GET https://api2.scaledrone.com/[channel_id]/members

Response

["user1", "user2"]

Getting the list of rooms that have users in them

Request

GET https://api2.scaledrone.com/[channel_id]/rooms

Response

["room1", "room2"]

Getting the list of users in a room

Request

GET https://api2.scaledrone.com/[channel_id]/[room_name]/members

Response

["user1", "user2"]

Getting the list of rooms and their members

Request

GET https://api2.scaledrone.com/[channel_id]/room-members

Response

{"room1": ["user1", "user2"], "room2": ["user1"]}

Authentication

Read the authentication documentation