Room API
You can also manage rooms via API.
Create room
Endpoint https://chatbackend.watchers.io/external/room
Request payload
Parameter | Type | Required | Description |
---|---|---|---|
roomId | string | Yes | roomid |
name | string | Yes | room name in admin panel |
about | string | Yes | Room description, used for scheduled rooms |
isSpeak | boolean | Yes | You can enable voice chat in the room |
startTime | string | No | If 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 | |||
endTime | string | No | If 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
Parameter | Type | Required | Description |
---|---|---|---|
roomId | string | Yes | roomid |
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
Parameter | Type | Required | Description |
---|---|---|---|
roomId | string | Yes | roomid |
isSpeak | boolean | Yes | You 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
Parameter | Type | Required | Description |
---|---|---|---|
roomId | string | Yes | roomid |
status | string ENUM | Yes | LIVE |
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
Parameter | Type | Required | Description |
---|---|---|---|
roomId | string | Yes | roomid |
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}'
Updated 28 days ago
What’s Next