Fuselage
Export Room
Export room to a file or email.
This requires the user to have the mail-messages permission.
URL
Requires Auth
HTTP Method
/api/v1/rooms.export
yes
POST

Payload

Argument
Example
Required
Description
rid
JZ8Y2dLfYhsg323Rf
Required
The room Id.
type
email or file
Required
How you want the room to be exported.
dateFrom
2020-01-13
Optional
Startdate to begin fetching.
dateTo
2021-12-13
Optional
End date for fetching.
format
html or json
Optional
The file type to export as.

Example Payload

1
{
2
"rid": "iu7jtPAhvEeAS5tNq",
3
"type": "file",
4
"dateFrom": "2000-01-01",
5
"dateTo": "2021-11-25",
6
"format": "html"
7
}
Copied!

Example Call

Curl
Node.js
Python
PHP
Java
1
curl -L -X POST 'http://localhost:3000/api/v1/rooms.export' \
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
"type": "file",
8
"dateFrom": "2000-01-01",
9
"dateTo": "2021-11-25",
10
"format": "html"
11
}'
Copied!
1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'http://localhost:3000/api/v1/rooms.export',
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","type":"file","dateFrom":"2000-01-01","dateTo":"2021-11-25","format":"html"})
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.export"
4
5
payload="{\n \"rid\": \"iu7jtPAhvEeAS5tNq\",\n \"type\": \"file\",\n \"dateFrom\": \"2000-01-01\",\n \"dateTo\": \"2021-11-25\",\n \"format\": \"html\"\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.export');
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 "type": "file",\n "dateFrom": "2000-01-01",\n "dateTo": "2021-11-25",\n "format": "html"\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.export")
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 \"type\": \"file\",\n \"dateFrom\": \"2000-01-01\",\n \"dateTo\": \"2021-11-25\",\n \"format\": \"html\"\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 Params: Occurs when one or more needed parameters are missing.
  • Invalid Room: Occurs when the given rid is invalid.
  • Not Allowed: Occurs when the user lacks the mail-messages permission and doesn't have access to the room.
Authorization
Invalid Params
Invalid Room ID
1
{
2
"success": false,
3
"error": "unauthorized"
4
}
Copied!
1
{
2
"success": false,
3
"error": "[error-invalid-params]",
4
"errorType": "error-invalid-params"
5
}
Copied!
1
{
2
"success": false,
3
"error": "[error-invalid-room]",
4
"errorType": "error-invalid-room"
5
}
Copied!

Change Log

Version
Description
3.8.0
Added
Last modified 2mo ago