Availability Slots ALPHA

Description

By default the Availability API returns a series of Available Periods that match the criteria provided. These can be long enough to support multiple slots and give the receiving application complete flexibity over how to pack and organize slots before rendering to a user.

This feature allows the calling application to specify that the response should be returned as a series of non-overlapping slots.

It introduces the following new parameter.

response_format optional  #

This can be one of the following values:

  • periods
  • slots
  • overlapping_slots

The default is periods if not specified.

It also works in conjuction with start_interval to control the distribution of the slots. slots will generate contiguous slots, whereas overlapping_slots will generate slots starting every start_interval.

Example Request

POST /v1/availability HTTP/1.1
Host: api.cronofy.com
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json; charset=utf-8

{
  "response_format" : "slots",
  "participants": [
    {
      "members": [
        {
          "sub": "acc_567236000909002",
          "calendar_ids": ["cal_n23kjnwrw2_jsdfjksn234"]
        }
      ],
      "required": "all"
    }
  ],
  "required_duration": { "minutes": 30 },
  "start_interval": { "minutes" : 60 },
  "available_periods": [
    {
      "start": "2019-04-25T09:00:00Z",
      "end": "2019-04-25T18:00:00Z"
    }
  ],
}

Example Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "available_slots": [
    {
      "start": "2019-04-25T09:00:00Z",
      "end": "2019-04-25T09:30:00Z",
      "participants": [
        { "sub": "acc_567236000909002" }
      ]
    },
    {
      "start": "2019-04-25T10:00:00Z",
      "end": "2019-04-25T10:30:00Z",
      "participants": [
        { "sub": "acc_567236000909002" }
      ]
    },
    {
      "start": "2019-04-25T14:00:00Z",
      "end": "2019-04-25T14:30:00Z",
      "participants": [
        { "sub": "acc_567236000909002" }
      ]
    }
  ]
}
Search