Links

Save Room Settings

Save the settings of a room
URL
Requires Auth
HTTP Method
/api/v1/rooms.get
yes
GET

Payload

Argument
Example
Required
Description
rid
JZ8Y2dLfYhsg323Rf
Required
The room id.

Example Payload

{
"rid": "JZ8Y2dLfYhsg323Rf"
}

Example Call

Curl
Node.js
Python
PHP
Java
curl -L -X POST 'http://localhost:3000/api/v1/rooms.saveRoomSettings' \
-H 'X-User-Id: d26x6zSkaPSe5gCyy' \
-H 'X-Auth-Token: Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92' \
-H 'Content-Type: application/json' \
--data-raw '{
"rid": "JZ8Y2dLfYhsg323Rf"
}'
var request = require('request');
var options = {
'method': 'POST',
'url': 'http://localhost:3000/api/v1/rooms.saveRoomSettings',
'headers': {
'X-User-Id': 'd26x6zSkaPSe5gCyy',
'X-Auth-Token': 'Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92',
'Content-Type': 'application/json'
},
body: JSON.stringify({"rid":"JZ8Y2dLfYhsg323Rf"})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
url = "http://localhost:3000/api/v1/rooms.saveRoomSettings"
payload="{\n \"rid\": \"JZ8Y2dLfYhsg323Rf\"\n}"
headers = {
'X-User-Id': 'd26x6zSkaPSe5gCyy',
'X-Auth-Token': 'Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('http://localhost:3000/api/v1/rooms.saveRoomSettings');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'X-User-Id' => 'd26x6zSkaPSe5gCyy',
'X-Auth-Token' => 'Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92',
'Content-Type' => 'application/json'
));
$request->setBody('{\n "rid": "JZ8Y2dLfYhsg323Rf"\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("http://localhost:3000/api/v1/rooms.saveRoomSettings")
.header("X-User-Id", "d26x6zSkaPSe5gCyy")
.header("X-Auth-Token", "Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92")
.header("Content-Type", "application/json")
.body("{\n \"rid\": \"JZ8Y2dLfYhsg323Rf\"\n}")
.asString();

Example Result

Success

{
"rid": "JZ8Y2dLfYhsg323Rf",
"success": true
}

Error

Any of the following errors can occur on the endpoint.
  • Authorization: Requires an authentication token for the request to be made.
  • Invalid Room: Occurs when the given rid is invalid.
Authorization
Invalid Room ID
{
"success": false,
"error": "unauthorized"
}
{
"success": false,
"error": "The required \"roomId\" or \"roomName\" param provided does not match any group [error-room-not-found]",
"errorType": "error-room-not-found"
}
}

Change Log

Version
Description
3.13.0
Added