NOTE: This help article is intended for customers on our self-serve level of service. If you are an Olark Pro customer, your integration likely will work differently. Please reach out to pro@olark.com for help with setting up your integration.
Using a webhook is a simple way to take the content of an Olark chat transcript and process it for use on your own server. For example, you could add it to your own custom CRM, push it into your marketing automation platform or even perform additional analytics on every conversation.
Setting up a webhook integration
Create a webhook endpoint. A webhook endpoint is a URL on your server that will receive each transcript when a conversation completes, e.g. http://www.yourhost.com/olark_endpoint.php
When you finish a live chat, Olark makes HTTP POST to the endpoint you specified. The POST has a single data field containing the JSON-encoded transcript.
JSON encoded transcript
Here is an example of what a JSON-encoded transcript might look like. You can populate the customFields data using our Javascript custom fields API:
Enter the address to your webhook endpoint on our integration page, and click Save.
Testing
Click the Send test button to ensure your endpoint is configured properly.
You're all set! Now you can type !lead while chatting to post the conversation to your webhook endpoint. If a conversation continues after you send !lead, we'll do another POST to your endpoint when the conversation finishes. The conversation will have the same ID. Alternatively, you can select the option to have all transcripts sent automatically without needing to type a command into chat.
Return JSON
Your endpoint can then return JSON containing the link generated by your CRM. For example:
This is the URL that is shown to the agent when using the !webhook or !lead or !case commands.
Extra Events Extension
Aside from the webhook calls outlined above, we also support some additional events. Since existing webhooks might not expect these extra events, they are only triggered when explicitly enabled on https://www.olark.com/settings/integrations/webhooks.
These new events will include the field "eventType" at the top level of their JSON payload to identify the type of event.
Start Event
Description: Triggered once when a conversation starts.
Event Type Value: start
Example Payload: Same as a normal payload (omitting information not yet available), but including the appropriate eventType field. Example:
Thank you! Your submission has been received and you'll hear from us shortly!
Oops! Something went wrong while submitting the form.
Olark uses cookies to give you the best possible experience on our website. By clicking "I like cookies", you agree to our use of them. View our Privacy Policy for more information.