Introduction
This documentation aims to provide all the information you need to work with our API.
Authenticating requests
Authenticate requests to this API's endpoints by sending an Authorization
header with the value "Bearer {YOUR_API_TOKEN}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can generate a token in the administrator dashboard on the bottom of the Settings => Integrations page.
Endpoints
POST api/v1/users/import
requires authentication
Example request:
curl --request POST \
"https://{your-flexopus-domain}/api/v1/users/import" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Accept: application/json" \
--header "Content-Type: multipart/form-data" \
--form "update=1" \
--form "dry_run=1" \
--form "file=@/tmp/phpvrI20d"
const url = new URL(
"https://{your-flexopus-domain}/api/v1/users/import"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Accept": "application/json",
"Content-Type": "multipart/form-data",
};
const body = new FormData();
body.append('update', '1');
body.append('dry_run', '1');
body.append('file', document.querySelector('input[name="file"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://{your-flexopus-domain}/api/v1/users/import',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'multipart/form-data',
],
'multipart' => [
[
'name' => 'update',
'contents' => '1'
],
[
'name' => 'dry_run',
'contents' => '1'
],
[
'name' => 'file',
'contents' => fopen('/tmp/phpvrI20d', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://{your-flexopus-domain}/api/v1/users/import'
files = {
'file': open('/tmp/phpvrI20d', 'rb')
}
payload = {
"update": true,
"dry_run": true
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Accept': 'application/json',
'Content-Type': 'multipart/form-data'
}
response = requests.request('POST', url, headers=headers, files=files, data=payload)
response.json()
Example response (200):
{
"dryRun": true, // dry_run flag from the request
"created": [2, 3], // row indices for freshly created users
"updated": [4, 6], // row indices for updated users
"deleted": 0, // the number of deleted users
"skipped": [5, 8], // row indices for unchanged users
"errors": [7], // indices for rows with errors
"errorMessages": { // object with messages for every error
"7": { // row index of error
"email": [ // column with error
"The email must be a valid email address." // error message
]
}
},
"rows": 7, // total number of processed rows
"filename": "users.csv" // name of the uploaded file
}
Received response:
Request failed with error:
GET api/v1/users/{user_id}/bookings
requires authentication
Example request:
curl --request GET \
--get "https://{your-flexopus-domain}/api/v1/users/8/bookings?from=2021-11-01T00%3A00%3A00Z&to=2021-01-02T00%3A00%3A00Z" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Accept: application/json"
const url = new URL(
"https://{your-flexopus-domain}/api/v1/users/8/bookings"
);
const params = {
"from": "2021-11-01T00:00:00Z",
"to": "2021-01-02T00:00:00Z",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://{your-flexopus-domain}/api/v1/users/8/bookings',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Accept' => 'application/json',
],
'query' => [
'from' => '2021-11-01T00:00:00Z',
'to' => '2021-01-02T00:00:00Z',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://{your-flexopus-domain}/api/v1/users/8/bookings'
params = {
'from': '2021-11-01T00:00:00Z',
'to': '2021-01-02T00:00:00Z',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
Example response (200):
{
"data": [
{
"id": 18556,
"from": "2021-11-01T08:00:00.000000Z",
"to": null,
"livemap": "https://{your-flexopus-domain}/api/v1/bookings/18556/livemap",
"bookable": {
"id": 445,
"name": "Parking spot 2",
"type": 1, // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
"location": {
"id": 32,
"name": "Car park 4",
"code": "P4",
"building": {
"id": 1,
"name": "Building",
"address": "281 Buchanan Rd, Sheffield, CH2 3NH"
}
}
}
},
{
"id": 18596,
"from": "2021-11-02T08:00:00.000000Z",
"to": "2021-11-02T14:00:00.000000Z",
"livemap": "https://{your-flexopus-domain}/api/v1/bookings/18596/livemap",
"bookable": {
"id": 23,
"name": "Table 12",
"type": 0, // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
"location": {
"id": 36,
"name": "Office 34",
"code": "O34",
"building": {
"id": 1,
"name": "Building",
"address": "281 Buchanan Rd, Sheffield, CH2 3NH"
}
}
}
}
]
}
Received response:
Request failed with error:
GET api/v1/users/by-email/{user_email}/bookings
requires authentication
Example request:
curl --request GET \
--get "https://{your-flexopus-domain}/api/v1/users/by-email/hannah63@example.com/bookings?from=2021-11-01T00%3A00%3A00Z&to=2021-01-02T00%3A00%3A00Z" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Accept: application/json"
const url = new URL(
"https://{your-flexopus-domain}/api/v1/users/by-email/hannah63@example.com/bookings"
);
const params = {
"from": "2021-11-01T00:00:00Z",
"to": "2021-01-02T00:00:00Z",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://{your-flexopus-domain}/api/v1/users/by-email/hannah63@example.com/bookings',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Accept' => 'application/json',
],
'query' => [
'from' => '2021-11-01T00:00:00Z',
'to' => '2021-01-02T00:00:00Z',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://{your-flexopus-domain}/api/v1/users/by-email/hannah63@example.com/bookings'
params = {
'from': '2021-11-01T00:00:00Z',
'to': '2021-01-02T00:00:00Z',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
Example response (200):
{
"data": [
{
"id": 18556,
"from": "2021-11-01T08:00:00.000000Z",
"to": null,
"livemap": "https://{your-flexopus-domain}/api/v1/bookings/18556/livemap",
"bookable": {
"id": 445,
"name": "Parking spot 2",
"type": 1, // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
"location": {
"id": 32,
"name": "Car park 4",
"code": "P4",
"building": {
"id": 1,
"name": "Building",
"address": "281 Buchanan Rd, Sheffield, CH2 3NH"
}
}
}
},
{
"id": 18596,
"from": "2021-11-02T08:00:00.000000Z",
"to": "2021-11-02T14:00:00.000000Z",
"livemap": "https://{your-flexopus-domain}/api/v1/bookings/18596/livemap",
"bookable": {
"id": 23,
"name": "Table 12",
"type": 0, // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
"location": {
"id": 36,
"name": "Office 34",
"code": "O34",
"building": {
"id": 1,
"name": "Building",
"address": "281 Buchanan Rd, Sheffield, CH2 3NH"
}
}
}
}
]
}
Received response:
Request failed with error:
GET api/v1/buildings
requires authentication
Example request:
curl --request GET \
--get "https://{your-flexopus-domain}/api/v1/buildings" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Accept: application/json"
const url = new URL(
"https://{your-flexopus-domain}/api/v1/buildings"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://{your-flexopus-domain}/api/v1/buildings',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://{your-flexopus-domain}/api/v1/buildings'
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"data": [
{
"id": 1,
"name": "Building",
"address": "281 Buchanan Rd, Sheffield, CH2 3NH"
"locations": [
{
"id": 32,
"name": "Car park 4",
"code": "P4"
},
{
"id": 36,
"name": "Office 34",
"code": "O34"
},
{
"id": 37,
"name": "Office 35",
"code": "O35"
}
]
}
]
}
Received response:
Request failed with error:
GET api/v1/buildings/{building_id}/bookings
requires authentication
Example request:
curl --request GET \
--get "https://{your-flexopus-domain}/api/v1/buildings/10/bookings?from=2021-11-01T00%3A00%3A00Z&to=2021-01-02T00%3A00%3A00Z" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Accept: application/json"
const url = new URL(
"https://{your-flexopus-domain}/api/v1/buildings/10/bookings"
);
const params = {
"from": "2021-11-01T00:00:00Z",
"to": "2021-01-02T00:00:00Z",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://{your-flexopus-domain}/api/v1/buildings/10/bookings',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Accept' => 'application/json',
],
'query' => [
'from' => '2021-11-01T00:00:00Z',
'to' => '2021-01-02T00:00:00Z',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://{your-flexopus-domain}/api/v1/buildings/10/bookings'
params = {
'from': '2021-11-01T00:00:00Z',
'to': '2021-01-02T00:00:00Z',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
Example response (200):
{
"data": [
{
"id": 18552,
"from": "2021-11-01T08:00:00.000000Z",
"to": "2021-11-01T10:00:00.000000Z",
"livemap": "https://{your-flexopus-domain}/api/v1/bookings/18552/livemap",
"bookable": {
"id": 113,
"name": "Table 24",
"type": 0, // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
"location": {
"id": 36,
"name": "Office 34",
"code": "O34"
}
},
"user": {
"id": 123,
"name": "Dr. Eddie Torphy IV",
"email": "dr.eddie.torphy.iv@example.com"
}
},
{
"id": 13862,
"from": "2021-11-01T14:00:00.000000Z",
"to": null,
"livemap": "https://{your-flexopus-domain}/api/v1/bookings/13862/livemap",
"bookable": {
"id": 445,
"name": "Parking spot 2",
"type": 1, // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
"location": {
"id": 32,
"name": "Car park 4",
"code": "P4"
}
},
"user": {
"id": 127,
"name": "Lillie Bergnaum",
"email": "lillie.bergnaum@example.com"
}
}
]
}
Received response:
Request failed with error:
GET api/v1/locations/{location_id}/bookings
requires authentication
Example request:
curl --request GET \
--get "https://{your-flexopus-domain}/api/v1/locations/16/bookings?from=2021-11-01T00%3A00%3A00Z&to=2021-01-02T00%3A00%3A00Z" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Accept: application/json"
const url = new URL(
"https://{your-flexopus-domain}/api/v1/locations/16/bookings"
);
const params = {
"from": "2021-11-01T00:00:00Z",
"to": "2021-01-02T00:00:00Z",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://{your-flexopus-domain}/api/v1/locations/16/bookings',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Accept' => 'application/json',
],
'query' => [
'from' => '2021-11-01T00:00:00Z',
'to' => '2021-01-02T00:00:00Z',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://{your-flexopus-domain}/api/v1/locations/16/bookings'
params = {
'from': '2021-11-01T00:00:00Z',
'to': '2021-01-02T00:00:00Z',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
Example response (200):
{
"data": [
{
"id": 18552,
"from": "2021-11-01T08:00:00.000000Z",
"to": "2021-11-01T10:00:00.000000Z",
"livemap": "https://{your-flexopus-domain}/api/v1/bookings/18552/livemap",
"bookable": {
"id": 113,
"name": "Table 24",
"type": 0 // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
},
"user": {
"id": 123,
"name": "Dr. Eddie Torphy IV",
"email": "dr.eddie.torphy.iv@example.com"
}
},
{
"id": 13862,
"from": "2021-11-01T14:00:00.000000Z",
"to": null,
"livemap": "https://{your-flexopus-domain}/api/v1/bookings/13862/livemap",
"bookable": {
"id": 445,
"name": "Parking spot 2",
"type": 1 // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
},
"user": {
"id": 127,
"name": "Lillie Bergnaum",
"email": "lillie.bergnaum@example.com"
}
}
]
}
Received response:
Request failed with error:
GET api/v1/locations/{location_id}/bookables
requires authentication
Example request:
curl --request GET \
--get "https://{your-flexopus-domain}/api/v1/locations/18/bookables" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Accept: application/json"
const url = new URL(
"https://{your-flexopus-domain}/api/v1/locations/18/bookables"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://{your-flexopus-domain}/api/v1/locations/18/bookables',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://{your-flexopus-domain}/api/v1/locations/18/bookables'
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"data": [
{
"id": 113,
"name": "Table 24",
"type": 0, // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
"tags": [
"Adjustable height",
"Quiet zone"
]
},
{
"id": 445,
"name": "Parking spot 2",
"type": 1, // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
"tags": [
"Electric charger"
]
}
]
}
Received response:
Request failed with error:
GET api/v1/bookings
requires authentication
Example request:
curl --request GET \
--get "https://{your-flexopus-domain}/api/v1/bookings?from=2021-11-01T00%3A00%3A00Z&to=2021-01-02T00%3A00%3A00Z" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Accept: application/json"
const url = new URL(
"https://{your-flexopus-domain}/api/v1/bookings"
);
const params = {
"from": "2021-11-01T00:00:00Z",
"to": "2021-01-02T00:00:00Z",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://{your-flexopus-domain}/api/v1/bookings',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Accept' => 'application/json',
],
'query' => [
'from' => '2021-11-01T00:00:00Z',
'to' => '2021-01-02T00:00:00Z',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://{your-flexopus-domain}/api/v1/bookings'
params = {
'from': '2021-11-01T00:00:00Z',
'to': '2021-01-02T00:00:00Z',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
Example response (200):
{
"data": [
{
"id": 18556,
"from": "2021-11-01T08:00:00.000000Z",
"to": null,
"livemap": "https://{your-flexopus-domain}/api/v1/bookings/18556/livemap",
"bookable": {
"id": 445,
"name": "Parking spot 2",
"type": 1, // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
"location": {
"id": 32,
"name": "Car park 4",
"code": "P4",
"building": {
"id": 1,
"name": "Building",
"address": "281 Buchanan Rd, Sheffield, CH2 3NH"
}
}
},
"user": {
"id": 127,
"name": "Lillie Bergnaum",
"email": "lillie.bergnaum@example.com"
}
},
{
"id": 18596,
"from": "2021-11-02T08:00:00.000000Z",
"to": "2021-11-02T14:00:00.000000Z",
"livemap": "https://{your-flexopus-domain}/api/v1/bookings/18596/livemap",
"bookable": {
"id": 23,
"name": "Table 12",
"type": 0, // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
"location": {
"id": 36,
"name": "Office 34",
"code": "O34",
"building": {
"id": 1,
"name": "Building",
"address": "281 Buchanan Rd, Sheffield, CH2 3NH"
}
}
},
"user": {
"id": 123,
"name": "Dr. Eddie Torphy IV",
"email": "dr.eddie.torphy.iv@example.com"
}
}
]
}
Received response:
Request failed with error: