POST Unavailable Slots
Following endpoint will be used to retrieve all the times that are blocked off.
Get list of unavailable time slots
In some cases you want to see what time slots are unavailable for your resource this endpoint will give you all unavailable time slots for your resources.
Endpoint
POST https://api.timekit.io/v2/unavailable/slots
Parameters
| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
from |
body | string | now | Defines the beginning of the search-space written is human language, eg. "1 day", "2 weeks" or "tomorrow" | |
to |
body | string | 4 weeks | Defines the end of the search-space written is human language, eg. "1 day", "2 weeks" or "tomorrow" (max 6 months) | |
project_id |
body | string | If you're using our projects model, specify the project ID and all parameters to the endpoint will be retrieved dynamically from the project. Any additional parameters in the request are not required and will override those set in the project. | ||
resources |
body | array_string | Array of resource IDs that should be included in the availability search | ||
length |
body | string | How long each available time-slot should be (minimum 1 second). If you omit it (and the project does not set one), free periods of varying length are used instead of fixed-length time-slots. To get this, leave the key out: sending null or "Null" is rejected. |
||
buffer |
body | string | 0 mins | The amount of buffer time you want to pad around existing events (cannot be negative) https://developers.timekit.io/reference/query-availability-v2#section-buffer-time | |
timeslot_increments |
body | string | Define at which time increments the time-slots should start (minimum 5 minutes). Please se the note | ||
output_timezone |
body | string | UTC | If you want the outputted time-slots to be formatted to a particular timezone, set it with this parameter. Please note that this parameter will not affect the resource-relative timezones of the constraints. Please see our constraints section for further information. |
Request examples
curlcurl --request POST \
--url https://api.timekit.io/v2/unavailable/slots \
--header 'Content-Type: application/json' \
--user :live_api_key_7nzvc7wsBQQISLeFSVhROys9V1bUJ1z7 \
--data '{
"to": "2022-06-08",
"from": "2022-06-07",
"output_timezone": "America\/Toronto",
"project_id": "f7df8e1e-f04b-4e3f-9376-ed82b41f4036",
"resources": [
"a6fc1bdb-8035-4007-919b-6276b9124eb8"
]
}'
Response examples
200
json{
"data": [
{
"start": "2022-06-07T17:00:00+00:00",
"end": "2022-06-07T18:00:00+00:00",
"resources": [
{
"name": "John Doe",
"timezone": "America/Toronto",
"id": "a6fc1bdb-8035-4007-919b-6276b9124eb8"
}
]
}
]
}