Links

Get Admin Rooms

Retrieves all admin rooms (requires the view-room-administration permission).
URL
Requires Auth
HTTP Method
/api/v1/rooms.adminRooms.getRoom
yes
GET

Example Call

Curl
Node.js
Python
PHP
Java
curl -L -X GET 'http://localhost:3000/api/v1/rooms.adminRooms.getRoom' \
-H 'X-User-Id: d26x6zSkaPSe5gCyy' \
-H 'X-Auth-Token: Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92'
var request = require('request');
var options = {
'method': 'GET',
'url': 'http://localhost:3000/api/v1/rooms.adminRooms.getRoom',
'headers': {
'X-User-Id': 'd26x6zSkaPSe5gCyy',
'X-Auth-Token': 'Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
url = "http://localhost:3000/api/v1/rooms.adminRooms.getRoom"
payload={}
headers = {
'X-User-Id': 'd26x6zSkaPSe5gCyy',
'X-Auth-Token': 'Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92'
}
response = requests.request("GET", 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.adminRooms.getRoom');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'X-User-Id' => 'd26x6zSkaPSe5gCyy',
'X-Auth-Token' => 'Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92'
));
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.get("http://localhost:3000/api/v1/rooms.adminRooms.getRoom")
.header("X-User-Id", "d26x6zSkaPSe5gCyy")
.header("X-Auth-Token", "Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92")
.asString();

Example Result

Success

{
"_id": "ukFsHiySDhMkQyyyF",
"name": "freightwave",
"fname": "freightwave",
"t": "p",
"msgs": 4,
"usersCount": 1,
"u": {
"_id": "Gd6iymRZBK4C6wqHN",
"username": "bruno.raymundo"
},
"ro": false,
"default": false,
"success": true
}

Error

Any of the following errors can occur on the endpoint.
  • Authorization: Requires an authentication token for the request to be made.
  • No Permission: Occurs when the authenticated user doesn't have the view-room-administration permission.
Authorization
No Permission
{
"success": false,
"error": "unauthorized"
}
{
"success": false,
"error": "error-not-authorized"
}

Change Log

Version
Description
2.4.0
Added