On this page
schedulableResourceAvailability
query · in the family Reading your records
What it does
One resource’s availability facts over a window (at most 31 days) — its advisory hours, capacity and the reserved bookings; compose free slots from them.
ONE resource's availability facts over [from, to): the advisory weekly hours + the capacity + the RESERVED bookings overlapping the window. The resource must exist in YOUR org group. The client composes free slots. Requires authentication (template class).
Who may call it
Capability area: Reading your records — Looking up and listing the records of your organization.
- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- An API key whose scope allows
api:schedulableResourceAvailability
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
resourceId | ID ID! | yes | No further notes. |
from | String String! | yes | No further notes. |
to | String String! | yes | No further notes. |
Returns
SchedulableResourceAvailability SchedulableResourceAvailability! — The availability answer — the SRCD's own words: availability = resource hours − booked appointments (DERIVED; the client composes free slots; zero server timezone math — hours are naive wall-clock ADVISORY).
Example request
query ExampleSchedulableResourceAvailability($resourceId: ID!, $from: String!, $to: String!) {
schedulableResourceAvailability(resourceId: $resourceId, from: $from, to: $to) {
resourceId
capacity
}
}
Variables:
{
"resourceId": "01900000-0000-7000-8000-33025eb00000",
"from": "<from>",
"to": "<to>"
}
Example response
{
"data": {
"schedulableResourceAvailability": {
"resourceId": "01900000-0000-7000-8000-33025eb00000",
"capacity": 1
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}
Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. (NOT_FOUND)