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
| Header | Datatype | Description |
|---|---|---|
| authorization | string | This 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
| Parameter | Datatype | Description |
|---|---|---|
| lead | string | The ID of the lead you want to create a new appointment session on. |
| appointmentType | string | A 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 code | Description |
|---|---|
| 200 | POST request was sent successfully and the session was created. |
| 400 | The 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. |
| 401 | The authorization token or key is invalid. |
| 403 | The 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
Feedback sent
We appreciate your effort and will try to fix the article