Integrate surveys with Zendesk
View Zendesk tickets related to Agent Connect feedback.
For phone, email, and chat tickets in Zendesk, you can send Feedback requests to customers automatically when the tickets are closed. For other channels, you can include survey links directly in your Zendesk tickets.
Follow the steps in this guide to integrate surveys with Zendesk tickets.
Create a webhook
Create a webhook for Zendesk and Agent Connect to share JSON-formatted information.
In Zendesk, open Admin > Apps & Integrations > Webhooks > Actions, then click Create Webhook.
Configure the following fields as described below:
Title — Enter a descriptive name, such as "Agent Connect".
Endpoint URL — Enter
https://api.stellaconnect.net/v1/auth.Request Method — Select "POST".
Request Format — Select "JSON".
Authentication — Select "Basic Authentication".
Username — Enter "connect".
Password — Enter your Agent Connect Test API Key from the Integrations page.
- In the JSON code box, enter the following code with test values, then click Send Test:
{ "customer": { "name": "bill", "email":"bill@gmail.com" }, "do_not_send": true, "employee": { "email": "pete.sellar@blancapeak.com" }, "channel": "phone" } After a successful test returns a 200 OK response, click Create.
Create a Do Not Send Agent Connect Survey field
Create a checkbox field that enables agents to prevent an Agent Connect survey from being sent when they solve a ticket. Note the field ID of the field you create, which is used in Zendesk triggers.
In Zendesk, open Admin > Manage > Ticket Fields, then click Add custom field.
Select "Checkbox".
In the For agents field, enter "Do not Send Agent Connect Survey".
Click Add field.
- Note the ID of the new field, which is listed at the top of the page.
The field ID will be needed when creating triggers.
Create triggers to email surveys automatically
Next, you will need to create the triggers that enable Agent Connect to email surveys to customers automatically when tickets in Zendesk are closed.
The team member that resolved the Zendesk ticket has an approved Agent Connect profile.
The customer’s record includes an email address.
A team member is assigned to the case when it is solved.
To configure Zendesk to assign ticket ownership automatically, open Admin > Settings > Tickets > Assignment, then enable the Auto-assign tickets upon solve option.
Create a trigger for interactions occurring through the email channel:
In Zendesk, open Admin > Business Rules > Triggers, then click Add a trigger.
Name the trigger "Agent Connect - Email".
Specify the following meets-all conditions:
Status - Changed to - Solved
Assignee - Is not - Blank
Comment - Is - Present and requester can see comment
Specify the following meets-any conditions:
Channel - Is - Email
Channel - Is - Web Form
Channel - Is - Web Widget
Under the Actions header, select "Notify Active Webhook", then select the webhook you created previously.
- In the JSON code input field, enter the following code:
{ "employee": { "email": "{{ticket.assignee.email}}" }, "channel": "email", "customer": { "name": "{{ticket.requester.name}}", {% assign customer_email = ticket.requester.email | strip % }"email": {% if customer_email and customer_email != "" % }"{{customer_email}}"{% else % }"no_email"{% endif % } }, "ext_interaction_id": "{{ticket.id}}", "do_not_send": "{{ticket.ticket_field_CUSTOM_ID}}", "external_url": "{{ticket.link}}", {% assign raw_tags = ticket.tags | split: ' ' % }"tags": [ {% for tag in raw_tags % }"{{tag}}"{% unless forloop.last % }, {% endunless % }{% endfor % } ] }Note: The example code contains both JSON and Liquid tags to ensure Zendesk tags are parsed in the correct format for Agent Connect. In the JSON code, replace the "CUSTOM_ID" portion of
{{ticket.ticket_field_CUSTOM_ID}}with the actual ID of the custom field you created previously.Save the trigger when finished.
If needed, create a trigger for interactions occurring through the phone channel:
In Zendesk, open Admin > Business Rules > Triggers, then click Add a trigger.
Name the trigger "Agent Connect - Phone".
Specify the following meets-all conditions:
Status - Changed to - Solved
Assignee - Is not - Blank
Specify the following meets-any conditions:
Channel - Is - Phone call incoming
Channel - Is - Phone call outgoing
Channel - Is - Voicemail
Under the Actions header, select "Notify Active Webhook", then select the webhook you created earlier.
- In the JSON code input field, enter the following code:
{ "employee": { "email": "{{ticket.assignee.email}}" }, "channel": "phone", "customer": { "name": "{{ticket.requester.name}}", {% assign customer_email = ticket.requester.email | strip % }"email": {% if customer_email and customer_email != "" % }"{{customer_email}}"{% else % }"no_email"{% endif % } }, "ext_interaction_id": "{{ticket.id}}", "do_not_send": "{{ticket.ticket_field_CUSTOM_ID}}", "external_url": "{{ticket.link}}", {% assign raw_tags = ticket.tags | split: ' ' % }"tags": [ {% for tag in raw_tags % }"{{tag}}"{% unless forloop.last % }, {% endunless % }{% endfor % } ] }Note: The example code contains both JSON and Liquid tags to ensure Zendesk tags are parsed in the correct format for Agent Connect. In the JSON code, replace the "CUSTOM_ID" portion of
{{ticket.ticket_field_CUSTOM_ID}}with the actual ID of the custom field you created earlier.Save the trigger when finished.
If needed, create a trigger for interactions occurring through the chat channel:
In Zendesk, open Admin > Business Rules > Triggers, then click Add a trigger.
Name the trigger "Agent Connect - Chat".
Specify the following meets-all conditions:
Status - Changed to - Solved
Assignee - Is not - Blank
Comment - Is - Present and requester can see comment
Specify Channel - Is - Chat as the meets-any condition.
Under the Actions header, select "Notify Active Webhook", then select the webhook you created earlier.
- In the JSON code input field, enter the following code:
{ "employee": { "email": "{{ticket.assignee.email}}" }, "channel": "chat", "customer": { "name": "{{ticket.requester.name}}", {% assign customer_email = ticket.requester.email | strip % }"email": {% if customer_email and customer_email != "" % }"{{customer_email}}"{% else % }"no_email"{% endif % } }, "ext_interaction_id": "{{ticket.id}}", "do_not_send": "{{ticket.ticket_field_CUSTOM_ID}}", "external_url": "{{ticket.link}}", {% assign raw_tags = ticket.tags | split: ' ' % }"tags": [ {% for tag in raw_tags % }"{{tag}}"{% unless forloop.last % }, {% endunless % }{% endfor % } ] }Note: The example code contains both JSON and Liquid tags to ensure Zendesk tags are parsed in the correct format for Agent Connect. In the JSON code, replace the "CUSTOM_ID" portion of
{{ticket.ticket_field_CUSTOM_ID}}with the actual ID of the custom field you created earlier.Save the trigger when finished.
Optionally, create a trigger to automatically prevent surveys from being sent under specific conditions.
Note: You do not need to create a trigger specifically to limit the number of surveys that a customer receives within a specific period of time. On the Company Info page, Agent Connect includes a suppression period that automatically stops surveys from flooding a customer within a specified number of days.Company Info pageIn Zendesk, open Admin > Business Rules > Triggers, then click Add a trigger.
Name the trigger "Agent Connect - Do Not Send".
Specify the meets-all and meets-any conditions needed by your company.
Under the Actions header, select the Do not Send Agent Connect Survey field, then select "checked".
Save the trigger when finished.
Important: To make sure Zendesk checks your desired business rules before sending a survey request, order this exception trigger above all of the triggers that send requests.
- Note: The example code contains both JSON and Liquid tags to ensure Zendesk tags are parsed in the correct format for Agent Connect.Optionally, make the following revisions to the JSON payloads listed above to account for advanced configuration used by your company:
If you would like to map one or more custom fields in Zendesk to Agent Connect tags, modify the JSON payload to include those fields, as shown in the following example. Your custom field must contain a value when the ticket is solved. Otherwise, Agent Connect will display a dash (-) for that tag.
{ "employee": { "email": "{{ticket.assignee.email}}" }, "channel": "email", "customer": { "name": "{{ticket.requester.name}}", {% assign customer_email = ticket.requester.email | strip % }"email": {% if customer_email and customer_email != "" % }"{{customer_email}}"{% else % }"no_email"{% endif % } }, "ext_interaction_id": "{{ticket.id}}", "do_not_send": "{{ticket.ticket_field_CUSTOM_ID}}", "external_url": { {ticket.link } }", "tags": ["{ {ticket.ticket_field_option_title_CUSTOM_ID } }", "{ {ticket.ticket_field_option_title_CUSTOM_ID } }"]}If you use multiple brands in Agent Connect, modify the JSON payload to indicate the brand for each interaction, as shown in the following example:
{ "employee": { "email": "{{ticket.assignee.email}}" }, "channel": "email", "customer": { "name": "{{ticket.requester.name}}", {% assign customer_email = ticket.requester.email | strip % }"email": {% if customer_email and customer_email != "" % }"{{customer_email}}"{% else % }"no_email"{% endif % } }, "ext_interaction_id": "{{ticket.id}}", "brand": "{{ticket.brand.name}}", "do_not_send": "{{ticket.ticket_field_CUSTOM_ID}}", "external_url": "{{ticket.link}}", {% assign raw_tags = ticket.tags | split: ' ' % }"tags": [ {% for tag in raw_tags % }"{{tag}}"{% unless forloop.last % }, {% endunless % }{% endfor % } ] }If you use multiple languages in Agent Connect, modify the JSON payload to indicate the language code for each interaction, as shown in the following example. For information about the language codes used in Zendesk, see the Zendesk language support by product article on the Zendesk support site.
{ "employee": { "email": "{{ticket.assignee.email}}" }, "channel": "email", "customer": { "name": "{{ticket.requester.name}}", {% assign customer_email = ticket.requester.email | strip % }"email": {% if customer_email and customer_email != "" % }"{{customer_email}}"{% else % }"no_email"{% endif % } }, "ext_interaction_id": "{{ticket.id}}", "language": "{{ticket.requester.locale}}", "do_not_send": "{{ticket.ticket_field_YOUR CUSTOM ID HERE}}", "external_url": "{{ticket.link}}", {% assign raw_tags = ticket.tags | split: ' ' % }"tags": [ {% for tag in raw_tags % }"{{tag}}"{% unless forloop.last % }, {% endunless % }{% endfor % } ] }
Move your automated integration to production
Work with the Agent Connect team to test your automated integration and resolve any issues. When everything works as expected, move your integration to production via the steps below:
In Zendesk, open the webhook you configured earlier.
Change the Password to your Agent Connect Production API Key (available on the Integrations page in Agent Connect).
At the bottom of the page, select "Update", then click Submit.
In Agent Connect, open the Integrations page (Settings > Integrations).
For each channel you integrated, switch that field on, then click Update.
In Zendesk, turn off the automated CSAT survey and the chat rating.
(Optional) Create triggers to include a survey link in Zendesk responses
Sending survey requests to customers via email after a ticket is solved is not always possible. For example, tickets using social or text (SMS) channels might not include a customer email address. Additionally, your company's customer-contact policies might restrict email communication.
To provide more flexible sending options, Agent Connect enables you to add a survey link inside of Zendesk tickets when they are solved.
To do this, first determine which channels your team uses to communicate with customers, then consider the conditions needed for your triggers. The following procedure includes JSON examples for SMS and social media channels. Work with the Agent Connect team to develop and test your triggers for these and other channels used by your team.
Considerations before proceeding
Consider the following points before configuring your tickets to include survey links:
Make sure there are no existing triggers already sending surveys by email for the same tickets in the channels in which you want to include a survey link.
Some channels might not be best suited for this integration. For example, channels for which agents need to solve a ticket at a later time (such as Zendesk chats) might not be suitable, since the customer might have already left the chat before the agent solves the ticket.
For Zendesk to automatically redact a survey link so it is not visible to your agents, you must enable the Agents can delete tickets feature in Zendesk (for more information, see the Enabling agents to delete tickets article on the Zendesk Support site).
If you want survey links redacted so that agents cannot see the link or complete the surveys themselves, keep in mind that redaction can take a few seconds. This is a byproduct of the Zendesk redaction feature.
Because Agent Connect does not send surveys when using the Test API Key, this integration requires that you use your Production API Key to see survey links as public comments when your agent solves a ticket. If you have configured the integration steps described above, you have already updated your HTTP target to use the Production API Key.
You can help with your testing by adding a condition to your triggers requiring a tag named "surveylinktest" or something similar, then adding that tag to any test ticket you create. When you are ready to use this integration with customers, remove that condition from your triggers.
Create the trigger
Follow the steps below to create the trigger:
In Zendesk, open Admin > Business Rules > Triggers, then click Add a trigger.
- Provide a name for the trigger.
For example, if the trigger is for the SMS channel, name it something like "Agent Connect - SMS".
- Specify the meets-all conditions needed by your team.
We recommend using all of the following conditions:
Status - Changed to - Solved
Assignee - Is not - Blank
Comment - Is - Present and requester can see comment
Channel - Is - (SMS, Social, and so on, depending on the trigger)
Specify the meets-any conditions needed by your team, if applicable.
Under the Actions header, select "Notify Active Webhook", then select the webhook you created previously.
In the JSON code input field, enter the code for your trigger. In the following examples, replace CUSTOM_ID with the actual ID of the custom field you created earlier.
Note: The actual channel name might be email, facebook, etc. The channel name must match one that exists in your Agent Connect account. Work with the Agent Connect team to enable any custom channels you need.Note: The example code contains both JSON and Liquid tags to ensure Zendesk tags are parsed in the correct format for Agent Connect.- Use the following example code for SMS channels:
{ "employee": { "email": "{{ticket.assignee.email}}" }, "channel": "sms", "customer": { "name": "{{ticket.requester.name}}", "email": "{{ticket.requester.email}}", "phone_number": "{{ticket.requester.phone}}" }, "ext_interaction_id": "{{ticket.id}}", "do_not_send": "{{ticket.ticket_field_CUSTOM_ID}}", "external_url": "{{ticket.link}}", {% assign raw_tags = ticket.tags | split: ' ' % }"tags": [ {% for tag in raw_tags % }"{{tag}}"{% unless forloop.last % }, {% endunless % }{% endfor % } ], "deliver_via": "zendesk_support", "brand": "{{ticket.brand.name}}""language": "en" } - Use the following example code for social media channels.
{ "employee": { "email": "{{ticket.assignee.email}}" }, "channel": "social", "customer": { "name": "{{ticket.requester.name}}", "email": "{{ticket.requester.email}}", }, "ext_interaction_id": "{{ticket.id}}", "do_not_send": "{{ticket.ticket_field_CUSTOM_ID}}", "external_url": "{{ticket.link}}", {% assign raw_tags = ticket.tags | split: ' ' % }"tags": [ {% for tag in raw_tags % }"{{tag}}"{% unless forloop.last % }, {% endunless % }{% endfor % } ], "deliver_via": "zendesk_support", "brand": "{{ticket.brand.name}}""language": "en" }
Save the trigger when finished.
