curl --request POST \
--url https://api.spacebring.com/resources/v1/{resourceId}/availability \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"endDate": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z",
"entire": true,
"quantity": 4503599627370496,
"recurrence": [
"<string>"
]
}
'import requests
url = "https://api.spacebring.com/resources/v1/{resourceId}/availability"
payload = {
"endDate": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z",
"entire": True,
"quantity": 4503599627370496,
"recurrence": ["<string>"]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
endDate: '2023-11-07T05:31:56Z',
startDate: '2023-11-07T05:31:56Z',
entire: true,
quantity: 4503599627370496,
recurrence: ['<string>']
})
};
fetch('https://api.spacebring.com/resources/v1/{resourceId}/availability', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.spacebring.com/resources/v1/{resourceId}/availability",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'endDate' => '2023-11-07T05:31:56Z',
'startDate' => '2023-11-07T05:31:56Z',
'entire' => true,
'quantity' => 4503599627370496,
'recurrence' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.spacebring.com/resources/v1/{resourceId}/availability"
payload := strings.NewReader("{\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"entire\": true,\n \"quantity\": 4503599627370496,\n \"recurrence\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.spacebring.com/resources/v1/{resourceId}/availability")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"entire\": true,\n \"quantity\": 4503599627370496,\n \"recurrence\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spacebring.com/resources/v1/{resourceId}/availability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"entire\": true,\n \"quantity\": 4503599627370496,\n \"recurrence\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"available": true,
"reason": {
"code": "<string>",
"message": "<string>"
}
}{
"message": "<string>",
"type": "<string>"
}Check resource availability
Check whether a resource can be booked for a slot before creating the booking. The same rules as booking creation apply: capacity, the location and resource schedule, duration limits and the booking window. When the slot is unavailable, the response carries the code the booking would fail with.
OAuth
Required scopes:resources.readonly or resourcescurl --request POST \
--url https://api.spacebring.com/resources/v1/{resourceId}/availability \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"endDate": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z",
"entire": true,
"quantity": 4503599627370496,
"recurrence": [
"<string>"
]
}
'import requests
url = "https://api.spacebring.com/resources/v1/{resourceId}/availability"
payload = {
"endDate": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z",
"entire": True,
"quantity": 4503599627370496,
"recurrence": ["<string>"]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
endDate: '2023-11-07T05:31:56Z',
startDate: '2023-11-07T05:31:56Z',
entire: true,
quantity: 4503599627370496,
recurrence: ['<string>']
})
};
fetch('https://api.spacebring.com/resources/v1/{resourceId}/availability', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.spacebring.com/resources/v1/{resourceId}/availability",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'endDate' => '2023-11-07T05:31:56Z',
'startDate' => '2023-11-07T05:31:56Z',
'entire' => true,
'quantity' => 4503599627370496,
'recurrence' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.spacebring.com/resources/v1/{resourceId}/availability"
payload := strings.NewReader("{\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"entire\": true,\n \"quantity\": 4503599627370496,\n \"recurrence\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.spacebring.com/resources/v1/{resourceId}/availability")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"entire\": true,\n \"quantity\": 4503599627370496,\n \"recurrence\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spacebring.com/resources/v1/{resourceId}/availability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"entire\": true,\n \"quantity\": 4503599627370496,\n \"recurrence\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"available": true,
"reason": {
"code": "<string>",
"message": "<string>"
}
}{
"message": "<string>",
"type": "<string>"
}Authorizations
See our authentication documentation for how to authorize your requests
Headers
The id of the network. Required when using bearer token authentication
Path Parameters
The id of the resource.
Body
The end of the slot to check, in ISO 8601.
The start of the slot to check, in ISO 8601.
Set to true to check the entire resource instead of individual seats. Supported for office resources.
The number of seats to check. Required for seat-based resources such as hot desks, unless entire is true.
1 <= x <= 9007199254740991RRULE lines describing a repeating slot, e.g. RRULE:FREQ=WEEKLY;COUNT=10. The DTSTART line is derived from startDate. The slot is unavailable as soon as any occurrence is.
Was this page helpful?