Create Zendesk integration

This guide explains how to create an integration with the Conversational Commerce VTEX and Zendesk. To do so, first you will need to gather some information about the store's Zendesk account:

  • URL: store's Zendesk account URL, such as https://{accountName}.zendesk.com.
  • Tags: tags that will be added by VTEX when a new ticket is created by the user.
  • Email: email of a Zendesk account that will be used to create the tickets. This email must have permission to create tickets and add comments to it via API. This email will be used in the from field in all support emails.
  • API token: Zendesk API token that needs to be sent to VTEX support. To generate a token, follow the steps in this article.

After gathering this information, follow the steps below:

  1. Create a custom field with the phone number that will be used on WhatsApp Business by the store. You must send its ID to VTEX support.
  2. Create a webhook with the following information:
  • URL: https://live-agent-handler.vtex.com/webhooks/zendesk
  • Request method: POST
  • Request format: JSON
  • Bearer token: API token
  • Token: token send by VTEX
  1. Once you created the webhook, you must create two triggers to activate the webhook. To create a trigger check this documentation. Create the first trigger with the following information:
15701570
  • Trigger name: VTEX Chatbot - Incoming Live Agent Comment
  • Category: Notifications
  • Conditions: Meet ALL of the following conditions
    • Tags Contains at least one of the following {VTEX tag}
    • Update via`` Is not Web service (API)`
    • Ticket Is Updated
    • Comment Is Present, and requester can see the comment
  1. On Actions, you must select Notify active webhook and the previously configurated webhook.

  2. Add the following code on the JSON body field. Notice that you must replace {{ticket.ticket_field_6228597897108}} with the custom field ID previously created.

{
    "conversationId": "{{ticket.external_id}}",
    "userPhoneNumber": "{{ticket.requester.phone}}",
    "accountPhoneNumber": "{{ticket.ticket_field_6228597897108}}",
    "ticket": {
        "id": "{{ticket.id}}",
        "comment": "{{ticket.latest_public_comment}}",
        "author": "{{ticket.latest_public_comment.author.name}}"
    }
}
  1. Create another trigger that will be activated when a support agent resolves a ticket. Fill the trigger form with the following information:
13001300
  • Conditions:
    • Meet ALL of the following conditions
      • Tags Contains at least one of the following {VTEX tag}
    • Meet ANY of the following conditions
      • Status Changed to Solved
      • Status Changed to Closed
  1. On Actions, you must select the Notify active webhook and the previously configurated webhook.
  2. Add the following code on the JSON body field. Notice that you must replace {{ticket.ticket_field_6228597897108}} with the custom field ID previously created.
{
    "conversationId": "{{ticket.external_id}}",
    "userPhoneNumber": "{{ticket.requester.phone}}",
    "accountPhoneNumber": "{{ticket.ticket_field_6228597897108}}",
    "event": {
        "type": "enable_bot"
    }
}

Did this page help you?