Ad-hoc survey requests are sent on a need basis as-and-when a specific contact becomes qualified to take the survey. These requests are triggered through API to Freshsurvey from Freshchat. These requests can be triggered to both email and web app embed collectors across all the survey frequencies (Transactional/ One-time/ Recurring). Foar example, when the chat is resolved, you can trigger the survey to a Freshchat requester.


How to configure an ad-hoc/transactional trigger request:


Note: When configuring the collector in Freshsurvey, select 'Transactional' as the survey frequency to trigger transactional surveys.  Read this article to know more about Freshsurvey's on-demand survey requests.


  1. Once you activate the collector, Click on ‘Show instructions’.

  2. On clicking ‘Show instructions,’ you will find the instructions to configure ad-hoc/transactional trigger requests via API (or webhook). Please select ‘Freshchat’ from the product dropdown.

  1. Now switch to Freshchat> click ‘Admin’> Search for ‘Advanced automation’. (Install the app if not installed already)

  2. Click on ‘API library’ > ‘Create new API’

  1. Enter the API name and module name.

  2. Add “Request type” as ‘POST’

  3. Add the callback URL copied from the instructions in Freshsurvey in the URL.


  1. Toggle on the ‘Add custom headers’ and pass the ‘Key’ and ‘Value’. You can find the values from the Freshsurvey instructions.

{

    "apiKey": "<Value>"

}


  1. Select “Encode” as “JSON” and Copy the pre-populated sample JSON payload with the respective placeholders you need to pass along with the request for contact creation and trigger. 

  2. Add any additional payload information you may need in Freshsurvey under the  “transaction_context” section.


  1. Click on ‘Done’

  2. Now go to ‘Automations” and click on ‘Create new automation’ 




















  1. Enter the ‘name of the automation’ and set conditions on when this needs to be triggered.


  1. Click ‘Next’.

  2. Set the condition if required and click ‘Next’


  1. In the Action dropdown> Select “Trigger an API”> 

  2. In the Value dropdown> select the Freshsurvey API that you previously added.

  3. Click ‘Next’


  1. Configure the ‘Schedule’ if required and check details in the Summary

  2. Click ‘Finish’.


Note: Please ensure that automation is turned on for the webhook to trigger.