You can create a webhook by combining a trigger or automation with an HTTP target in Zendesk Support. In web development, a webhook sends an HTTP request to a specified url in response to an event -- in this case, when a trigger or automation fires in Zendesk Support. Web developers typically use webhooks to invoke behavior in another system.
Topics covered in this article:
About webhooks
You can create webhooks with HTTP targets to build integrations with the services or with your back-end system. Examples:
- Alert your team in Slack when an urgent ticket is created
- Pass ticket details to your docs team in Asana after a ticket is resolved
- Notify your own backend service regarding an important ticket event
An HTTP target lets you pass information to third-party services and REST APIs that accept JSON, XML, or form-encoded content in HTTP requests. HTTP targets are used by automations and triggers in Zendesk Support when a ticket meets certain conditions. To learn more about targets, see Notifying external targets.
HTTP targets differ from URL targets. URL targets only support sending
information in URL parameters, such as
www.example.com?order=345
. HTTP targets support
sending information in the request body of POST or PUT requests, a
requirement for many third-party services and open APIs. The following is a
JSON example:
You can use any of the available content placeholders to insert ticket data in the content.
For more information, see the Zendesk Support placeholder reference.
HTTP targets will not retry requests based on any response code returned by the target endpoint. The only scenario in which a HTTP target notification will retry is if a timeout error is received within 10 seconds of a request being made. This can happen up to a maximum of 21 times before the target is deactivated. See Avoiding timeout errors.
Creating a webhook
- In Zendesk Support, click the Admin icon (
) in the left sidebar, then select Settings > Extensions.
- Click the Targets tab and click Add Target.
- Select HTTP Target.
- Configure the target to integrate with the third-party service.
- Save the target.
- Use the target in a trigger or automation. See Using targets in automations and triggers.
Debugging a webhook
If the webhook isn't working correctly, you can use the Target Failures tab in the API dashboard to check for problems with the request.
- In Zendesk Support, click the Admin icon (
) in the left sidebar, then select Channels > API.
- Select the Target Failures tab.
For more information, see Using the API dashboard.
Examples
The following articles give examples of building integrations using webhooks.
- Integrating with Slack, by Steven Yan
- Integrating the HTTP Target with Trello, by Steven Yan
68 Comments
If a webhook failed, will I receive a notification?
Can I manually retry it?
Marcos Sasson
At this time, Zendesk only sends emails to admins if a target is disabled from too many consecutive errors. After 21 failed attempts, Zendesk will auto-disable the target. Unfortunately, it doesn't send notifications for single failures at this time, but I think that'd be a great feature request. Please post it in the product feedback section of the forums, I know I would definitely upvote it!
Created https://support.zendesk.com/hc/en-us/community/posts/360048031693-Receive-notification-of-webhook-failure
Thanks for creating that feedback post, and for coming back to share the link to it, Marcos! If others are interested in Marcos' suggestion, please go up vote his post and add any details you can to the request in the comments.
I noticed there is an API for Target Failures that might be worth checking out. It's listed as a development API at the moment, but if you were to poll that API, you might be able to get some more granular control in place to to monitor your targets (and potentially re-enable them using the Targets API).
https://support.zendesk.com/hc/en-us/articles/204890268/comments/360002774753
What does "short": true do in this example?
I could not find docs for it. Assumed it would show a truncated version where value is big. But does not appear to be the case in my test drive so far.
Hey Bala Gopalan
Docs for Slack attachments are found here: https://api.slack.com/reference/messaging/attachments
In this case, the short attribute is documented at the very end of the article.
Setting it to false (or not setting it all) will mean that attribute will have a whole line to itself in the message that gets sent to Slack. I chose to set it to true when the attributes I'm using are only one or two words, like our Ticket Forms and Groups are.
Hope that helps clarify things
hi there, how can I know that the request to my application came from Zendesk? I don't see in the headers any signature when I use a POST in a URL Target.
I'd like to add a layer of security, what's the recommended approach?
Please sign in to leave a comment.