Retrieving Conversation Records List
Request URL
Request Parameters
Request fields
| Path | Type | Optional | Description |
|---|
| robotId | Integer | false | Robot ID. |
| startTime | DateTime | false | Start time in the format yyyy-MM-dd HH:mm:ss, such as 2019-12-31 00:00:00 |
| endTime | DateTime | false | End time in the format yyyy-MM-dd HH:mm:ss, such as 2020-01-07 00:00:00 |
| pageNum | Integer | true | Current page, greater than 0, default is 1 |
| pageSize | Integer | true | Page size, greater than 0 and less than 100, default is 10 |
| keywords | String | true | Search keywords. |
| keywordsSource | Integer | true | Keyword query source: 0. All conversation messages (default) 1. Robot messages 2. Customer messages 3. Agent messages 4. Customer ID 5. Customer external ID |
| conditionList | Array | true | Filter condition list |
| conditionList[].field | String | true | Filter condition field name |
| conditionList[].operator | String | true | Filter condition operator |
| conditionList[].value | Object | true | Filter condition field value, different filter conditions correspond to different value types |
Filter Condition Explanation
| Name | Field | Operator | Value |
|---|
| Channel | platform | is | Multiple selection, Array type, available integer values. 0.web 1.WeChat 2.Android 3.iOS 4.Weibo 5.API 6.Multi-merchant 7.WeChat Mini Program 8.Enterprise WeChat |
| Scene | channelId | is | Multiple selection, Array type, scene ID |
| Source Plugin | webPluginName | is | Multiple selection, Array type, plugin name |
| Source | src | is | Multiple selection, Array type, source name |
| Application Name | appId | is | String, name value |
| IP Location | ipLocation | is | String, IP value |
| Customer Message Count | customerMsgCount | greater_than,less_than,is,between | Integer, numeric value, for example, the value type of between is "0,8" |
| Direct Response Count | directResponseCount | same as above | same as above |
| Suggested Question Count | suggestQuestionCount | same as above | same as above |
| Unsuggested Question Count | unSuggestQuestionCount | same as above | same as above |
| Robot Message Count | robotMsgCount | same as above | same as above |
| Matched Answer Count | robotRepliedCount | same as above | same as above |
| Unknown Answers | unknownQuestionCount | same as above | same as above |
| Useful Answer Count | usefulResponseCount | same as above | same as above |
| Useless Answer Count | uselessResponseCount | same as above | same as above |
| Switch to Human | isSwitchStaff | is | Integer, 0. No 1. Yes |
| Evaluation | surveyOption | is | String, evaluation values are combined with semicolons. 1. Not evaluated 2. Satisfied 3. Average 4. Dissatisfied For example: "1,2,3" |
Response
| Path | Type | Description |
|---|
| code | Integer | Execution result code |
| message | String | Execution result description |
| paging | Object | Pagination information |
| paging.pageNum | Integer | Page number |
| paging.pageSize | Integer | Page size |
| paging.total | Integer | Total count |
| data | Array | Conversation information |
| data[].id | Integer | Session ID |
| data[].startTime | String | Start time of the conversation |
| data[].endTime | String | End time of the conversation |
| data[].totalCount | Integer | Total number of conversations |
| data[].customerMsgCount | Integer | Customer message count |
| data[].robotMsgCount | Integer | Robot message count |
| data[].robotRepliedCount | Integer | Robot matched response count |
| data[].unknownQuestionCount | Integer | Unknown answer count |
| data[].usefulResponseCount | Integer | Useful answer count |
| data[].uselessResponseCount | Integer | Useless answer count |
| data[].surveyOption | Integer | Evaluation 1. Not evaluated 2. Satisfied 3. Average 4. Dissatisfied |
| data[].isSwitchStaff | Integer | Whether switched to human 0. No 1. Yes |
| data[].appName | String | Application name |
| data[].channelId | Integer | Scene ID |
| data[].channelName | String | Scene |
| data[].directResponseCount | Integer | Direct response count |
| data[].suggestQuestionCount | Integer | Suggested question count |
| data[].unSuggestQuestionCount | Integer | Unsuggested question count |
| data[].customer | Object | Customer information object |
| data[].customer.id | Integer | Customer ID |
| data[].customer.nickname | String | Customer name |
| data[].customer.ip | String | IP address |
| data[].customer.province | String | Province |
| data[].customer.city | String | City |
| data[].customer.platform | String | Channel |
| data[].customer.src | String | Source |
| data[].customer.srcUrl | String | Source URL |
| data[].customer.webPluginName | String | Source plugin |
| data[].customer.orgName | String | Company name |
| data[].customer.email | String | Customer email |
| data[].customer.phone | String | Customer phone |
| data[].customer.tags | String | Customer tags |
| data[].customer.desc | String | Description |
| data[].customer.level | String | Customer level |
| data[].customer.generatedChannel | String | Custom channel information |
| data[].customer.loginUrl | String | Access landing page |
| data[].customer.sessionUrl | String | Conversation initiation page |
| data[].customer.dialogueDesc | String | Conversation description |
Example
$ curl 'https://km.udesk.cn/api/v1/sessions?email=admin@udesk.cn×tamp=1529402458&sign=29beefc01662bd040a74880346f3da4491a357cf' -i
-X POST -H 'Content-Type: application/json' -d '{
"robotId":83,
"startTime": "2019-12-31 00:00:00",
"endTime": "2020-01-07 23:59:59",
"pageNum": 1,
"pageSize": 2,
"keywordsSource":0,
"keywords":"",
"conditionList":[{"field":"customerMsgCount","operator":"greater_than","value":"0"}]
}'
Response
{
"code": 200,
"message": "OK",
"visible": false,
"paging": {
"pageNum": 1,
"pageSize": 2,
"total": 4088
},
"data": [
{
"id": 457955,
"robotId": 83,
"startTime": "2019-11-27 18:41:23",
"endTime": "2019-11-27 18:43:05",
"totalCount": 8,
"ipLocation": null,
"customerMsgCount": 4,
"robotMsgCount": 4,
"robotRepliedCount": 2,
"unknownQuestionCount": 1,
"usefulResponseCount": 0,
"use
lessResponseCount": 0,
"surveyOption": 1,
"surveyComment": null,
"isSwitchStaff": 0,
"appName": "test 1·",
"channelId": 82,
"channelName": null,
"customer": {
"id": 1415457662,
"nickname": "",
"ip": "",
"province": "New York",
"city": "New York",
"level": "normal",
"platform": "web",
"src": "",
"srcUrl": "",
"webPluginName": "",
"sessionUrl": ""
},
"callId": null,
"dialogueDesc": null,
"directResponseCount": 2,
"suggestQuestionCount": 0,
"unSuggestQuestionCount": 0
},
{
"id": 457954,
"robotId": 83,
"startTime": "2019-11-27 18:23:27",
"endTime": "2019-11-27 18:24:37",
"totalCount": 4,
"ipLocation": null,
"customerMsgCount": 2,
"robotMsgCount": 2,
"robotRepliedCount": 0,
"unknownQuestionCount": 0,
"usefulResponseCount": 0,
"uselessResponseCount": 0,
"surveyOption": 1,
"surveyComment": null,
"isSwitchStaff": 0,
"appName": "test 1·",
"channelId": 82,
"channelName": null,
"customer": null,
"callId": null,
"dialogueDesc": null,
"directResponseCount": 0,
"suggestQuestionCount": 0,
"unSuggestQuestionCount": 0
}
]
}
Retrieving Conversation Record Details
Request URL
- GET /v1/sessions/:id/logs
Request Parameters
Path parameters
| Parameter | Type | Optional | Description |
|---|
| id | int | false | Conversation record ID. |
Query parameters
| Parameter | Type | Optional | Description |
|---|
| pageNum | Integer | true | Current page, greater than 0, default is 1 |
| pageSize | Integer | true | Page size, greater than 0 and less than 100, default is 10 |
Response
| Path | Type | Description |
|---|
| code | Integer | Execution result code |
| message | String | Execution result description |
| paging | Object | Pagination information |
| paging.pageNum | Integer | Page number |
| paging.pageSize | Integer | Page size |
| paging.total | Integer | Total count |
| data | Array | Conversation record messages |
| data[].id | Integer | Conversation message ID |
| data[].userType | Integer | Sender type of the record, 1. Robot 2. User |
| data[].content | String | Record content |
| data[].sessionId | Integer | Conversation ID |
| data[].createTime | String | Record creation time |
| data[].source | Integer | log source |
| data[].leadingWord | String | Leading word |
| data[].sessionLogSuggestFoundResponseList | Array | Suggested question list |
| data[].sessionLogSuggestFoundResponseList[].id | Integer | ID |
| data[].sessionLogSuggestFoundResponseList[].logId | Integer | Record conversation ID |
| data[].sessionLogSuggestFoundResponseList[].questionId | Integer | Question ID |
| data[].sessionLogSuggestFoundResponseList[].questionContent | String | Question content |
Example
$ curl 'https://km.udesk.cn/api/v1/sessions/457955/logs?pageNum=1&pageSize=2&email=admin@udesk.cn×tamp=1529402455&sign=d4be213127c62bb5b53dea5f5e52eaad06b2362f'
Response
{
"code": 200,
"message": "OK",
"visible": false,
"paging": {
"pageNum": 1,
"pageSize": 2,
"total": 9
},
"data": [
{
"id": 849457,
"userType": 1,
"content": "Urobot welcome\n \n",
"sessionId": 457955,
"createTime": "2019-11-27 18:41:23"
},
{
"id": 849458,
"userType": 2,
"content": "How to change the bank's reserved mobile phone number",
"sessionId": 457955,
"createTime": "2019-11-27 18:41:28",
"queryResult": 4,
"source": 1
}
]
}