You can create an automation rule that runs on ticket updates to trigger a webhooks call as soon as specified events occur.
What is a webhook call?
A webhook is a 'callback' to an application or web service that is triggered when a specific event occurs; essentially, a webhook lets you look for a specific update, change or action and, once it occurs, it automatically pushes the information you specify wherever you want.
What can you do with a webhook call from automation that runs on ticket updates?
The automation that runs on ticket updates fires when a specific event occurs on a ticket. Using just this rule, you can update, modify, send notifications, and run actions within Freshdesk. For example, you can update ticket priorities, send out escalation emails, and so on.
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 | The customer replies to the ticket (or adds a comment) | Send comment content to a third-party SMS tool |
Update inventory when a Product Return request is updated | The ticket category (a custom field) is updated to 'Product Return' | Update product info in-store inventory |
Sync status for Feature Requests with the 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 |
A quick guide to setting up a webhook request in an automation rule that runs on ticket updates:
- Create a new rule (under Admin > Workflows > Automations > Ticket updates tab) and select Triggers and Conditions (learn how).
- Underperform these actions, select the Trigger Webhook option.
- Choose the Callback Request Type. While each third-party app may use a request type in a different way, most applications follow these standard methods:
- GET Requests are typically used to retrieve one or all resources.
- POST Requests usually create new resources.
- PUT and PATCH Requests are used to update a resource.
- DELETE Requests are usually used to delete a resource.
- Choose the Callback Request Type. While each third-party app may use a request type in a different way, most applications follow these standard methods:
If you want to set up a rule to add a note to a ticket based on certain conditions and triggers, it's POST because you're adding a note (more info here).
- Specify the callback URL (configured for webhook) of the application you want to hit. You can make the URLs dynamic using placeholders.
- For example, to add a note to a ticket, you'd have to specify which ticket you want the note to be added to. 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.
Note: The trigger will not be executed when a header is given with spaces in between, like X-Sample Custom Header1: VALUE. Although, if a space is entered at the end of the header, it will be skipped.
- 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.
- Pick the encoding of your request that the resource application supports (JSON, XML, or XML-Encoded). For the note addition example, it's JSON.
- To simply send a list of ticket properties that you want in this webhook, select the Simple content option. Adding a note doesn't require any of the usual ticket properties so you'll have to write a custom API request.
- If you would like to customize the content that is being sent, select Advanced.
- The advanced option lets you write custom API requests. These requests have to be encoded in the format you chose in the previous step. For our note addition example, this is what the API request would look like:
If you'd like to add a private note, put 'private: true' in the request. You can also customize the content in your API requests by making them dynamic using placeholders. If you'd like to do more with the Freshdesk API than just add a note, a multitude of options are available. You can use the request in or postman - REST client (a Google Chrome extension) for testing out 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 between 200 and 299, the callback is a success, and status codes between 300-399 will be taken as callback redirects. When a callback fails (status codes other than 2xx and 3xx), the webhook will automatically be retried once every 30 minutes, totaling 48 calls. Calls requested after the rate limit will be buffered until fresh calls are available after 1 hour.