AlmondTill/G3N API

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).

Before you call

A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.

Capability area: Reading your records — Looking up and listing the records of your organization.

Roles that may call it:

Arguments

NameTypeRequiredNotes
resourceIdID ID!yes
fromString String!yes
toString String!yes

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

graphql
query ExampleSchedulableResourceAvailability($resourceId: ID!, $from: String!, $to: String!) {
  schedulableResourceAvailability(resourceId: $resourceId, from: $from, to: $to) {
    resourceId
    capacity
  }
}

Variables:

json
{
  "resourceId": "01900000-0000-7000-8000-23b0d8150000",
  "from": "<from>",
  "to": "<to>"
}

Example response

json
{
  "data": {
    "schedulableResourceAvailability": {
      "resourceId": "01900000-0000-7000-8000-23b0d8150000",
      "capacity": 1
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer