Example request structures
API request structure for various scenarios
This guide contains example Feedback and service recovery requests including a variety of fields to address specific scenarios. All of the examples refer to a test company named Blanca Peak.
Headers for all requests
The following headers should be sent with all requests:
accept: application/json
content-type: application/json
x-api-key: <Your API key>Simple auto-trigger request structure
In the example below, Jane Customer (janecustomer@example.com) spoke with with Paul Agent (paulagent@blancapeak.com) today.
This interaction was attached to case #123456 and marked as closed.
{
"customer": {
"name": "Jane",
"email": "janecustomer@example.com"
},
"ext_interaction_id": "123456",
"employee": {
"email": "paulagent@blancapeak.com"
},
"channel": "phone"
}The example requests in the following sections will build upon this one by adding one field at a time.
Custom IDs
The following example includes an Employee ID in the custom_id field, in addition to the employee email address:
{
"customer": {
"name": "Jane",
"email": "janecustomer@example.com"
},
"ext_interaction_id": "123456",
"employee": {
"email": "paulagent@blancapeak.com",
"custom_id": "ABC789"
},
"channel": "phone"
}Ticket URLs
Coaches need to understand an interaction before coaching an agent. To make this easy, you can include a URL from your ticketing system in the external_url field. In the following example, details on case #123456 can be accessed in Blanca Peak's CRM system at www.samplecrm.com/caseid=123456.
{
"customer": {
"name": "Jane",
"email": "janecustomer@example.com"
},
"ext_interaction_id": "123456",
"employee": {
"email": "paulagent@blancapeak.com"
},
"channel": "phone",
"external_url": "www.samplecrm.com/caseid=123456"
}By including this information, each piece of feedback on the Agent Connect Stream will include a link back to your system.
Interaction tags
Sending interaction tags enables more robust and filterable reporting in Agent Connect. The following example includes the tags "exchange" and "backorder", based on the phone queue on which the interaction arrived and notes taken by the agent:
{
"customer": {
"name": "Jane",
"email": "janecustomer@example.com"
},
"tags": [
"exchange",
"backorder"
],
"ext_interaction_id": "123456",
"employee": {
"email": "paulagent@blancapeak.com"
},
"channel": "phone",
"external_url": "www.samplecrm.com/caseid=123456"
}When you send interaction tags, new features are enabled in Agent Connect:
Each request will be displayed with the corresponding tags, making it easier for you to understand what drove the customer's experience.
A Tags Trends dashboard will identify tags that consistently drive positive or negative feedback, helping you to identify themes for training or areas that require updated processes.
Multi-brand organizations
For companies using Agent Connect's multi-brand feature, each request must be associated with a brand label. The available brand labels are configured during the onboarding process. The following example request specifies the "Blanca Gold" brand:
{
"customer": {
"name": "Jane",
"email": "janecustomer@example.com"
},
"tags": [
"exchange",
"backorder"
],
"brand": "blancagold",
"ext_interaction_id": "123456",
"employee": {
"email": "paulagent@blancapeak.com"
},
"channel": "phone",
"external_url": "www.samplecrm.com/caseid=123456"
}Suppressed surveys
Although we recommend that each interaction result in an Agent Connect survey, there may be some instances in which you do not want to send one. For example, you may not want to send a survey if a customer called to unsubscribe from your email marketing list.
To enable these exceptions, you would establish a workflow rule or trigger condition to flag these interactions with a do_not_send flag in in the API request:
{
"customer": {
"name": "Jane",
"email": "janecustomer@example.com"
},
"do_not_send": true,
"tags": [
"unsubscribe"
],
"brand": "blancagold",
"ext_interaction_id": "123456",
"employee": {
"email": "paulagent@blancapeak.com"
},
"channel": "phone",
"external_url": "www.samplecrm.com/caseid=123456"
}Language and country identifiers
For companies that support multiple languages, each request should include language and country identifiers so the request can go out in the specified language. This requires setup within Agent Connect beforehand.
In the following example, the underlying interaction took place in the Canadian French language within the country of Canada:
{
"customer": {
"name": "Jane",
"email": "janecustomer@example.com"
},
"tags": [
"exchange",
"backorder"
],
"language": "fr-ca",
"country": "CA",
"ext_interaction_id": "123456",
"employee": {
"email": "paulagent@blancapeak.com"
},
"channel": "phone",
"external_url": "www.samplecrm.com/caseid=123456"
}Service recovery
After a service recovery interaction, a team lead or specialist will close the case in your ticketing system, which will trigger a follow-up survey to the customer. This request will enable you to measure whether you have reversed the customer's negative sentiment.
The following example includes the request ID of the response that is being recovered, which would have been provided by the Data Return API. The ID is assigned to the initial_feedback_request_id field.
{
"do_not_send": false,
"tags": [
"compensation provided"
],
"employee": {
"email": "paulagent@blancapeak.com"
},
"initial_feedback_request_id": "54bd2af9-28cb-48df-8c60-cd27de080cd4",
"ext_interaction_id": "123456",
"external_url": "www.samplecrm.com/caseid=123456""
}