You can create an automation rule that runs on ticket creation or ticket updates to trigger a webhook call as soon as specified events occur.
TABLE OF CONTENTS |
What is a webhook call?
A webhook is a 'callback' to an application or web service that is automatically triggered in response to a specified event. Essentially, a webhook watches for a specific action, update, or change, and automatically pushes a payload of information to your Freshdesk account.
What can you do with a webhook call from an automation that runs on ticket updates?
Using automation rules that run on ticket updates, you can update, modify, send notifications, and run actions within Freshdesk. For example, you can update ticket priorities, send escalation emails, and more.
Webhooks also come in handy when you want to trigger an action in an external application or tool (as well as some updates that the automation rule can't perform, such as updating the time entry on a ticket or adding a note to a ticket). Here are some examples of scenarios in which you could use webhooks:
What you want to do | Conditions to look for | What the webhook should call |
Send out an SMS/text message when a customer replies to a ticket | Customer replies to ticket (or adds comment) | Send comment content to third-party SMS tool |
Update inventory when a Product Return request is updated | Ticket category (a custom field) is updated to 'Product Return' | Update product info in store inventory |
Sync status for Feature Requests with internal Product Management tool | Status is updated for tickets of type 'Feature Request' | Update product management tool with ticket information |
Sound the alarm when a Bad Customer Satisfaction rating is received | Customer feedback is received, and the rating is 'Not Good' | Customize a Smart Bulb and a siren soundboard to fire up triggered by this webhook |
Set up a webhook request in an automation rule that runs on ticket updates
- Navigate:
- For Freshdesk: Admin | Workflows | Automations | Ticket updates
- For Customer Service Suite: Admin Settings | Configuration and Workflows | Ticket Automations | Ticket updates | Triggers and Conditions
- Create a new rule and set up your Triggers and Conditions (learn how).
- Under Perform these actions, select the Trigger Webhook option.
- Choose the Callback Request Type. Most applications typically follow these standard methods:
- GET - retrieve one or all resources.
- POST - create new resources. Adding a note is a POST request.
- PUT and PATCH - update a resource.
- DELETE - delete a resource.
- Specify your callback URL (configured for webhook). You can make the URLs dynamic using placeholders.
- For example, to add a note to a ticket, you have to specify which ticket. Your callback URL would be https://acme.freshdesk.com/api/v2/tickets/{{ticket.id}}/notes with the placeholder {{ticket.id}}.
- Add custom headers to convey additional information such as security details, API version details, and so on. A custom header has to be entered as a header-value pair following the specified format X-Sample-CustomHeader1: VALUE.
- A header containing more than one value should be separated by delimiters (commas and colons cannot be used as delimiters). To add a second header, enter the custom header and value pair in the next line.
- The trigger will not be executed if there are spaces in between. If a space is entered at the end of the header, it will be skipped.
- Header names are not case-sensitive. They will be handled as such regardless of the custom header name provided. The custom header values will be preserved as is.
- Create your webhook body in the Content section. See below.
About the Webhook Body
- Pick the Encoding of your request that the resource application supports (JSON, XML, or XML-Encoded). The examples above are JSON.
- To send a list of ticket properties that you want in this webhook, select the Simple Content option.
- To write a custom API request, select Advanced. You can make dynamic API requests using placeholders. See Freshdesk API Reference.
- You can use requestb.in or postman - REST client (a Google Chrome extension) to test our APIs.
- The {{Triggered event}} placeholder is available only in webhooks and returns the name of the event that triggered the rule.
Webhook Callback Request Limits
The number of webhook requests you can use in an hour is limited to 1000 calls. If the status codes are:
- 200-299: the callback is a success.
- 300-399: the callback will be redirected.
- Other: the callback fails. The webhook will automatically be retried once every 30 minutes, totaling 48 calls.