CIOPulse Knowledge Base

2.3 Transactional Survey Webhook

Updated on

Webhooks are a way of CIOPulse pushing survey data to one of your systems by calling one of your APIs, rather than one of your systems pulling data out by calling our Transactional Survey Responses API.

The Transactional Survey Webhook is automatically triggered when a customer completes a survey. It POSTs the single survey response in JSON format to a URL of your choice in near-real-time. This is in contrast to the Transactional Surveys API which you call to GET a list of matching surveys in JSON format.

Some ideas for what you could use the Transactional Survey Webhook for:

  1. Adding customer feedback to the corresponding ticket record in your customer support system.
  2. Adding surveys to your reporting database in near-real-time.
  3. Integrating surveys with your workplace communication tool, such as Slack.

Turning on Webhooks

Webhooks are only available on our Corporate or Enterprise Plans. If you'd like to upgrade your plan so that you can use webhooks, please contact us at [email protected].

To turn on webhooks you will first need your own API - code that takes CIOPulse survey data and does something with it, e.g. adds the survey to a ticket record. Your API has to be callable via a URL and able to accept the JSON payload that we POST.

Within the CIOPulse Portal, you can turn on webhooks from the Integration section of your Preferences.

  1. Webhooks On? - Turn webhooks on or off.
  2. Webhook URL - This is the URL that CIOPulse will call when a transactional survey has been completed.
  3. Webhook Username - If your API requires HTTP Basic Authentication, enter the required username here.
  4. Webhook Password - If your API requires HTTP Basic Authentication, enter the required password here. We store this encrypted.

Payload

When the webhook is triggered by a customer completing a survey, CIOPulse calls the Webhook URL and provides the survey data as a JSON payload.

The JSON payload looks like this:

{
"Webhook_ID":"a65768befa38a",
"Response_ID":"3690",
"Response_Datetime_UTC":"2021-07-29 07:50:52",
"Ticket_ID":"INC123456"
"Support_Group_Code":"SDESK",
"Support_Group_Name":"Service Desk",
"Agent_ID":"adam.agent",
"Segment_Code":"NZ",
"Segment_Name":"New Zealand",
"Segment_2_Code":"NONE",
"Segment_2_Name":"No Segment",
"Customer":"carole.customer",
"Responsiveness":"1",
"Interpersonal":"0",
"Knowledge":"0",
"Communication":"0",
"Speed":"0",
"Confirmation":"0",
"Effort":"0",
"Other":"0",
"Overall":"9",
"Comments":"You guys rock!",
"SR_Notes_URL":"https://app.cio-pulse.com/service-recovery-notes?id=(etc)",
"Survey_Description":"Survey for DemoCorp",
"Survey_Language":"English"
}

Webhook_ID is a unique ID for this trigger of the webhook.  Response_ID is a unique ID for this survey

Carriage returns (new lines) in the Comments field will appear in the JSON as \n.  Quotes in these fields will be escaped and will appear as \".

If you use ServiceNow, your API may require the JSON above to be wrapped in additional JSON. If required, let us know and we can modify our webhook payload so that the JSON above is prefixed with:

{"sysparm_quantity":"1","variables":

and suffixed with:

}

Experience Factors

Within the JSON, the eight experience factors from Q2 of the survey are represented like this, e.g.

"Responsiveness":"-1"

Following the name of each experience factor will be a 0, 1 or -1.

For Detractors and Passives, the factors selected in Q2 of the survey are given as -1s.

For Promoters, the factors selected in Q2 of the survey are given as 1s.

Unselected factors are given as 0s.

Error Handling

When CIOPulse calls your API URL, it looks for an HTTP 200 response that indicates the call was successful.  If your API returns any other HTTP return code, CIOPulse will interpret this as a failure.

CIOPulse will re-try a failed API call 4 times (5 times in total). The first call will be made within 5 minutes of the survey being submitted.  The following four retries are made at increasing intervals, like so:

  • Second attempt (first retry): 5 minutes after the first failed attempt.
  • Third attempt (second retry): 10 minutes after the second failed attempt.
  • Fourth attempt (third retry): 20 minutes after the third failed attempt.
  • Fifth attempt (fourth retry): 40 minutes after the fourth failed attempt.

If the call was not successful after five attempts, it is marked as a failure and no further attempts are made.

You can force CIOPulse to make another attempt at any time, by clicking the 'Resend Webhook' button available when viewing an individual entry in the Webhook Log.

Viewing your Webhook Log

A log of webhook calls is available in the Main Menu of the Portal via the 'Webhook Log' function.

You can see a list of the most recent webhook calls.

  1. Listening Post  - The type of survey the webhook was triggered for (Transactional or Relationship).
  2. Webhook ID - A unique identifier for this trigger of the webhook.
  3. Last Activity Date - The GMT timestamp of when we last tried to call your API.
  4. Last Response HTTP Code - The HTTP code your API returned when we last tried to call your API.
  5. Last Response - The first 100 characters of the response we received from the last API call.
  6. Number of Attempts - Shows you how many times we've called your API (0 to 5).
  7. Status - Will say"Succeeded" if we've received an HTTP 200 return code; "Failed" if we've called your API five times without receiving an HTTP 200 return code; "In Progress" if the API call has not yet Succeeded or Failed.
  8. Click on the Action icon (pencil) to see the JSON payload (survey details) and the response we received from the API call.

You can force the webhook to be retriggered by clicking the "Resend webhook" button.  

Previous Article 2.2 Transactional Net Promoter Score API v5
Next Article 3.1 Relationship Surveys API v5