Retrieve all blockout times of a room
Use this API to retrieve all blockout times of the specified room.
You must specify center_id, start_date and end_date. Note: The duration between the start_date and the end_date must be less than 10 days.
Before you begin
- You need a valid API key or access token. See Set up API authentication.
Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.
Endpoint
GET /v1/rooms/{room_id}/blockouttimes
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| room_id | string | Yes | Mandatory Unique 32-character identifier of the room for which this API returns the corresponding blockout times information. |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| center_id | string | Yes | — | Unique 32-character identifier of the center for which you want to retrieve the room's blockout times. |
| start_date | string (date) | Yes | — | Start date from which this API returns the corresponding blockout times information of the room. |
| end_date | string (date) | Yes | — | End date until which this API returns the corresponding blockout times information of the room. Note: The duration between the start_date and the end_date must be less than 10 days. |
Response
Success (200 OK)
{
"block_out_times": [
{
"...": "..."
}
],
"error": {}
}
Response fields
| Field | Type | Description |
|---|---|---|
| block_out_times | object[] | |
| block_out_times[].block_out_time_id | string | |
| block_out_times[].employee | object | |
| block_out_times[].room | object | |
| block_out_times[].block_out_time_type | object | |
| block_out_times[].start_time | string | |
| block_out_times[].end_time | string | |
| block_out_times[].start_time_in_center | string | |
| block_out_times[].end_time_in_center | string | |
| block_out_times[].notes | string | |
| block_out_times[].recurring_block_out_time | object | |
| error | object |
Example
curl --request GET \
--url 'https://api.zenoti.com/v1/rooms/{room_id}/blockouttimes?center_id={{center_id}}&start_date={{start_date}}&end_date={{end_date}}' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/rooms/{room_id}/blockouttimes', {
method: 'GET',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.get(
'https://api.zenoti.com/v1/rooms/{room_id}/blockouttimes',
headers={
'Authorization': 'bearer {{access_token}}',
},
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.GetAsync(
"https://api.zenoti.com/v1/rooms/{room_id}/blockouttimes");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/rooms/{room_id}/blockouttimes')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
response = http.request(request)
data = JSON.parse(response.body)
Error codes
| Status | Description |
|---|---|
| 400 | 400 |
| 401 | Unauthorized -- invalid or expired access token |
| 429 | Too many requests -- rate limit exceeded |