Documentation

Room API

You can also manage rooms via API.

Create room

Endpoint https://chatbackend.watchers.io/external/room

Request payload

ParameterTypeRequiredDescription
roomIdstringYesroomid
namestringYesroom name in admin panel
aboutstringYesRoom description, used for scheduled rooms
isSpeakbooleanYesYou can enable voice chat in the room
startTimestringNoIf you provide startTime room will be scheduled with status SOON, and change status to the LIVE at provident time
fortmat: 2024-12-31 05:33:32
endTimestringNoIf you provide endTime room change status to the ENDED at provident time
fortmat: 2024-12-31 05:33:32

CURL example

curl -X 'POST' \
  'https://chatbackend.watchers.io/external/room' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {Api key of project from admin panel}' \
  -H 'Authorization: Bearer {Bearer token from admin panel}' \
  -d '{
  "roomId": "321textroom321",
  "name": "Test text room",
  "about": "Some text",
  "isSpeak": false
}'

Get room

Endpoint https://chatbackend.watchers.io/external/room/:roomId

GET parameters

ParameterTypeRequiredDescription
roomIdstringYesroomid

CURL example

curl -X 'GET' \
  'https://chatbackend.watchers.io/external/room/321textroom321' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {Api key of project from admin panel}' \
  -H 'Authorization: Bearer {Bearer token from admin panel}'

Enable Voice in room

Endpoint https://chatbackend.watchers.io/external/room/speak

Request payload

ParameterTypeRequiredDescription
roomIdstringYesroomid
isSpeakbooleanYesYou can enable voice chat in the room

CURL example

curl -X 'POST' \
  'https://chatbackend.watchers.io/external/room/speak' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {Api key of project from admin panel}' \
  -H 'Authorization: Bearer {Bearer token from admin panel}' \
  -d '{
  "roomId": "321textroom321",
  "isSpeak": false
}'

Change room status

Endpoint https://chatbackend.watchers.io/external/room/status

Request payload

ParameterTypeRequiredDescription
roomIdstringYesroomid
statusstring ENUMYesLIVE
SOON
ENDED
DISABLED

CURL example

curl -X 'POST' \
  'https://chatbackend.watchers.io/external/room/speak' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {Api key of project from admin panel}' \
  -H 'Authorization: Bearer {Bearer token from admin panel}' \
  -d '{
  "roomId": "321textroom321",
  "isSpeak": false
}'

Delete room

Endpoint https://chatbackend.watchers.io/external/room/:roomId

GET parameters

ParameterTypeRequiredDescription
roomIdstringYesroomid

CURL example

curl -X 'DELETE' \
  'https://chatbackend.watchers.io/external/room/321textroom321' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {Api key of project from admin panel}' \
  -H 'Authorization: Bearer {Bearer token from admin panel}'

What’s Next