MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

Authenticating requests

To authenticate requests, include 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/phpqoqN4V" 
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();
$url = 'https://{your-flexopus-domain}/api/v1/users/import';
$response = $client->post(
    $url,
    [
        '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/phpqoqN4V', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://{your-flexopus-domain}/api/v1/users/import'
files = {
  'update': (None, '1'),
  'dry_run': (None, '1'),
  'file': open('/tmp/phpqoqN4V', '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)
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
}
 

Request   

POST api/v1/users/import

Headers

Authorization      

Example: Bearer {YOUR_API_TOKEN}

Accept      

Example: application/json

Content-Type      

Example: multipart/form-data

Body Parameters

file   file   

Accepted file formats: csv, txt, ods, xls, xlsx. The file should contain the user list to be imported. You can read more about the expected structure of the import file at https://{your-flexopus-domain}/dashboard/users/import-export. Must be a file. Example: /tmp/phpqoqN4V

update   boolean  optional  

Default: false. Determines whether existing users should be updated. Example: true

restore   boolean  optional  

Default: false. Determines whether deactivated users present in the list should be re-activated.

deactivate   boolean  optional  

Default: false. Determines whether users not present in the list should be deactivated.

dry_run   boolean  optional  

Default: false. In case this flag is true, the actions are not carried out for real but simulated so the user can check the results without making modifications. Example: true

GET api/v1/users/{id}

requires authentication

Example request:
curl --request GET \
    --get "https://{your-flexopus-domain}/api/v1/users/1" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Accept: application/json"
const url = new URL(
    "https://{your-flexopus-domain}/api/v1/users/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://{your-flexopus-domain}/api/v1/users/1';
$response = $client->get(
    $url,
    [
        '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/users/1'
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "data": {
        "id": 123,
        "name": "Dr. Eddie Torphy IV",
        "email": "dr.eddie.torphy.iv@example.com",
        "extensionAttributes": {
            "extensionAttribute1": "value"
        }
    }
}
 

Request   

GET api/v1/users/{id}

Headers

Authorization      

Example: Bearer {YOUR_API_TOKEN}

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the user. Example: 1

GET api/v1/users/{user_id}/bookings

requires authentication

Example request:
curl --request GET \
    --get "https://{your-flexopus-domain}/api/v1/users/1/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/1/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();
$url = 'https://{your-flexopus-domain}/api/v1/users/1/bookings';
$response = $client->get(
    $url,
    [
        '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/1/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
        "status": 0 // 0 => Flexible, 1 => Blocked, 2 => Assigned
        "location": {
          "id": 32,
          "name": "Car park 4",
          "code": "P4",
          "building": {
            "id": 1,
            "name": "Building",
            "address": "281 Buchanan Rd, Sheffield, CH2 3NH"
          }
        }
      },
      "guest": null,
      "license_plate": "AB-CD-123"
    },
    {
      "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
        "status": 0 // 0 => Flexible, 1 => Blocked, 2 => Assigned
        "location": {
          "id": 36,
          "name": "Office 34",
          "code": "O34",
          "building": {
            "id": 1,
            "name": "Building",
            "address": "281 Buchanan Rd, Sheffield, CH2 3NH"
          }
        }
      },
      "guest": null
    }
  ]
}
 

Request   

GET api/v1/users/{user_id}/bookings

Headers

Authorization      

Example: Bearer {YOUR_API_TOKEN}

Accept      

Example: application/json

URL Parameters

user_id   integer   

The ID of the user. Example: 1

Query Parameters

from   string   

Must be a valid ISO date. Example: 2021-11-01T00:00:00Z

to   string   

Must be a valid ISO date. The date must be after the from parameter. The date must be within one year from the current date. Maximum difference between the to and from parameters is 1 week. Example: 2021-01-02T00:00:00Z

GET api/v1/users/by-email/{user_email}

requires authentication

Example request:
curl --request GET \
    --get "https://{your-flexopus-domain}/api/v1/users/by-email/edwina.baumbach@example.com" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Accept: application/json"
const url = new URL(
    "https://{your-flexopus-domain}/api/v1/users/by-email/edwina.baumbach@example.com"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://{your-flexopus-domain}/api/v1/users/by-email/edwina.baumbach@example.com';
$response = $client->get(
    $url,
    [
        '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/users/by-email/edwina.baumbach@example.com'
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "data": {
        "id": 123,
        "name": "Dr. Eddie Torphy IV",
        "email": "dr.eddie.torphy.iv@example.com",
        "extensionAttributes": {
            "extensionAttribute1": "value"
        }
    }
}
 

Request   

GET api/v1/users/by-email/{user_email}

Headers

Authorization      

Example: Bearer {YOUR_API_TOKEN}

Accept      

Example: application/json

URL Parameters

user_email   string   

Example: edwina.baumbach@example.com

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/psawayn@example.org/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/psawayn@example.org/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();
$url = 'https://{your-flexopus-domain}/api/v1/users/by-email/psawayn@example.org/bookings';
$response = $client->get(
    $url,
    [
        '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/psawayn@example.org/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
        "status": 0 // 0 => Flexible, 1 => Blocked, 2 => Assigned
        "location": {
          "id": 32,
          "name": "Car park 4",
          "code": "P4",
          "building": {
            "id": 1,
            "name": "Building",
            "address": "281 Buchanan Rd, Sheffield, CH2 3NH"
          }
        }
      },
      "guest": null,
      "license_plate": "AB-CD-123"
    },
    {
      "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
        "status": 0 // 0 => Flexible, 1 => Blocked, 2 => Assigned
        "location": {
          "id": 36,
          "name": "Office 34",
          "code": "O34",
          "building": {
            "id": 1,
            "name": "Building",
            "address": "281 Buchanan Rd, Sheffield, CH2 3NH"
          }
        }
      },
      "guest": null
    }
  ]
}
 

Request   

GET api/v1/users/by-email/{user_email}/bookings

Headers

Authorization      

Example: Bearer {YOUR_API_TOKEN}

Accept      

Example: application/json

URL Parameters

user_email   string   

Example: psawayn@example.org

Query Parameters

from   string   

Must be a valid ISO date. Example: 2021-11-01T00:00:00Z

to   string   

Must be a valid ISO date. The date must be after the from parameter. The date must be within one year from the current date. Maximum difference between the to and from parameters is 1 week. Example: 2021-01-02T00:00:00Z

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();
$url = 'https://{your-flexopus-domain}/api/v1/buildings';
$response = $client->get(
    $url,
    [
        '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"
        }
      ]
    }
  ]
}
 

Request   

GET api/v1/buildings

Headers

Authorization      

Example: Bearer {YOUR_API_TOKEN}

Accept      

Example: application/json

GET api/v1/buildings/{building_id}/bookings

requires authentication

Example request:
curl --request GET \
    --get "https://{your-flexopus-domain}/api/v1/buildings/2/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/2/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();
$url = 'https://{your-flexopus-domain}/api/v1/buildings/2/bookings';
$response = $client->get(
    $url,
    [
        '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/2/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
        "status": 0 // 0 => Flexible, 1 => Blocked, 2 => Assigned
        "location": {
          "id": 36,
          "name": "Office 34",
          "code": "O34"
        }
      },
      "user": {
        "id": 123,
        "name": "Dr. Eddie Torphy IV",
        "email": "dr.eddie.torphy.iv@example.com",
        "extensionAttributes": {
          "extensionAttribute1": "value"
        }
      },
      "guest": null
    },
    {
      "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
        "status": 0 // 0 => Flexible, 1 => Blocked, 2 => Assigned
        "location": {
          "id": 32,
          "name": "Car park 4",
          "code": "P4"
        }
      },
      "user": {
        "id": 127,
        "name": "Lillie Bergnaum",
        "email": "lillie.bergnaum@example.com",
        "extensionAttributes": {
          "extensionAttribute3": "other value"
        }
      },
      "guest": null,
      "license_plate": null
    }
  ]
}
 

Request   

GET api/v1/buildings/{building_id}/bookings

Headers

Authorization      

Example: Bearer {YOUR_API_TOKEN}

Accept      

Example: application/json

URL Parameters

building_id   integer   

The ID of the building. Example: 2

Query Parameters

from   string   

Must be a valid ISO date. Example: 2021-11-01T00:00:00Z

to   string   

Must be a valid ISO date. The date must be after the from parameter. The date must be within one year from the current date. Maximum difference between the to and from parameters is 1 week. Example: 2021-01-02T00:00:00Z

GET api/v1/locations/{location_id}/bookings

requires authentication

Example request:
curl --request GET \
    --get "https://{your-flexopus-domain}/api/v1/locations/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/locations/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();
$url = 'https://{your-flexopus-domain}/api/v1/locations/8/bookings';
$response = $client->get(
    $url,
    [
        '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/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": 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
        "status": 0 // 0 => Flexible, 1 => Blocked, 2 => Assigned
      },
      "user": {
        "id": 123,
        "name": "Dr. Eddie Torphy IV",
        "email": "dr.eddie.torphy.iv@example.com",
        "extensionAttributes": {
          "extensionAttribute1": "value"
        }
      },
      "guest": null
    },
    {
      "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
        "status": 0 // 0 => Flexible, 1 => Blocked, 2 => Assigned
      },
      "user": {
        "id": 127,
        "name": "Lillie Bergnaum",
        "email": "lillie.bergnaum@example.com",
        "extensionAttributes": {
          "extensionAttribute3": "other value"
        }
      },
      "guest": null,
      "license_plate": "AB-CD-123"
    }
  ]
}
 

Request   

GET api/v1/locations/{location_id}/bookings

Headers

Authorization      

Example: Bearer {YOUR_API_TOKEN}

Accept      

Example: application/json

URL Parameters

location_id   integer   

The ID of the location. Example: 8

Query Parameters

from   string   

Must be a valid ISO date. Example: 2021-11-01T00:00:00Z

to   string   

Must be a valid ISO date. The date must be after the from parameter. The date must be within one year from the current date. Maximum difference between the to and from parameters is 1 week. Example: 2021-01-02T00:00:00Z

GET api/v1/locations/{location_id}/bookables

requires authentication

Example request:
curl --request GET \
    --get "https://{your-flexopus-domain}/api/v1/locations/1/bookables" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Accept: application/json"
const url = new URL(
    "https://{your-flexopus-domain}/api/v1/locations/1/bookables"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://{your-flexopus-domain}/api/v1/locations/1/bookables';
$response = $client->get(
    $url,
    [
        '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/1/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
      "status": 0, // 0 => Flexible, 1 => Blocked, 2 => Assigned
      "tags": [
        "Adjustable height",
        "Quiet zone"
      ]
    },
    {
      "id": 445,
      "name": "Parking spot 2",
      "type": 1, // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
      "status": 2, // 0 => Flexible, 1 => Blocked, 2 => Assigned
      "tags": [
        "Electric charger"
      ]
    }
  ]
}
 

Request   

GET api/v1/locations/{location_id}/bookables

Headers

Authorization      

Example: Bearer {YOUR_API_TOKEN}

Accept      

Example: application/json

URL Parameters

location_id   integer   

The ID of the location. Example: 1

GET api/v1/locations/{location_id}/bookables/occupancy

requires authentication

Example request:
curl --request GET \
    --get "https://{your-flexopus-domain}/api/v1/locations/11/bookables/occupancy" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Accept: application/json"
const url = new URL(
    "https://{your-flexopus-domain}/api/v1/locations/11/bookables/occupancy"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://{your-flexopus-domain}/api/v1/locations/11/bookables/occupancy';
$response = $client->get(
    $url,
    [
        '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/11/bookables/occupancy'
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
  "data": [
    {
      "id": "1b16aa00-0848-47eb-bbca-0d45f3cd1fc3",
      "location_name": "Office 34",
      "type": 0 // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
      "name": "Table 24",
      "occupied": false
    },
    {
      "id": "cb56a871-53f5-4f00-83e2-0b5e4e6b6c51",
      "location_name": "Car park 4",
      "type": 1 // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
      "name": "Parking spot 2",
      "occupied": true
    }
  ]
}
 

Example response (200, when details=true):


{
  "data": [
    {
      "id": "1b16aa00-0848-47eb-bbca-0d45f3cd1fc3",
      "location_name": "Office 34",
      "type": 0 // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
      "name": "Table 24",
      "occupied": false,
      "booking_current": null,
      "booking_next": {
        "from_time": "2023-08-16T13:00:00.000000Z",
        "to_time": "2023-08-16T16:00:00.000000Z"
      }
    },
    {
      "id": "cb56a871-53f5-4f00-83e2-0b5e4e6b6c51",
      "location_name": "Car park 4",
      "type": 1 // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
      "name": "Parking spot 2",
      "occupied": true,
      "booking_current": {
        "from_time": "2023-08-16T09:00:00.000000Z",
        "to_time": "2023-08-16T12:00:00.000000Z"
      }
      "booking_next": null
    }
  ]
}
 

Request   

GET api/v1/locations/{location_id}/bookables/occupancy

Headers

Authorization      

Example: Bearer {YOUR_API_TOKEN}

Accept      

Example: application/json

URL Parameters

location_id   integer   

The ID of the location. Example: 11

Query Parameters

details   boolean  optional  

Booking from and to times are included when set to true

GET api/v1/bookables/{bookable_id}/bookings

requires authentication

Example request:
curl --request GET \
    --get "https://{your-flexopus-domain}/api/v1/bookables/1/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/bookables/1/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();
$url = 'https://{your-flexopus-domain}/api/v1/bookables/1/bookings';
$response = $client->get(
    $url,
    [
        '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/bookables/1/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",
            "user": {
                "id": 123,
                "name": "Dr. Eddie Torphy IV",
                "email": "dr.eddie.torphy.iv@example.com",
                "extensionAttributes": {
                    "extensionAttribute1": "value"
                }
            },
            "guest": null
        },
        {
            "id": 13862,
            "from": "2021-11-01T14:00:00.000000Z",
            "to": null,
            "livemap": "https://{your-flexopus-domain}/api/v1/bookings/13862/livemap",
            "user": {
                "id": 127,
                "name": "Lillie Bergnaum",
                "email": "lillie.bergnaum@example.com",
                "extensionAttributes": {
                    "extensionAttribute3": "other value"
                }
            },
            "guest": null,
            "license_plate": "AB-CD-123"
        }
    ]
}
 

Request   

GET api/v1/bookables/{bookable_id}/bookings

Headers

Authorization      

Example: Bearer {YOUR_API_TOKEN}

Accept      

Example: application/json

URL Parameters

bookable_id   integer   

The ID of the bookable. Example: 1

Query Parameters

from   string   

Must be a valid ISO date. Example: 2021-11-01T00:00:00Z

to   string   

Must be a valid ISO date. The date must be after the from parameter. The date must be within one year from the current date. Maximum difference between the to and from parameters is 1 week. Example: 2021-01-02T00:00:00Z

PATCH api/v1/bookables/{id}

requires authentication

Example request:
curl --request PATCH \
    "https://{your-flexopus-domain}/api/v1/bookables/17" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --data "{
    \"name\": \"Table 7\",
    \"status\": 0
}"
const url = new URL(
    "https://{your-flexopus-domain}/api/v1/bookables/17"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

let body = {
    "name": "Table 7",
    "status": 0
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://{your-flexopus-domain}/api/v1/bookables/17';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'name' => 'Table 7',
            'status' => 0,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://{your-flexopus-domain}/api/v1/bookables/17'
payload = {
    "name": "Table 7",
    "status": 0
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

response = requests.request('PATCH', url, headers=headers, json=payload)
response.json()

Example response (200):


{
  "data": {
    "id": 30,
    "name": "Table 29",
    "type": 0, // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
    "status": 0, // 0 => Flexible, 1 => Blocked, 2 => Assigned
    "tags": [
      "Adjustable height",
      "Quiet zone"
    ]
  }
}
 

Request   

PATCH api/v1/bookables/{id}

Headers

Authorization      

Example: Bearer {YOUR_API_TOKEN}

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

id   integer   

The id of the bookable object to update. Example: 17

Body Parameters

name   string  optional  

The name of the object.
Maximum 255 characters long.
Example: Table 7

description   string  optional  

Description of the object.
Maximum 255 characters long.
Set to null to clear the description field.

status   integer  optional  

The desired status of the object.
Must be either 0 (flexible) or 1 (blocked).
Setting the status to 2 (assigned) is not yet possible using the API.
Warning! Setting the status to 1 (blocked) does not delete reservations. However, it is possible to delete them using other endpoints.
Example: 0

tags   string[]  optional  

List of tags on the object
Each tag in the array can be maximum 255 characters long.
Can be an empty array to remove all tags.
Warning! The list provided here overwrites the list of tags on the object.
To leave the tags unchanged, omit this field from your request.

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();
$url = 'https://{your-flexopus-domain}/api/v1/bookings';
$response = $client->get(
    $url,
    [
        '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
        "status": 0 // 0 => Flexible, 1 => Blocked, 2 => Assigned
        "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",
        "extensionAttributes": {
          "extensionAttribute3": "other value"
        }
      },
      "guest": null,
      "license_plate": "AB-CD-123"
    },
    {
      "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
        "status": 0 // 0 => Flexible, 1 => Blocked, 2 => Assigned
        "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",
        "extensionAttributes": {
          "extensionAttribute1": "value"
        }
      },
      "guest": "Irwin Muller"
    }
  ]
}
 

Request   

GET api/v1/bookings

Headers

Authorization      

Example: Bearer {YOUR_API_TOKEN}

Accept      

Example: application/json

Query Parameters

from   string   

Must be a valid ISO date. Example: 2021-11-01T00:00:00Z

to   string   

Must be a valid ISO date. The date must be after the from parameter. The date must be within one year from the current date. Maximum difference between the to and from parameters is 1 week. Example: 2021-01-02T00:00:00Z

POST api/v1/bookings

requires authentication

Example request:
curl --request POST \
    "https://{your-flexopus-domain}/api/v1/bookings" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --data "{
    \"bookable_id\": 30,
    \"from_time\": \"2023-08-16T13:00:00.000000Z\",
    \"to_time\": \"2023-08-16T16:00:00.000000Z\",
    \"user_id\": 10,
    \"location_id\": 4,
    \"guest_email\": \"johndoe@flexopus.com\",
    \"guest_name\": \"John Doe\",
    \"booking_info\": \"Meeting with John\",
    \"user_vehicle_id\": 1
}"
const url = new URL(
    "https://{your-flexopus-domain}/api/v1/bookings"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

let body = {
    "bookable_id": 30,
    "from_time": "2023-08-16T13:00:00.000000Z",
    "to_time": "2023-08-16T16:00:00.000000Z",
    "user_id": 10,
    "location_id": 4,
    "guest_email": "johndoe@flexopus.com",
    "guest_name": "John Doe",
    "booking_info": "Meeting with John",
    "user_vehicle_id": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://{your-flexopus-domain}/api/v1/bookings';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'bookable_id' => 30,
            'from_time' => '2023-08-16T13:00:00.000000Z',
            'to_time' => '2023-08-16T16:00:00.000000Z',
            'user_id' => 10,
            'location_id' => 4,
            'guest_email' => 'johndoe@flexopus.com',
            'guest_name' => 'John Doe',
            'booking_info' => 'Meeting with John',
            'user_vehicle_id' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://{your-flexopus-domain}/api/v1/bookings'
payload = {
    "bookable_id": 30,
    "from_time": "2023-08-16T13:00:00.000000Z",
    "to_time": "2023-08-16T16:00:00.000000Z",
    "user_id": 10,
    "location_id": 4,
    "guest_email": "johndoe@flexopus.com",
    "guest_name": "John Doe",
    "booking_info": "Meeting with John",
    "user_vehicle_id": 1
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
  "data": [
    {
      "id": 138,
      "from": "2023-08-16T13:00:00.000000Z",
      "to": "2023-08-16T16:00:00.000000Z",
      "livemap": "https://{your-flexopus-domain}/api/v1/bookings/138/livemap",
      "bookable": {
        "id": 30,
        "name": "Table 29",
        "type": 0, // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
        "status": 0 // 0 => Flexible, 1 => Blocked, 2 => Assigned
        "location": {
          "id": 4,
          "name": "Floor 1",
          "code": "FP1"
        }
      },
      "user": {
        "id": 10,
        "name": "John Doe",
        "email": "johndoe@flexopus.com",
        "extensionAttributes": {
          "extensionAttribute10": "another value"
        }
      }
    }
  ]
}
 

Request   

POST api/v1/bookings

Headers

Authorization      

Example: Bearer {YOUR_API_TOKEN}

Accept      

Example: application/json

Content-Type      

Example: application/json

Body Parameters

bookable_id   integer   

The bookable's id. Example: 30

from_time   string  optional  

When the booking will start. Can be set to null to use the current time. Example: 2023-08-16T13:00:00.000000Z

to_time   string   

When the booking will end. Example: 2023-08-16T16:00:00.000000Z

user_id   integer   

The ID of the user to whom the reservation is made. Example: 10

location_id   integer   

The Location's ID. Example: 4

guest_email   string  optional  

If it is a guest booking, then the guest's email address. Example: johndoe@flexopus.com

guest_name   string  optional  

If it is a guest booking, then the guest's name. Example: John Doe

booking_info   string  optional  

If it is a guest booking, then the purpose of the booking. Example: Meeting with John

user_vehicle_id   integer  optional  

If the reservation refers to a parking space and a vehicle is required, then its ID. Example: 1

PUT api/v1/bookings/{id}

requires authentication

Example request:
curl --request PUT \
    "https://{your-flexopus-domain}/api/v1/bookings/12" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --data "{
    \"from_time\": \"2023-08-16T13:00:00.000000Z\",
    \"to_time\": \"2023-08-16T16:00:00.000000Z\",
    \"user_vehicle_id\": 1
}"
const url = new URL(
    "https://{your-flexopus-domain}/api/v1/bookings/12"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

let body = {
    "from_time": "2023-08-16T13:00:00.000000Z",
    "to_time": "2023-08-16T16:00:00.000000Z",
    "user_vehicle_id": 1
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://{your-flexopus-domain}/api/v1/bookings/12';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'from_time' => '2023-08-16T13:00:00.000000Z',
            'to_time' => '2023-08-16T16:00:00.000000Z',
            'user_vehicle_id' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://{your-flexopus-domain}/api/v1/bookings/12'
payload = {
    "from_time": "2023-08-16T13:00:00.000000Z",
    "to_time": "2023-08-16T16:00:00.000000Z",
    "user_vehicle_id": 1
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (200):


{
  "data": {
    "id": 138,
    "from": "2023-08-16T13:00:00.000000Z",
    "to": "2023-08-16T16:00:00.000000Z",
    "livemap": "https://{your-flexopus-domain}/api/v1/bookings/138/livemap",
    "bookable": {
      "id": 30,
      "name": "Table 29",
      "type": 0, // 0 => Desk, 1 => Parking spot, 2 => Meeting room, 3 => Home office
      "status": 0 // 0 => Flexible, 1 => Blocked, 2 => Assigned
      "location": {
        "id": 4,
        "name": "Floor 1",
        "code": "FP1"
      }
    },
    "user": {
      "id": 10,
      "name": "John Doe",
      "email": "johndoe@flexopus.com",
      "extensionAttributes": {
        "extensionAttribute10": "another value"
      }
    }
  }
}
 

Request   

PUT api/v1/bookings/{id}

PATCH api/v1/bookings/{id}

Headers

Authorization      

Example: Bearer {YOUR_API_TOKEN}

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

id   integer   

The booking's id. Example: 12

Body Parameters

from_time   string  optional  

When the booking will start. Can be set to null to use the current time. Example: 2023-08-16T13:00:00.000000Z

to_time   string   

When the booking will end. Example: 2023-08-16T16:00:00.000000Z

user_vehicle_id   integer  optional  

If the reservation refers to a parking space and a vehicle is required, then its ID. Example: 1

DELETE api/v1/bookings/{id}

requires authentication

Example request:
curl --request DELETE \
    "https://{your-flexopus-domain}/api/v1/bookings/16" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Accept: application/json"
const url = new URL(
    "https://{your-flexopus-domain}/api/v1/bookings/16"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://{your-flexopus-domain}/api/v1/bookings/16';
$response = $client->delete(
    $url,
    [
        '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/bookings/16'
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (204):

[Empty response]
 

Request   

DELETE api/v1/bookings/{id}

Headers

Authorization      

Example: Bearer {YOUR_API_TOKEN}

Accept      

Example: application/json

URL Parameters

id   integer   

The booking's id. Example: 16