The ad-hoc survey requests are API requests made for any contact to trigger the survey ad-hoc or on demand for the collector with any frequency be it one-time or recurring or even a transactional type. Additionally, for a transactional type survey collector, you will be able to trigger the survey whenever a transaction occurs like when a support ticket gets resolved, a customer purchases a product, etc.
Configure ad-hoc/transactional trigger request:
Once you activate the collector, Click on ‘Show instructions’.
On clicking ‘Show instructions’, you will find the instructions to configure ad hoc /transactional trigger requests via API or webhook.
You will be able to trigger a survey request ad hoc by making a POST request to the below callback URL with the request payload from any product viz. help desk, or order processing system.
Callback URL (POST):
https://public-api.freshsurvey.io/public-api/v1/surveys/<survey_id>/triggers/
Note: <survey_id> in the Callback URL will be auto-populated in the instructions drawer. You can simply copy the URL.
This request requires authentication. Please ensure to pass apiKey header with the API key value. Alternatively, You can find the API key in Settings > Account info.
Now, Copy the JSON payload that you need to pass it along with the request for contact creation and triggering.
Here is the Sample JSON payload:
{ "collector_ids": [ "SC-123" ], "contacts": [ { "fields": { "work_email": "johndoe@example.com", "first_name": "john", "last_name": "doe" } } ], "transaction_context": { "product_id_string": "123456", "order_id_string": "123456", "sample_number": 111 } }
If you are already a Freshworks customer and are using products like Freshdesk, Freshservice, Freshchat, etc, and want to trigger a survey we have pre-populated the sample payload with the respective placeholders. You can simply choose the product name you work with from the dropdown and copy the respective code.
For example, Let’s say you wish to trigger a CSAT survey to your contact every time a support ticket raised by them is resolved by an agent. All you have to do is go to Admin > Automations and create an automation rule saying “If Ticket status is Resolved, perform ‘Trigger webhook’ action”. You can simply copy and paste all required information as seen in the screenshot above and create the transactional triggers for the survey instantly. Similarly, you can configure for Freshservice and Freshchat as well with the help of Workflow automation.
Things to note:
For a one-time or a recurring survey, if a contact is already part of the audience in the List or a Segment that is associated with that collector and if an ad hoc request is sent for the same contact, we will send 2 surveys. So, we recommend you either remove the contact from the list or you do not trigger ad hoc request for such contact to avoid survey fatigue.
If you trigger multiple ad-hoc requests for one-time or recurring surveys at any given point of time, we will merge all those requests and trigger only the latest request. But, in the case of transactional surveys, we will honor all the trigger requests.