Appointment Session API Documentation

Modified on Fri, 21 Aug at 1:12 PM

Appointment session API  •  Version 1.00  •  Prepared by Daniel Norman & Mike Emery  •  3 January 2020

Introduction

The appointment session API creates an appointment session based on an appointment type and a leadId. After each successful creation, a URL is returned which can then be used to display the new appointment screen in an iFrame or a new window — allowing your customer to book an appointment based on your availability. After submitting the appointment session, the session is then closed.

Resource URL

POST

https://<your_domain>/api/v2/appointment-sessions

Where <your_domain> is your complete FLG 360 domain. For example:

https://demo.flg360.co.uk/api/v2/appointment-sessions

Resource Information

Request headers

HeaderDatatypeDescription
authorizationstringThis is a string in the form Bearer <api_key> (without the quotes).

Where <api_key> is an access key with Appointments permissions. This is set in Settings > Configuration > Access Keys — check the ‘Allow access to Appointments’ option.

Request body parameters

ParameterDatatypeDescription
leadstringThe ID of the lead you want to create a new appointment session on.
appointmentTypestringA UUID that is the ID of the appointment type you want to use for your new appointment. It must belong to the same lead group as the lead, or be marked for all lead groups.

To retrieve the Appointment type ID, go to Settings > Appointments and select the relevant appointment type. Click the options icon (three dots) in the top right corner and select Properties.

Example Request

Header

authorization: Bearer 6Pr9827YMLXhVkSk0LoABgRQasbaXYrM

Body

{
  "lead": "108123759",
  "appointmentType": "39594a1c-72db-4990-a63f-8d5139a5e4e1"
}

Example Response

The publicUrl value is the one you use to display the appointment booking screen in an iFrame or in a new window.

{
  "sessionId": "0260be7f-7c73-45ae-a1d0-2c7328151d38",
  "lead": "108123758",
  "appointmentType": "4da80d92-e6fb-432e-a631-aea2b1e97a05",
  "closesAt": "2020-01-05T09:55:31.735Z",
  "publicUrl": "https://platform.getflg.com/appointments/book/8c18a3004f44fb980310164faa6fd7e9_54f530e2bba209d8a6d481f7894b554e7756850205d98de98ab64a18dd7a677957dfb04a95ec370fbf5e721131c83959e1e5b2d1f00d38a1570db81cf8c5aa957de75293a673c064712c6a97ee4c9534264555727faf7ac129f2103987c8c524c30d8ad2ff063cb6f4250f3813569871d68c51ef043fb689fb1cb5173678e91e834cb31d65b571cf1ce35c3a0ba984d1bc80fdbb81afb6ee430c7a9b53fbf101a30180a9ff3844c954de8b0c8f21eb1f200e853a8a216ab9566d64dd8e5fb936"
}

HTTP Responses

Response codeDescription
200POST request was sent successfully and the session was created.
400The appointment type or lead were not specified or could not be found. Or the lead’s lead group did not match the appointment’s lead group.
401The authorization token or key is invalid.
403The authorization token or key was valid, but it did not have the necessary permissions set.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article