Who can use this feature?
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.
This article is dedicated to users who already migrated to our Demand Conversion Platform instance. If you have not been upgraded yet and are still working on our Legacy platform, check this article instead.
Table of Contents
Request Description & Syntax
Trigger Option: Button is clicked in-app
If you use this option, you'll need 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, go to the Embed tab in the router. Select "On a website and/or Web App (Advanced)" and "Custom API" tab there. Copy both the URL (POST) and Body.
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
"CRM": "", // replace the value with the value for CRM
},
"options": { // here you can add additional options
"locale":"en_US"
}
}
Trigger Option: Webform is submitted
If you use this option, you will need to enable the "Webform is submitted" trigger in your router’s trigger settings. This option will trigger the router on a website from a form or within an application.
Next, map your form fields to the 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, go to the Embed tab in the router. Select "On a website and/or Web App (Advanced)" and "Custom API" tab there. Copy both the URL (POST) and Body.
Note: using this trigger option would have the "form" and "options" tags in the Body blank, as you will need to set this using your web form field names.
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.io/concierge-router/new-router-ob2r1q/rest
The Body of the request will contain:
- Form field names: the webform fields you mapped in Trigger.
- Additional options for your form would include the trigger and other options like locale, etc.
Example cURL format:
{
"form": {
"FirstName": "", // replace the value with the value for First Name
"LastName": "", // replace the value with the value for Last Name
"Email": "", // replace the value with the value for Email
"Company": "", // replace the value with the value for Company Name
},
"options": { // here you can add additional options
"trigger": "ThirdPartyForm",
"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.