Real-Time Sequencing ALPHA

Required plan: Growth

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_567236000909002",
                  "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_678347111010113",
                  "available_periods": [
                    {
                      "start": "2021-09-26T09:00:00Z",
                      "end": "2021-09-26T12:00:00Z"
                    },
                    {
                      "start": "2021-09-27T10:00:00Z",
                      "end": "2021-09-27T20:00:00Z"
                    }
                  ]
                }
              ],
              "required":"all"
            }
          ],
          "event": {
            "event_id": "qTtZdczOccgaPncGJaCiLg",
            "summary": "Face to face"
          },
          "required_duration":{ "minutes": 60 }
        }
      ],
      "available_periods": [
        {
          "start": "2021-09-26T09:00:00Z",
          "end": "2021-09-26T18:00:00Z"
        },
        {
          "start": "2021-09-27T09:00:00Z",
          "end": "2021-09-27T18:00:00Z"
        }
      ]
  },
  "target_calendars": [
    {
      "sub": "acc_567236000909002",
      "calendar_id": "cal_n23kjnwrw2_jsdfjksn234"
    }
  ],
  "callback_url": "http://www.example.com/callback"
}

Example Response #

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

{
  "real_time_sequencing": {
    "real_time_sequencing_id": "seq_4353945880944395",
    "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 omited.

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 Availability documentation.

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

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": "2021-09-26T11:00:00Z",
      "tzid": "Europe/London"
    },
    "end": {
      "time": "2021-09-26T13:00:00Z",
      "tzid": "Europe/London"
    },
    "summary": "Product Manager Interview at Globex"
  },
  "participants": [
    { "sub": "acc_567236000909002" }
  ],
  "sequence":[
    {
      "sequence_id":"123",
      "event": {
        "event_id": "qTtZdczOccgaPncGJaCiLg",
        "start": "2021-09-26T11:00:00Z",
        "end": "2021-09-26T12:00:00Z",
        "summary": "Pre screen"
      },
      "participants":[ { "sub":"acc_567236000909002" } ]
    },
    {
      "sequence_id":"456",
      "event": {
        "event_id": "qTtZdczOccgaPncGJaCiLg",
        "start": "2021-09-26T12:00:00Z",
        "end": "2021-09-26T13:00:00Z",
        "summary": "Face to face"
      },
      "participants":[ { "sub":"acc_678347111010113" } ]
    }
  ]
}

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.

In This Section