Fuselage
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
1
curl -L -X GET 'http://localhost:3000/api/v1/rooms.adminRooms.getRoom' \
2
-H 'X-User-Id: d26x6zSkaPSe5gCyy' \
3
-H 'X-Auth-Token: Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92'
Copied!
1
var request = require('request');
2
var options = {
3
'method': 'GET',
4
'url': 'http://localhost:3000/api/v1/rooms.adminRooms.getRoom',
5
'headers': {
6
'X-User-Id': 'd26x6zSkaPSe5gCyy',
7
'X-Auth-Token': 'Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92'
8
}
9
};
10
request(options, function (error, response) {
11
if (error) throw new Error(error);
12
console.log(response.body);
13
});
14
Copied!
1
import requests
2
3
url = "http://localhost:3000/api/v1/rooms.adminRooms.getRoom"
4
5
payload={}
6
headers = {
7
'X-User-Id': 'd26x6zSkaPSe5gCyy',
8
'X-Auth-Token': 'Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92'
9
}
10
11
response = requests.request("GET", url, headers=headers, data=payload)
12
13
print(response.text)
14
Copied!
1
<?php
2
require_once 'HTTP/Request2.php';
3
$request = new HTTP_Request2();
4
$request->setUrl('http://localhost:3000/api/v1/rooms.adminRooms.getRoom');
5
$request->setMethod(HTTP_Request2::METHOD_GET);
6
$request->setConfig(array(
7
'follow_redirects' => TRUE
8
));
9
$request->setHeader(array(
10
'X-User-Id' => 'd26x6zSkaPSe5gCyy',
11
'X-Auth-Token' => 'Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92'
12
));
13
try {
14
$response = $request->send();
15
if ($response->getStatus() == 200) {
16
echo $response->getBody();
17
}
18
else {
19
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
20
$response->getReasonPhrase();
21
}
22
}
23
catch(HTTP_Request2_Exception $e) {
24
echo 'Error: ' . $e->getMessage();
25
}
Copied!
1
Unirest.setTimeouts(0, 0);
2
HttpResponse<String> response = Unirest.get("http://localhost:3000/api/v1/rooms.adminRooms.getRoom")
3
.header("X-User-Id", "d26x6zSkaPSe5gCyy")
4
.header("X-Auth-Token", "Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92")
5
.asString();
Copied!

Example Result

Success

1
{
2
"_id": "ukFsHiySDhMkQyyyF",
3
"name": "freightwave",
4
"fname": "freightwave",
5
"t": "p",
6
"msgs": 4,
7
"usersCount": 1,
8
"u": {
9
"_id": "Gd6iymRZBK4C6wqHN",
10
"username": "bruno.raymundo"
11
},
12
"ro": false,
13
"default": false,
14
"success": true
15
}
Copied!

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
1
{
2
"success": false,
3
"error": "unauthorized"
4
}
Copied!
1
{
2
"success": false,
3
"error": "error-not-authorized"
4
}
Copied!

Change Log

Version
Description
2.4.0
Added
Last modified 2mo ago
Export as PDF
Copy link
Edit on GitHub