Skip to content

Set up a Zendesk survey trigger

Sending NPS surveys from Zendesk can help you collect valuable feedback from your customers and improve your overall customer experience. With nps.today, you can automate the process of sending NPS surveys to your customers, and collect and analyze the responses in real-time.

In this documentation, we will guide you through the process of setting up triggers and webhooks in Zendesk to send NPS surveys via nps.today.

Prerequisites

Create a campaign in nps.today and note its campaign ID. The campaign ID is the Internal ID in Campaign info. See Find campaign IDs.

The Campaign info dialog with Internal ID, Public ID and Campaign link ID

You also need an nps.today API key. See Create an API key.

The Api keys list with the Add Api Key button

Zendesk Webhook

In Zendesk go to the Admin Center and create a Webhook.

Remember to use the correct CampaignID in the Endpoint URL.

Endpoint: https://api.nps.today/campaigns/{{campaignId}}/respondent

Insert:
nps.today endpoint
Method = POST
Format = JSON
Authentication:

  • Basic authentication
  • Username: apikey
  • Password = {nps.today apikey}

Zendesk Webhook

Zendesk Trigger

Now create a Trigger and use the action “Notify active webhook” and select the webhook you created in the previous step.

Zendesk Webhook

Now add the JSON to the Action.

Zendesk action

Below is an example of the JSON body. For all fields, see Trigger surveys.

        {
        "respondent": {
            "emailAddress": "{{ticket.requester.email}}",
            "firstName": "{{ticket.requester.first_name}}",
            "lastName": "{{ticket.requester.last_name}}",
            "phoneNumber": "{{ticket.requester.phone}}",
            "externalId": "{{ticket.requester.id}}"
        },
        "employee": {
                    "email": "{{ticket.assignee.email}}",
                    "firstName": "{{ticket.assignee.first_name}}",
                    "lastName": "{{ticket.assignee.last_name}}"
                    },     
        "guid": "{{ticket.ticket_field_14902864284305}}",
        "custom": {
            "ticketId": "{{ticket.id}}"
        }
        }

Verify it worked

  1. Update a test ticket in Zendesk so it matches your trigger conditions. Use your own email address as the requester.
  2. Check the result in app.nps.today, as described in Test an integration. It also explains how to test with real customer data without sending surveys.