SAAS Conversation Analysis - nxtele/nxcloud-doc-en GitHub Wiki
Dialogue Analysis API
Access the dialogue analysis API via API
- URL:
https://api.nxcloud.com/saas/openapi/stat/query?page_number={page_number}&page_size={page_size}&start_date={start_date}&end_date={end_date}&tenant_id={tenant_id}&appkey={appkey}&dimension={dimension}&user_name={user_name}&user_group_name={user_group_name}&type={type}&response_type={response_type}
- Method:
GET
- Content-Type:
application/json
- Authentication Required:
Yes
Request Parameters
Header Parameters:
Parameter Name |
Type |
Required |
Example Value |
Description |
accessKey |
String |
Yes |
fme2na3kdi3ki |
User identity identifier |
ts |
String |
Yes |
1655710885431 |
Current request timestamp (in milliseconds). The server allows a maximum time deviation of 60 seconds from the client. |
bizType |
String |
Yes |
2 |
WhatsApp business type, fixed value "2" |
action |
String |
Yes |
mt |
WhatsApp business operation, fixed value "mt" |
sign |
String |
Yes |
6e9506557d1f289501d333ee2c365826 |
API parameter signature, public convention |
Parameter Parameters:
Parameter Name |
Type |
Required |
Example Value |
Description |
tenant_id |
Long |
Yes |
1 |
Tenant ID |
appkey |
String |
Yes |
pem28kje |
Application appkey |
page_number |
Integer |
Yes |
1 |
Page number |
page_size |
Integer |
Yes |
10 |
Number of items per page |
start_date |
String |
Yes |
Start query date |
Format: yyyy-mm-dd |
end_date |
String |
Yes |
End query date |
Format: yyyy-mm-dd (the date range cannot exceed 6 months) |
dimension |
Integer |
Yes |
Statistical dimension |
Statistical dimension: 0: Customer service, 1: Customer service group, 2: Robot, 3: Country |
type |
Integer |
Yes |
Time dimension |
Time dimension: 0: Day, 1: Hour |
user_name |
String |
No |
Search user name |
|
user_group_name |
String |
No |
Search group name |
|
response_type |
Integer |
No |
Response type |
1: 5 minutes, 2: 1 hour, 3: 12 hours, 4: 24 hours (default is 1 hour) |
country_iso2 |
String |
No |
Country ISO abbreviation |
When dimension is 3, enter the country to search |
Response Parameter Description
Parameter Name |
Type |
Description |
list |
array[data JsonObject] |
Request result |
message |
string |
Description of request result |
code |
integer |
Result code |
total |
integer |
Total number of items in the list |
page_number |
integer |
Page number |
page_size |
integer |
Number of items per page |
Data
Parameter Name |
Type |
Description |
id |
Long |
Dialogue analysis ID |
user_id |
Long |
User ID |
user_name |
String |
User name |
user_email |
String |
User email |
user_group_id |
Long |
Group ID |
user_group_name |
String |
Group name |
created_at |
String |
Template creation time |
conversation_count |
Long |
Number of engaged conversations |
conversation_end_count |
Long |
Number of ended conversations |
message_count |
Long |
Total number of messages |
message_user_count |
Long |
Number of user messages |
message_customer_count |
Long |
Number of customer messages |
single_conversation_max_count |
Long |
Maximum message count in a single conversation |
single_conversation_avg_count |
Long |
Average message count in a single conversation |
conversation_max_duration |
Double |
Maximum duration of conversations |
conversation_avg_duration |
Double |
Average duration of conversations |
intera_count |
Long |
Number of processed dialogues |
first_response_count |
Long |
Number of first responses |
first_response_duration |
Double |
Duration of the first response |
first_response_rate |
Double |
Rate of first responses |
response_count |
Long |
Number of responses |
response_duration |
Long |
Duration of responses |
response_rate |
double |
Response rate |
country |
String |
Country |
Response Example
{
"code": 0,
"message": null,
"traceId": "ee0e74276ff14dd58c43512c92ed9958.315.17223186559662193",
"total": 19,
"page_number": 1,
"page_size": 10,
"list": [
{
"id": 1310899,
"user_id": 123445,
"user_name": "",
"user_email": "",
"user_group_id": 0,
"user_group_name": "",
"created_at": "2024-07-26",
"conversation_count": 0,
"conversation_end_count": 1,
"message_count": 0,
"message_user_count": 0,
"message_customer_count": 0,
"single_conversation_max_count": 1,
"single_conversation_avg_count": 1,
"conversation_max_duration": 1216047.00,
"conversation_avg_duration": 1216047.00,
"first_response_avg_duration": 1216047.00,
"intera_count": 0,
"first_response_count": 0,
"first_response_duration": 0,
"first_response_rate": 0,
"response_count": 0,
"response_duration": 0,
"response_rate": 0,
"country": "CHINA"
}
],
"ext": null,
"empty": false,
"notEmpty": true,
"totalPages": 19
}
Response Code Description
Code |
Message |
Solution |
0 |
Request successful |
|
-1 |
Request failed |
Please contact technical staff to resolve the issue |
1000~100X |
Authentication issue |
See API authentication section for details |
21058 |
Parameter exception |
tenant_id is required |
21059 |
Parameter exception |
appkey is required |
22016 |
Parameter exception |
Merchant has not configured WhatsApp application |
22215 |
Parameter exception |
Query date interval cannot exceed 6 months |
International Domain Abbreviation Description
iso2 |
Country/Region (Chinese) |
Country/Region (English) |
AD |
Andorra |
ANDORRA |
AE |
United Arab Emirates |
UNITED ARAB EMIRATES |
AF |
Afghanistan |
AFGHANISTAN |
AG |
Antigua and Barbuda |
ANTIGUA & BARBUDA |
AI |
Anguilla |
ANGUILLA |
AL |
Albania |
ALBANIA |
AM |
Armenia |
ARMENIA |
AN |
Netherlands Antilles |
NETHERLANDS ANTILLES |
AO |
Angola |
ANGOLA |
AR |
Argentina |
ARGENTINA |
AS |
American Samoa |
AMERICAN SAMOA |
AT |
Austria |
AUSTRIA |
AU |
Australia |
AUSTRALIA |
AW |
Aruba |
ARUBA |
AZ |
Azerbaijan |
AZERBAIJAN |
BB |
Barbados |
BARBADOS |
BD |
Bangladesh |
BANGLADESH |
BE |
Belgium |
BELGIUM |
BF |
Burkina Faso |
BURKINA FASO |
BG |
Bulgaria |
BULGARIA |
BH |
Bahrain |
BAHRAIN |
BI |
Burundi |
BURUNDI |
BJ |
Benin |
BENIN |
BM |
Bermuda |
BERMUDA |
BO |
Bolivia |
BOLIVIA |
BR |
Brazil |
BRAZIL |
BS |
Bahamas |
BAHAMAS |
BT |
Bhutan |
BHUTAN |
BW |
Botswana |
BOTSWANA |