Real-Time Sequencing BETA

Required plan: Emerging

Description #

Returns a URL to a form where a user can select their preferred date and time for a sequence of events based upon live availability information.

URL format #

{data_center_url}/v1/real_time_scheduling

Example Request #

POST /v1/real_time_sequencing HTTP/1.1
Host: {data_center_url}
Authorization: Bearer {API_KEY}
Content-Type: application/json; charset=utf-8

{
  "oauth": {
    "redirect_uri": "{REDIRECT_URI}",
  },
  "event": {
    "event_id": "qTtZdczOccgaPncGJaCiLg",
    "summary": "Product Manager Interview at Globex",
    "tzid": "Europe/London"
  },
  "availability": {
      "sequence":[
        {
          "sequence_id":"123",
          "ordinal":1,
          "participants":[
            {
              "members":[
                {
                  "sub":"acc_5ba21743f408617d1269ea1e",
                  "calendar_ids":[ "cal_n23kjnwrw2_jsdfjksn234" ]
                }
              ],
              "required":"all"
            }
          ],
          "event": {
            "event_id": "qTtZdczOccgaPncGJaCiLg",
            "summary": "Pre screen"
          },
          "required_duration":{ "minutes": 60 }
        },
        {
          "sequence_id":"456",
          "ordinal":2,
          "participants":[
            {
              "members":[
                {
                  "sub": "acc_64b17d868090ea21640c914c",
                  "available_periods": [
                    {
                      "start": "2024-07-28T09:00:00Z",
                      "end": "2024-07-28T12:00:00Z"
                    },
                    {
                      "start": "2024-07-29T10:00:00Z",
                      "end": "2024-07-29T20:00:00Z"
                    }
                  ]
                }
              ],
              "required":"all"
            }
          ],
          "event": {
            "event_id": "qTtZdczOccgaPncGJaCiLg",
            "summary": "Face to face"
          },
          "required_duration":{ "minutes": 60 }
        }
      ],
      "query_periods": [
        {
          "start": "2024-07-28T09:00:00Z",
          "end": "2024-07-28T18:00:00Z"
        },
        {
          "start": "2024-07-29T09:00:00Z",
          "end": "2024-07-29T18:00:00Z"
        }
      ]
  },
  "target_calendars": [
    {
      "sub": "acc_5ba21743f408617d1269ea1e",
      "calendar_id": "cal_n23kjnwrw2_jsdfjksn234"
    }
  ],
  "callback_url": "http://www.example.com/callback",
  "selection_mode": "no_confirm"
}

Example Response #

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

{
  "real_time_sequencing": {
    "real_time_sequencing_id": "seq_64b185388090ea21640c915e",
    "url": "{REAL_TIME_SEQUENCING_URL}"
  }
}

Request parameters #

data_center_url required

The URL for the data center you want to communicate with. Possible choices are:

  • api-au.cronofy.com - πŸ‡¦πŸ‡Ί Australia
  • api-ca.cronofy.com - πŸ‡¨πŸ‡¦ Canada
  • api-de.cronofy.com - πŸ‡©πŸ‡ͺ Germany
  • api-sg.cronofy.com - πŸ‡ΈπŸ‡¬ Singapore
  • api-uk.cronofy.com - πŸ‡¬πŸ‡§ United Kingdom
  • api.cronofy.com - πŸ‡ΊπŸ‡Έ United States

Find out more about Cronofy's data centers.

API_KEY required  #

The client_secret of the client.

event required  #

An object with the details of the event you wish to push into the user’s selected calendar. Details of what parameters this object can hold can be found in the create or update event documentation.

Please note that event.attendees is not supported for Real Time Scheduling.

The start and end parameters should be omitted.

availability required  #

An object with the details of the availability query used to determine the available time periods for the user to choose for the sequence date and time. Details of what parameters this object can hold can be found in the Sequenced Availability documentation.

Note that when a group requires only some of the members, the order the members are listed in will be used as a soft-preference for who is selected. If you want to evenly distribute events to members across several tokens, you should shuffle this list so each request has the members in a random order.

availability.sequence.event required  #

An object with the details of the event you wish to push into the user’s selected calendar. Details of what parameters this object can hold can be found in the create or update event documentation.

Please note that event.attendees is not supported for Real Time Scheduling.

The start and end parameters should be omitted.

Response parameters #

url  #

The URL to direct the user to in order to authorize their calendar account and have the event inserted into their selected calendar.

Example callback #

POST {CALLBACK_URL_PATH} HTTP/1.1
Host: {CALLBACK_URL_HOST}
Content-Type: application/json; charset=utf-8
Cronofy-HMAC-SHA256: {Base64(HmacSHA256(body_bytes, CLIENT_SECRET))}

{
  "event": {
    "event_id": "qTtZdczOccgaPncGJaCiLg",
    "start": {
      "time": "2024-07-28T11:00:00Z",
      "tzid": "Europe/London"
    },
    "end": {
      "time": "2024-07-28T13:00:00Z",
      "tzid": "Europe/London"
    },
    "summary": "Product Manager Interview at Globex"
  },
  "participants": [
    { "sub": "acc_5ba21743f408617d1269ea1e" }
  ],
  "sequence":[
    {
      "sequence_id":"123",
      "event": {
        "event_id": "qTtZdczOccgaPncGJaCiLg",
        "start": "2024-07-28T11:00:00Z",
        "end": "2024-07-28T12:00:00Z",
        "summary": "Pre screen"
      },
      "participants":[ { "sub":"acc_5ba21743f408617d1269ea1e" } ]
    },
    {
      "sequence_id":"456",
      "event": {
        "event_id": "qTtZdczOccgaPncGJaCiLg",
        "start": "2024-07-28T12:00:00Z",
        "end": "2024-07-28T13:00:00Z",
        "summary": "Face to face"
      },
      "participants":[ { "sub": "acc_64b17d868090ea21640c914c" } ]
    }
  ]
}

Request headers #

Cronofy-HMAC-SHA256  #

Can optionally be used to verify that the notification was sent by Cronofy.

This HMAC uses the SHA256 algorithm, keyed with the application's client secret, to generate a Base64 encoded hash of the request body.

When an application has multiple active client secrets, a value is generated for each active secret, separated by commas. For example:

Cronofy-HMAC-SHA256: {HMAC_FROM_SECRET_1},{HMAC_FROM_SECRET_2}

Examples are available in our cronofy/notification-hmac-examples Github repository, and our API libraries include methods to verify this header.

Request parameters #

event  #

An object with the details of the end users event based on the period of time selected. Details of what parameters this object can hold can be found in the create or update event documentation.

participants  #

An array of all the participants which were selected for the events contained in the sequence based on their availability.

sequence  #

An array of available periods which match the selection made by the user in Real Time Scheduling.

sequence.sequence_id  #

A value to identify this part of the sequence.

sequence.start  #

Thestart of an available period as a Time.

sequence.end  #

Theend of an available period as a Time.

sequence.participants  #

An array of participants that are available for the given period.

sequence.participants.sub  #

The internal Cronofy ID for the account, as an ASCII-only String.

selection_mode optional  #

A String indicating how users select their time slot. Supports the following options:

  • no_confirm (Default) - Selecting a time books the event immediately
  • confirm - The user is taken to a confirmation page after selecting a time, before the event is booked

In This Section