The JavaScript Chat API is a powerful tool you can use to customize Zendesk Chat for your website. For complete documentation, see api.zopim.com.
Here are the standard steps to use one of the APIs on your website.
Step 1: Choose an API
Pick out the API you want to use from our list at api.zopim.com. For example, here’s one for automatically setting the name and email address in the chat widget:
Step 2: Customize the API
Modify the API action to suit your needs.
For example, you can modify the “setName” and “setEmail” fields to automatically pull information from your customer database and populate the visitor information in the chat box:
<script>
$zopim(function(){
$zopim.livechat.setName(‘*|FNAME|*’);
$zopim.livechat.setEmail(‘*|EMAIL|*‘);
});
</script>
Step 2: Add the API action to your website
Browse to your website’s HTML code and find the place where you inserted the code for the Zendesk Chat widget.
Paste your customized API script code anywhere after the Zendesk Chat widget code:
Step 3: Publish your page
Save the changes to the HTML code and publish your page.
The API script in this example will automatically fill in visitor information (with their name and email address) when they start a chat (provided they have already given you that information).
Got the hang of it? Now let’s explore some API tricks you can try out right now.
- Hiding the chat widget via API
- Hiding the widget on mobile devices via API
- Changing the widget according to status via API
- Displaying or hiding the chat bubble based on status via API
- Displaying custom image statuses via API
- Identifying visitors via API
- Making the widget pop up after a certain amount of time via API
- Tagging visitors using mobile devices via API
- Changing the widget language via API
Comments
0 comments
Please sign in to leave a comment.