Server to server
Behavior:
Upon submitting a successful POST to our server, we return a Booking page (public availability) that your team places it on the page as you desire.
Description & Syntax:
We provide a server-to-server special endpoint that takes as parameters:
- Form fields: should contain correct Lead fields (case sensitive) https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_lead.htm
- Options for form (router name, submit handle true or false, debug true false)
- Options for custom fields for events in SFDC
Example format:
export DOMAIN="account-name" export ROUTER="apihub-contact-fo-router" POST ex: https://api.chilipiper.com/marketing/hotpipeline cat > 'data.json' <<- EOM { "form": { "FirstName": "WillyTest", "Company": "CompanyTest", "Email": "WillyPythonTest@test2.com", "LastName": "NojopranotoTest" }, "options": { "router": "$ROUTER", "handleSubmit": false, "debug": false, "map": false, "webHook": "https://requestb.in/ubdbxdub", "locale":,"en_US", }, "event": { ... }, } EOM curl \ --header "Content-type: text/plain" \ --request POST \ --data @data.json \ https://api.chilipiper.com/marketing/$DOMAIN
Example form options
{ "form":{ "FirstName":"Ivan", "Company":"Chili Piper", "Phone":"020 1234 5678", "Email":"chili@chilipiper.com" "RecordTypeId":"01212000000VpBY", "LeadSource":"", "Status":"Open", "MailingCountry":"United States" "Country_Code__c":"ME", "Locale__c":"en_US", }, "options":{ "router":"inbound", "handleSubmit":false, "debug":false, "map":false, "webHook”: "url" "locale":"en_US", }, "event":{ "name" : "Customer_Issue_Reason__c", "label" : "Customer Issue Reason", "types" : "picklist", "custom" : true, "updateable" : true, "nillable" : true, "picklistValues" : [ { "value" : "Account & Budget Management", "label" : "Account & Budget Management", "active" : true }, { "value" : "Ad Performance Concerns", "label" : "Ad Performance Concerns", "active" : true }, { "value" : "Advertising Account Administration", "label" : "Advertising Account Administration", "active" : true }, { "value" : "Billing", "label" : "Billing", "active" : true }, { "value" : "Campaign Features", "label" : "Campaign Features", "active" : true }, { "value" : "Cost, Budgeting & Bidding", "label" : "Cost, Budgeting & Bidding", "active" : true } ], "soapType" : "String" }
Event{} will pass any details you pass thru to the Salesforce event that is created upon booking for further reporting.
Our response returns the url of the right calendar. Your team then serves this url to the user, in an iFrame or embed or redirect or in another manner.
Our response will remain in the same format as before, but we will add a booking request ID so that you can track it. The name of this booking request is “routeId”
Response
{ "url":"https://vandenberghe.chilipiper.team/book/manual-selection/?routeId=5a7c654a2b52873a2ce5df57&marketing=true", "routeId": "5a7c654a2b52873a2ce5df57", "redirect": { "enabled":false, "link":"", "closeLink":"https://www.lemonde.fr", "closeStrategy": { "name":null }, "timeout": 2 }
In case of error, we’ll continue with the current error codes.
8001 | Can't find Default Booker for Inbound Router | |
8002 | Salesforce API Error. Can't save prospect | |
8003 | no rules match | |
8004 | no queue uri could be found | |
8005 | no owner link build | When using an "ownership-based" algorithm |
Javascript messaging to the browser
Our JS client code sends a success message “booked” that you can capture via event listener. Currently this is done prior to running our booking workflow, so we have the assignee and time slot but not the event id nor the confirmation that the transaction went through.
We will keep this “booked” message to be backward compatible, we’ve added the booking request routeId:
{ routeId: "5a7c654a2b52873a2ce5df57" }
We have implemented a new capability to send a SECOND, additional message ‘booking-confirmed’ at the end of the booking workflow; the message includes the meeting info and the eventID:
{ "routeId": "5a7c654a2b52873a2ce5df57", "eventId": "5b2124533a906b5f0bff32ad", "assigneeId": "00D1N000001S8LUUA0", "slot": { "start": 1536355315, "end": 1536356315 } }
Note 1: in case the user closes the window before the second message is passed, you will not get the event data, but it could be retrieved with the routeId when the webhook is implemented
Note 2: If you would like to enable rescheduling in your app, this solution will work for reschedule.
However, it will not work as is for re-assign: re-assign is done via our app Instant Booker, not Online Calendar. For re-assign we use a webhook.
JS messaging (update 8/3/2019)
Chili Piper has added a new message to the browser 'availability-loaded' that will send once the calendar slots have loaded successfully.
How to set up the Event Listeners:
<script>
window.addEventListener("message", receiveMessage, false);
function receiveMessage(event) {
console.log("event.data " + JSON.stringify(event.data))}
</script>
Webhook
To return the data upon booking, and also to inform you of reschedules, re-assignment or cancellations, we need a webhook. We suggest that you pass the url for the webhook in each request, that way you can change it at any time. So you will add a parameter in the Booking Request, as highlighter above.
The post will be of the following format: { "routeId: "5a7c654a2b52873a2ce5df57", "eventId": "5b2124533a906b5f0bff32ad", "assigneeId": "00D1N000001S8LUUA0", “actionType”:”reassign“, "slot": { "start": 1536355315, "end": 1536356315 } },
eventId - is event id in our DB
The actionType field has 3 potential values: create, reschedule and reassign
Reschedule and Cancel
The reschedule link follow the following format:
https://sales.chilipiper.com/book/reschedule?rescheduleId=[meeting ID]
We can return it to you or you can reconstruct it from the meeting ID. Then you can use it anywhere, including in your CRM.
Upon re-scheduling, we’ll hit the webhook saved for that meeting ID with the updated info, in the same format
Cancel/reschedule existing CRM jobs (03/04/2019)
New Action Type:
- “cancel”
- “agent_reschedule”
- "prospect_cancel" (updated Feb 2020)
Context:
1.When a prospect declines the appointment, the agent will receive an email and go cancel the meeting. We’d like to have Chili Piper call our end point to cancel.
2. When Agents reschedule meetings from their calendar, Chili Piper call our end point to update CRM Jobs.
Changes: Same format for post. Just use ‘cancel’ or ‘agent_reschedule’ as the actionType.
//when the agent cancels the meeting { "routeId": "5a7c654a2b52873a2ce5df57", "eventId": "5b2124533a906b5f0bff32ad", "assigneeId": "00D1N000001S8LUUA0", “actionType”:"cancel", "slot": { "start": 1536355315, "end": 1536356315 } } //when the meeting gets rescheduled { "routeId": "5a7c654a2b52873a2ce5df57", "eventId": "5b2124533a906b5f0bff32ad", "assigneeId": "00D1N000001S8LUUA0", “actionType":"agent_reschedule", "slot": { "start": 1536355315, "end": 1536356315 } } //when the prospect cancels a meeting via Public Cancel URL { "routeId": "5a7c654a2b52873a2ce5df57", "eventId": "5b2124533a906b5f0bff32ad", "assigneeId": "00D1N000001S8LUUA0", “actionType”:"prospect_cancel", "slot": { "start": 1536355315, "end": 1536356315 } }
Localization: Language as Parameter in REST API (update 1/29/2019)
We will add an additional parameter in the Options, “locale”, 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": { "router": "$ROUTER", "ownerId": "00D1N000001S8LUUA0", "debug": false, "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 will publish the list of supported languages, updated from time to time.
URL Parameters
You can pass specific URL parameters to modify the appearance, control, and redirects of the calendar window. This is extremely useful when calling the calendar via REST API.
Example:
Parameters:
marketing |
Boolean True / False (default False) | Simplify the page, removing the logo, header, footer, etc |
footer |
Boolean True / False (default True) | Sets whether to show the booking page's footer. |
title |
Defines a custom title on the page itself (not to be confused with browser title) | |
titleStyle |
Font type and size and color hex, eg: Roboto 22px 2F2F2F | |
processRedirect |
Redirect to this page when booked | |
closeRedirect |
Redirect to this page when the "X" is clicked | |
hide_x |
Boolean True / False (default False) | Hides the top-right X on the page |
hide_title |
Boolean True / False (default False) | Hides the title / thank you message on the page |
We also offer several other parameters on personal booking links, queue links, and router links.
See Smart Booking Links for more information.
If you are looking to pre-fill your prospect's info into your webform, you can learn how to do this via Query string parameters for more information.
Javascript API
If you're simply looking to call Chili Piper from your JavaScript code, for full control of the workflow, see Concierge Snippet and API
Comments
0 comments
Article is closed for comments.