Webhook for sending an invitation to fill out a survey
It is possible to send an invitation to complete a survey to a specified e-mail address by calling a so-called Webhook. A Webhook is nothing more than a URL called by another IT system or opened in a standard browser.
The URL address format is as follows:
https://app.customerhero.com/webhooks/[id_account]/[webhook_key]/[webhook_auth]/[webhook_name]?additional_parametersWhere:
id_account – ID of your account on the CustomerHero platform.
webhook_key and webhook_auth – Webhook key and authorization. Parameters are available after logging into the user account in the Account -> Settings -> Integrations tab. After generating the keys, you will receive their values.
webhook_name – in this case it is send-invitation
additional_parameters – additional parameters specifying the recipient of the message and the time of sending the invitation. Additional parameters can be sent as GET parameters or as POST parameters.
Additional parameters:
email – recipient's e-mail address (invitation receiver)
l1, l2, …., l10 – additional attributes of the contact field. Attributes must be previously defined for the survey to which the invitation is sent. All parameters are optional.
id_survey – ID of the survey to which the invitation is sent (It is the Survey ID from the PROJECTS tab). Mandatory parameter
id_template – ID of the sent invitation template (to find out how to retrieve the ID_template click HERE ). Mandatory parameter
delay – delay in sending the invitation in minutes. Optional parameter.
footer – possibility to disable the footer with sender information. By default, the footer is enabled.
reminder_delay - number of hours after sending when a reminder should be sent to respondents who have not completed the survey. When the parameter is not set, the reminder will not be sent.
template_reminder_id - ID of the sent reminder template.
An example URL format with additional parameters sent as GET is:
https://app.customerhero.com/webhooks/387487/TUwNjNDg3M/84b750d6956f02503015938fc38bfe36/send-invitation?id_survey=399793&id_template=1833&email=j.kowalski@webankieta.pl&l1=Jan&l2=Kowalski&l3=CEO&l4=VIP&l5=601602603&delay=15&footer=0The above Webhook will send an invitation to the address j.kowalski@webankieta.pl. If the content of the invitation template (with id_template = 1833) contains macros using respondent attributes, they will appear in its content. The invitation will be sent 15 minutes after the webhook is executed.
Important!
In case the sending is directed to a respondent who has opted out of receiving survey invitations, the webhook will return an error:
{„type”:”error”,”msg”:”Respondents not found”}
In case the limits for sending invitations on the account are exhausted, the webhook will return an error
{„type”:”error”,”msg”:”Invitations limit has been reached”}
The invitation will be sent according to the mail server settings on the user account.
Remember!
To get the value of the parameter: id_template, go to the instructions at this link: https://help.customerhero.com/en/support/solutions/articles/206000086319