Fuselage
Change Archivation State
Change the Archive state of a room.
URL
Requires Auth
HTTP Method
/api/v1/rooms.get
yes
POST

Payload

Argument
Example
Required
Description
rid
JZ8Y2dLfYhsg323R
Required
The room Id.
action
archive
Optional
When passed in, the room will be archived otherwise unarchived.

Example Payload

1
{
2
"rid": "iu7jtPAhvEeAS5tNq",
3
"action": "archive"
4
}
Copied!

Example Call

Curl
Node.js
Python
PHP
Java
1
curl -L -X POST 'http://localhost:3000/api/v1/rooms.changeArchivationState' \
2
-H 'X-User-Id: d26x6zSkaPSe5gCyy' \
3
-H 'X-Auth-Token: Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92' \
4
-H 'Content-Type: application/json' \
5
--data-raw '{
6
"rid": "iu7jtPAhvEeAS5tNq",
7
"action": "archive"
8
}'
Copied!
1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'http://localhost:3000/api/v1/rooms.changeArchivationState',
5
'headers': {
6
'X-User-Id': 'd26x6zSkaPSe5gCyy',
7
'X-Auth-Token': 'Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92',
8
'Content-Type': 'application/json'
9
},
10
body: JSON.stringify({"rid":"iu7jtPAhvEeAS5tNq","action":"archive"})
11
12
};
13
request(options, function (error, response) {
14
if (error) throw new Error(error);
15
console.log(response.body);
16
});
Copied!
1
import requests
2
3
url = "http://localhost:3000/api/v1/rooms.changeArchivationState"
4
5
payload="{\n \"rid\": \"iu7jtPAhvEeAS5tNq\",\n \"action\": \"archive\"\n}"
6
headers = {
7
'X-User-Id': 'd26x6zSkaPSe5gCyy',
8
'X-Auth-Token': 'Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92',
9
'Content-Type': 'application/json'
10
}
11
12
response = requests.request("POST", url, headers=headers, data=payload)
13
14
print(response.text)
Copied!
1
<?php
2
require_once 'HTTP/Request2.php';
3
$request = new HTTP_Request2();
4
$request->setUrl('http://localhost:3000/api/v1/rooms.changeArchivationState');
5
$request->setMethod(HTTP_Request2::METHOD_POST);
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
'Content-Type' => 'application/json'
13
));
14
$request->setBody('{\n "rid": "iu7jtPAhvEeAS5tNq",\n "action": "archive"\n}');
15
try {
16
$response = $request->send();
17
if ($response->getStatus() == 200) {
18
echo $response->getBody();
19
}
20
else {
21
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
22
$response->getReasonPhrase();
23
}
24
}
25
catch(HTTP_Request2_Exception $e) {
26
echo 'Error: ' . $e->getMessage();
27
}
Copied!
1
Unirest.setTimeouts(0, 0);
2
HttpResponse<String> response = Unirest.post("http://localhost:3000/api/v1/rooms.changeArchivationState")
3
.header("X-User-Id", "d26x6zSkaPSe5gCyy")
4
.header("X-Auth-Token", "Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92")
5
.header("Content-Type", "application/json")
6
.body("{\n \"rid\": \"iu7jtPAhvEeAS5tNq\",\n \"action\": \"archive\"\n}")
7
.asString();
Copied!

Example Result

Success

1
{
2
"success": true
3
}
Copied!

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
1
{
2
"success": false,
3
"error": "unauthorized"
4
}
Copied!
1
{
2
"success": false,
3
"error": "Invalid room [error-invalid-room]",
4
"errorType": "error-invalid-room",
5
"details": {
6
"method": "unarchiveRoom"
7
}
8
}
Copied!

Change Log

Version
Description
3.3.0
Added
Last modified 2mo ago