Searching Interactions
You can include optional filters in a GET request to retrieve interactions that consider a specific subset of interaction parameters. For example, you can return interactions for a specific contact, from a specific date and time range, or from a specific Customer Relationship Manager (CRM) or ticketing system.
For this tutorial, we will add search parameters to a basic request. A basic request for all interactions looks like this:
curl GET https://api.cxengage.net/v1/tenants/7d23df20-2461-11e7-9bf4-b883f2d63b7b/interactions
Now we want to view all interactions that are linked to Zendesk tickets and we want the response to include all parameters regardless of whether they have null values.
- Append the basic query with
?hookType=zendesk
to the basic request.The request should now look like this:
curl GET https://api.cxengage.net/v1/tenants/7d23df20-2461-11e7-9bf4-b883f2d63b7b/interactions?hookType=zendesk
Notice that the results include all interactions that are linked to Zendesk records, regardless of what type. Now we want to display only ticket records.
- Append the query with
&hookSubType=ticket
.The request should now look like this:
curl GET https://api.cxengage.net/v1/tenants/7d23df20-2461-11e7-9bf4-b883f2d63b7b/interactions?type=zendesk&hookSubType=ticket
The response for this sample query shows only interactions that are linked to Zendesk ticket records. Now we want to show interactions that are linked to a specific ticket.
-
Append
&hookId
to the request.The request should now look like this:
curl GET https://api.cxengage.net/v1/tenants/7d23df20-2461-11e7-9bf4-b883f2d63b7b/interactions?type=zendesk&hookSubType=ticket&hookId=12345
Now you have seen the three ways that you can search third-party interactions. You can use any one or all three of the optional parameters demonstrated above.
The response for this sample query does not include parameters that have null values. Let's add one more query to demonstrate how to include the null values.
- Append the query with
&green=false
.The request should now look like this:
curl GET https://api.cxengage.net/v1/tenants/7d23df20-2461-11e7-9bf4-b883f2d63b7b/interactions?type=zendesk&hookSubType=ticket&green=false
Now let's look at a simple query to list interactions associated with a CxEngage contact.In this case, you add ?contactId=<contactId> to the base query, as such:
curl GET https://api.cxengage.net/v1/tenants/7d23df20-2461-11e7-9bf4-b883f2d63b7b/interactions?contactID=93b34310-bfee-11e7-b9f2-01904e807d77
If you are unable to search and get the results you are looking for, contact Customer Support for assistance. |
Click here to see detailed examples of various searches.