Chili Piper offers a server-to-server API endpoint for calling our booking workflow. This allows you to programmatically automate the display of a queue’s calendar.
In this article, we will cover what request body parameters to send with this endpoint, custom URL parameters, and error codes in more detail.
Table of Contents
Request Description & Syntax
The first step is to enable the "Button is clicked in-app" option in your router’s trigger settings. You might not be embedding your router in-app, but this option will trigger the router on a website from a form or within an application.
Next, specify Data Fields that need to be passed to Chili Piper for rule evaluation and/or for updating your CRM. Once you specify fields here, we will populate your API code snippet with them automatically.
To access the POST URL and its request Body, open a router and go to the Embed tab. Select "On a website and/or Web App (Advanced)" and Custom API there.
Upon submitting a successful POST with a JSON body to this endpoint, we return a calendar booking page (public availability) that you can place within your booking flow as you desire.
A POST URL will look something like this:
https://calendar.chilipiper.com/concierge-router/new-router-ob2r1q/rest
The body of the request will contain:
- Form fields: the Data Fields that you have added in Trigger
- Additional options for your form like locale, etc.
Example cURL format:
{
"form": {
"PersonEmail": "", // replace the value with the value for Email
"PersonState": "", // replace the value with the value for US State
"316b9a3d-a4fc-4151-ae08-b4df37a19569": "", // replace the value with the value for CRM
},
"options": { // here you can add additional options
"locale":"en_US"
}
}
Language Localization Parameter in REST API
If you want to define the language that the presented booking page appears in, you can provide a "locale" option to choose the language to be displayed in the online calendar to translate the texts "What day is best for you?" and "What time works?"
"options": {
"locale": "fr_FR"
},
The values for the parameter "locale" should use the ISO 639-1 code; if a country is not supported, Chili Piper will default to English. Chili Piper has published our list of supported languages, which is updated periodically.
Response
Our response returns the URL of the correct calendar based on the inbound Concierge Router you define. Your team then serves this URL to the user in an iFrame embed or redirect or in another manner.
{
"routingLink": "https://calendar.chilipiper.com/concierge-router/new-router-ob2r1q/routing/baff7f93-e78a-4225-9f72-a10f5cf389a2",
"timeoutInMS": 60000,
"timeoutRedirectUrl": "https://www.google.com"
}
Javascript Messaging in Browser
Please refer to this article for custom event messages sent to the browser.