Show round robin availability and book an available slot
meetergo API allows you to fetch availability of a host or a round robin queue in order to make a booking on an available slot. The advantage is that your developers get an easy-to-use and battle-tested API to integrate scheduling into your product, while your sales and support representatives use the UI to manage their appointments, calendar connections, notifications or even Workflows.
In this guide, I will show you how to first fetch available appointments slots, in order to then make a booking on an available slot. Doing so is easy, there are only two API calls with well-structured data.
An example use case for this is to create a custom form on your website where a live appointment booking is integrated seemlessly and without any third-party branding. This is useful if you have a highly customized or styled form.
Step 1: Set up meeting type
We will need to set up a meeting type for our team. A meeting type holds the configuration for the meeting such as duration, calendar invite title/description, notifications and more.
Let's set up a meeting type that can easily be adjusted by your team later.
- Go to meetergo: Log in to the meetergo UI if you haven't already.
- Create a team: Go to Team Settings by clicking the gear icon in the top right and selecting teams. A team is like a workspace and is used to group or reuse your configurations across your whole organization. If no team exists, create one and give it a name. Users can be added to the team later. You may want to adjust the teams slug as it is used in outward-facing links.
- Create a meeting type: Go to your meeting types by clicking the calendar icon in the top right and selecting "Meeting types". Now, click on "New" and select a team from your organization. You can make adjustments now or configure the meeting type later. For now, make sure the meeting type is active.
- Get meeting type ID: After creating your meeting type, you can see the meeting type ID in the URL of your browser.
You can see the meeting type ID in the browser while viewing meeting type settings.
/meeting-types/edit/1c89cd41-b2e9-21as-d9sx-b0axs284962/general
Finally, let's use the meeting type ID to fetch all information about our meeting type using the following authenticated GET-Request.
GET https://api.meetergo.com/meeting-type/<your meeting type ID>
In the response, you will see a queueId
. Note it down so that we can use it in the next step!
Step 2: Retrieve Availability
Now that we are done setting up the backend, its time to write our actual application code.
Whenever a user visits our application, we need to fetch the availability so that we can show only available time slots. This is done via the following GET-request:
GET /booking-availability/v2?queueId=<your queue ID>&meetingTypeId=<your meeting type id>&start=<ISO formatted time>&end=<ISO formatted time>
This request will return an answer like this:
{
"timezone": "utc",
"timeframes": [
{ "start": "2023-10-09T08:00:00.000Z", "end": "2023-10-09T10:00:00.000Z" },
{ "start": "2023-10-09T11:00:00.000Z", "end": "2023-10-09T12:00:00.000Z" },
{ "start": "2023-10-10T08:00:00.000Z", "end": "2023-10-10T10:00:00.000Z" }
]
}
In the response, you will find an array of ISO-formatted start and end times. You can now show these timeframes to your users as available time slots.
Step 3: Make a booking
Now that we are able to show available time slots, we need to configure a button that will make a booking on the provided time slot.
To book an appointment, use the following API and provide the meeting type ID, queue ID, host IDs, start time, and participant data:
POST /booking
The body needs to include the following data:
{
"attendee": {
"email": "claudia@meetergo.com",
"firstname": "Claudia",
"lastname": "B",
"fullname": "Claudia B",
"receiveReminders": true,
"bringalongEmails": [],
"notes": {
"field1": "value1"
},
"phone": "+490",
"language": "de",
"timezone": "Europe/Berlin",
"dataPolicyAccepted": true
},
"meetingTypeId": "<Your meeting type ID>",
"start": "2023-10-09T08:00:00.000Z",
"locationId": 0,
"queueId": "<Your queue ID>",
"channel": "connect",
"duration": 30
}
If your POST-Request is valid, you will recieve a 201 Created
response.
You can then show a success message. The slot has been booked and will be synced to the host's calendar. Any configured notifications or workflows will be sent.
That's it! With these steps, you can efficiently retrieve availability and book appointments using the meetergo API. If you have any further questions or need assistance, please feel free to reach out to our support team.