RetrieveContactHistory
This operation is part of the Interaction History API section of the Web Services API.
Overview
Returns the interaction history for the specified contact. If you make the request without parameters, Web Services returns interactions that were started in the last month.
Request URL | /api/v2/ucs/contacts/{id}/interactions |
---|---|
HTTP method | POST |
Required features | One of the following, depending on the type of interactions you want to retrieve:
|
Parameters
Parameter | Value | Mandatory |
---|---|---|
operationName | RetrieveContactHistory | Yes |
fromDate | In yyyy-MM-dd format. The default is the current date minus one month. | No |
toDate | In yyyy-MM-dd format. The default is the current date. | No |
mediaType | The type of media. Possible values are call, chat, email, facebook, facebooksession, openmedia, twitter, or workitem. | No |
sort | Possible values are "asc" or "desc". The default is "desc". | No |
source | Specifies where to look up the interaction. Possible values are "main" and "archive". The default is "main". Whether "archive" is available depends on your Universal Contact Server configuration. | No |
customAttributes | A list of custom attribute names to include in the result. | No |
searchCustomAttributes | Specify this parameter to search by a custom attribute. You can search custom attributes only with "Equals" statements. In order to include custom fields into the found interactions, you should specify their names in the customAttributes list. | No |
Sample
Request
POST /api/v2/ucs/contacts/00012aB0T770000M/interactions
{
"operationName":"RetrieveContactHistory",
"fromDate":"2015-06-01",
"toDate":"2015-11-04",
"mediaType":"chat",
"sort":"desc",
"searchCustomAttributes":{
"SearchId":"123456"
},
"customAttributes":[
"SearchId",
"CustomerId"
]
}
HTTP response
{
"statusCode":0,
"referenceId":1
}
CometD notification
{
"referenceId":1,
"messageType":"GetInteractionsHistoryMessage",
"interactions":[
{
"typeId":"Inbound",
"startDate":"2015-10-01 16:02:07.000+0300",
"endDate":"2015-10-01 16:02:10.000+0300",
"mediaType":"Chat",
"uri":"http://localhost:8080/api/v2/interactions/00016aB14RQD003N",
"state":"InProcess",
"contactId":"00012aB0T770000M",
"id":"00016aB14RQD003N",
"subject":"Customer support",
"customAttributes":{
"SearchId":"123456",
"CustomerId":"a21d4c3"
}
},
{
"typeId":"Inbound",
"startDate":"2015-10-02 20:02:07.000+0300",
"ownerInformation":{
"userName":"a2",
"lastName":"a2",
"id":"cc9016eee9c84dfeb266c642d9fd92c5",
"firstName":"a2"
},
"mediaType":"Chat",
"uri":"http://localhost:8080/api/v2/interactions/00016aB14RQD003K",
"state":"InProcess",
"contactId":"00012aB0T770000M",
"id":"00016aB14RQD003K",
"subject":"Customer support",
"customAttributes":{
"SearchId":"123456"
}
},
{
"typeId":"Inbound",
"startDate":"2015-10-03 14:02:07.000+0300",
"endDate":"2015-10-03 14:02:25.000+0300",
"ownerInformation":{
"userName":"a1",
"lastName":"a1",
"id":"e6f2ad1b26ea4e9b8dd907eabe167522",
"firstName":"a1"
},
"mediaType":"Chat",
"uri":"http://localhost:8080/api/v2/interactions/00012aB0T770000K",
"state":"Stopped",
"contactId":"00012aB0T770000M",
"id":"00012aB0T770000K",
"subject":"qq",
"customAttributes":{
"SearchId":"123456"
}
}
]
}
This page was last edited on February 15, 2024, at 19:11.
Comments or questions about this documentation? Contact us for support!