Interaction Flow
General Udesk API Instructions
Documentation reference: <https://www.udesk.cn/website/doc/apiv2/intro/ > Glossary:
- urobot, robot: These terms are synonymous and represent the Udesk robot.
Create Customer
Documentation reference: <https://www.udesk.cn/website/doc/apiv2/customers/#_10 >
Create Session (Request Customer Service Assignment)
POST /im/sessions
Request Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
customer_token | String | Yes | Unique identifier for the customer on the application side |
assign_type | String | No | Expected assignment type, options are 'robot', 'urobot', 'agent', default is 'robot' |
agent_id | Integer | No | Specify the customer service ID for assignment, if provided, ignores assign_type and group_id |
group_id | Integer | No | Specify the customer service group ID for assignment, if provided, ignores assign_type |
channel | String | No | Custom channel |
robot_role_id | String | No | Customer role for the Udesk robot |
robot_id | Integer | No | Udesk robot ID |
scene_id | Integer | No | Udesk robot corresponding scene ID |
customer_token should be consistent with the open_api_token used when creating the customer If neither agent_id nor group_id is specified, and assign_type is 'agent', the system will assign according to the system's rules robot_role_id needs to be set up in the Yunwen side first When assign_type is 'urobot', robot_id and scene_id are required, and robot_id is the robot ID defined in Udesk, see Get urobot List for how to obtain it If the user with this customer_token does not exist in the system Udesk will automatically create a user named API Anonymous User (customer_token) The customer_token in parentheses is the value passed in the parameter
Example
curl 'https://demo.udesk.cn/open_api_v1/im/sessions?email=admin@udesk.cn&sign_version=v2×tamp=1648432914&sign=8a6wfe5dfd404d11a1e7fd5b7410b05ebdd561a4&nonce=1648632914&customer_token=828cw3d9-6a61-4afe-9efe-2c071d0e7cb3&assign_type=robot&agent_id=397' \
-X POST \
-H 'Content-Type: application/json' \
-d '{
"agent_id":"397",
"customer_token":"827wd5r9-7a61-4afe-9efe-2c071d0e9cb2",
"assign_type":"agent"
}'
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Integer | Execution result code, 1000 represents success |
message | String | Welcome message upon successful assignment, error message upon failure |
assign_type | String | Assignment type, 'robot', 'agent', 'urobot' |
assign_info | Object | Assignment result information |
The structure of assign_info varies depending on the value of assign_type.
Robot Response
When assign_type is 'robot', the structure of assign_info is as follows:
Attribute Name | Type | Description |
---|---|---|
robot_name | String | Robot name |
robot_avatar | String | Robot avatar |
welcome_message | String | Welcome message |
unknow_message | String | Unknown answer message |
Example
{
"code": 1000,
"message": "Request successful",
"assign_type": "robot",
"assign_info": {
"robot_name": "Udesk Customer Service Robot",
"robot_avatar": "https://rd-dota.udesk.cn/entry/images/agent-avatar-3e6a68e1e1fcb4db653d9e93263f7946.png",
"welcome_message": "<p>Hello, I am the intelligent customer service robot, I can answer your related business questions, ask me anything! It's my pleasure to serve you!</p><p><br/></p>",
"unknow_message": "<p>I'm sorry, I can only answer common business-related questions! This question is currently out of my knowledge range, I will continue to work hard to learn! You can also ask me with simpler language...Maybe I can answer you...</p>"
}
}
When assign_type is 'urobot', the structure of assign_info is as follows:
Attribute Name | Type | Description |
---|---|---|
sessionId | Integer | Session ID |
logId | Integer | Log ID of this entry |
leadingWord | String | Lead-in phrase |
helloWord | String | Welcome phrase |
robotName | String | Robot name |
logoUrl | String | Robot avatar |
topAsk | Object | List of common questions |
Example
Request
curl 'https://test.udesk.cn/open_api_v1/im/sessions?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2' \
-X POST \
-H 'Content-Type: application/json' \
-d '{
"customer_token":"test20191018224601",
"assign_type":"urobot",
"scene_id":39,
"robot_id":12362
}'
Return
{
"code": 1000,
"message": "Request successful",
"assign_type": "urobot",
"assign_info": {
"sessionId": 23702,
"logId": 55392,
"robotName": "Test",
"logoUrl": null,
"leadingWord": "Hello, it's my pleasure to serve you!",
"helloWord": "Hello, it's my pleasure to serve you!",
"topAsk": [
{
"quesitionType": "Question Type 1",
"quesitionTypeId": 2,
"optionsList": [
{
"quesition": "Question 1",
"quesitionId": 2122
},
{
"quesition": "Question 2",
"quesitionId": 3222
}
]
}
]
}
}
Agent Response
When assign_type is 'agent', the structure of assign_info is as follows:
Attribute Name | Type | Description |
---|---|---|
im_sub_session_id | Integer | Session ID |
count | Integer | Queue position |
queue | String | Queue name |
agent_id | Integer | Assigned customer service ID |
agent_name | String | Assigned customer service name |
agent_avatar | String | Customer service avatar URL |
survey_options | Object | Satisfaction survey settings |
Example
Request
curl 'https://test.udesk.cn/open_api_v1/im/sessions?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2' \
-X POST \
-H 'Content-Type: application/json' \
-d '{
{
"customer_token":"test20191018224601",
"assign_type":"agent"
}
}'
Correct Return
{
"code": 1000,
"message": "Request successful",
"assign_type": "agent",
"assign_info": {
"im_sub_session_id": 1234,
"count": 0,
"agent_id": 3,
"agent_name": "Tom",
"agent_avatar": "",
"survey_options": "See survey_options section",
}
}
In Queue Return
{
"code": 2001,
"message": "The current customer service is busy, you are in the 3rd place in line.",
"assign_type": "agent",
"assign_info": {
"count": 3,
"queue": "queue:company:1:agent:486"
}
}
Assignment Threshold
{
"code": 2001,
"message": "Customer service assignment in progress!",
"assign_type": "agent",
"assign_info": {
"count": 0,
}
}
Customer Service Offline
{
"code": 2002,
"message": "There is no customer service online at the moment",
"assign_type": "agent",
"assign_info": {
"count": 0,
}
}
survey_options
"survey_options":
"enabled": true, # Whether it is open
"name": "Satisfaction Evaluation",
"title": "How do you evaluate this service?", # Prompt shown to the customer
"desc": "Thank you for your support, in order to better serve you, please evaluate this service (reply with a letter) ", # Weibo API satisfaction evaluation guide language
"remark_enabled": true, # Whether to allow remarks
"remark": "You can leave a remark for the evaluation", # Evaluation remark prompt
"show_type": String text|exp| expression|star // Show type
text: { // Optional, when show_type is text display
default_option_id:
options: [{
id:
text: Very satisfied|Satisfied|Average|Unsatisfied|Very unsatisfied (can be modified, displayed in BI)
desc: Cannot be modified
tags: "tag1,tag2" // Custom evaluation tags such as: Good service, strong professionalism, good attitude...
remark_option: hide|required|optional
}]
},
expression: { // Optional, when show_type is expression display
default_option_id:
options: [{
id:
text: Satisfied|Average|Unsatisfied
tags: "tag1,tag2"
remark_option: hide|required|optional
}]
},
star: { // Optional, when show_type is star display
default_option_id:
options: [{
id:
text: Satisfied|Average|Unsatisfied
tags: "tag1,tag2"
remark_option: hide|required|optional
}]
},
"options": [ # Compatible mode, evaluation options / id corresponds to /im_sessions/survey option_id
{
"id": 36,
"text": "Super satisfied",
"enabled": true
},
{
"id": 37,
"text": "Satisfied",
"enabled": true
},
{
"id": 38,
"text": "Average",
"enabled": true
},
{
"id": 39,
"text": "Unsatisfied",
"enabled": true
},
{
"id": 40,
"text": "Very unsatisfied",
"enabled": true
}
],
"methods": [ # Satisfaction evaluation methods
{
"id": 7,
"flag": "after_session",
"text": "Pop up after the session ends",
"enabled": true
},
{
"id": 74,
"flag": "agent_invite",
"text": "Customer service actively invites",
"enabled": true
},
{
"id": 1485,
"flag": "customer_invite",
"text": "Customer actively evaluates satisfaction (only supported by web and Android/iOS SDK)",
"enabled": true
}
],
"resolved_enabled": true,
"resolved_options": {
"title": "Has your problem been resolved?",
"options": [
{
"option_select": true,
"option_name": "Resolved"
},{
"option_select": true,
"option_name": "Unresolved"
}],
"value": "0" # Option default value
}
Close Session
The client actively closes the specified session.
DELETE /im/sessions/:session_id
Request Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
session_id | Int | Yes | Session ID, in URL |
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success |
Example
$ curl -XDELETE 'https://demo.udesk.cn/open_api_v1/im/sessions/123?session_id=123&email=admin@udesk.cn&sign_version=v2×tamp=1645198019&sign=925f7a1a4ec944f52d59d33a9e35cb6e2478e589&nonce=1648194019'
Delete Session
Delete a session that has been closed.
Request Method
DELETE /im/sessions/destroy_session
Request Parameters (Query String)
Parameter Name | Required | Type | Description |
---|---|---|---|
start_time | Yes | String | Example "2022-05-19 19:50:33" |
end_time | Yes | String | Example "2022-05-19 20:50:33" |
customer_id | No | Int | If this parameter is passed, only the conversation records of the customer in the corresponding time period will be deleted; if not, all conversation records in the corresponding time period will be deleted |
The
start_time
andend_time
query the creation time of the session.
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success |
Example
Request
curl -X DELETE 'https://test.udesk.cn/open_api_v1/im/sessions/destroy_session?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2&start_time=2022-05-19%2019%3A50%3A33&end_time=2022-05-19%2020%3A50%3A33&customer_id=123123'
Response
{
"code": 1000
}
Abandon Queue
The client actively closes and abandons the specified queue.
DELETE /im/sessions/close_queue
Request Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
customer_token | String | Yes | Unique customer identifier on the application side. |
queue | String | Yes | Queue data returned when creating a session and queuing. |
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success. |
Example
$ curl -XDELETE 'https://test.udesk.cn/open_api_v1/im/sessions/close_queue?customer_token=123qwe&queue=queue:company:1:agent:486&email=admin@test.com&sign=61b00dedbc749691232386fed059898af61b92c×tamp=1526293384'
Send Message Preview
The API sends a message preview from the customer to the agent (the assign_type of the session needs to be agent).
PUT /im/sessions/:session_id/message_preview
Note: This interface requires separate activation. This interface has its own frequency limit: 3 times per session_id per second.
Request Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
session_id | Int | Yes | Session ID, in URL. |
content | String | Yes | Preview content text, will clear the preview if it's an empty string, in request body. |
Ways to clear the message preview:
- The preview content will be automatically cleared when the agent receives a message from the customer.
- When calling this interface with an empty string in content, it will also clear the message preview for the corresponding session.
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success. |
Error Response
Code Value | Message Description |
---|---|
2062 | Session not found or closed. |
2065 | Interface not activated. |
Example
Request
curl 'https://test.udesk.cn/open_api_v1/im/sessions/1/message_preview?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2' \
-X PUT \
-H 'Content-Type: application/json' \
-d '{"content": "Test preview"}'
Response
{
"code": 1000
}
Send Message
The API allows the customer to send a message to the agent (the assign_type of the session needs to be agent).
POST /im/messages
Note: For messages sent to the robot, the type parameter currently only supports 'message'.
Request Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
customer_token | String | Yes | Unique customer identifier on the application side. |
im_sub_session_id | Int | Yes | 1. Session ID 2. ID is 0 or empty for robot questions 3. ID is -1 for Udesk robot questions 4. -2 for IM workbench messages 5. -3 for messages sent while queuing |
message_id | String | Yes | Message ID/company message unique identifier (Udesk robot can omit) Only letters, numbers, "_", "-", special characters are not allowed |
type | String | No | Message type, 'message', 'image', 'audio', 'rich', default is 'message' |
data | Object | Yes | Message content (see Message Content Format) |
robot_id | Int | No | Udesk robot ID (required for Udesk robot) |
scene_id | Int | No | Udesk robot corresponding scene ID (required for Udesk robot) |
urobot_session_id | Int | No | Udesk robot corresponding session ID |
agent_id | Int | No | Specify the agent ID to assign (use with im_sub_session_id=-2) |
group_id | Int | No | Specify the agent group ID to assign (use with im_sub_session_id=-2) |
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success |
Error Response (when assign_type is 'robot')
Code Value | Message Description | |
---|---|---|
1 | 9200 | Session not found or closed |
2 | 2062 | Missing parameters |
Example
Request
curl 'https://test.udesk.cn/open_api_v1/im/messages?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2' \
-X POST \
-H 'Content-Type: application/json' \
-d '{
"customer_token":"1234123123",
"im_sub_session_id":11,
"message_id":"1",
"type":"image",
"data":{
"content": "Don’t just walk by, come check out our company’s promotional products! You won’t want to miss these great deals! <a href=\"https://xxx.com/1.png\">hotsale.com</a>"
}
}'
Response
{
"code": 1000
}
Get Customer Offline Unread Messages
Get the number of offline unread messages and details sent by the agent to the customer in the specified session.
GET /im/messages/unread_customer_offline
Request Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
im_sub_session_id | Int | Yes | Session ID |
customer_id | Int | Yes | Customer ID |
app_id | Int | No | SDK app_id (required for SDK channel sessions) |
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success |
count | Int | Number of unread messages |
unread_messages | Array | Message collection, see Message Content Format for details |
Request Example
curl https://demo.udesk.cn/open_api_v1/im/messages/unread_customer_offline?im_sub_session_id=1419314&customer_id=5855308&email=admin@udesk.cn&sign_version=v2×tamp=1646827326&sign=06f59041bbbec54bd2a0b15b45672c9f43539135&nonce=1646827326
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success |
count | Int | Number of unread messages |
unread_messages | Array | Message collection, see Message Content Format for details |
Request Example
curl https://demo.udesk.cn/open_api_v1/im/messages/unread_customer_offline?im_sub_session_id=1419314&customer_id=5855308&email=admin@udesk.cn&sign_version=v2×tamp=1646827326&sign=06f59041bbbec54bd2a0b15b45672c9f43539135&nonce=1646827326
Modify Customer Online Status
Modify the customer's online status.
POST /im/customer_online_state
Request Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
customer_token | String | Yes | OpenApi unique customer identifier |
state | Int | Yes | Offline: 0; Online: 1 |
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success |
Request Example
curl https://demo.udesk.cn/open_api_v1/im/messages/unread_customer_offline?im_sub_session_id=1419314&customer_id=5855308&email=admin@udesk.cn&sign_version=v2×tamp=1646827326&sign=06f59041bbbec54bd2a0b15b45672c9f43539135&nonce=1646827326
Modify Agent Message Read Status
Modify the read status of agent messages.
POST /im/messages/read_messages
Request Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
session_id | Int | Yes | Session ID |
message_ids | Array | Yes | Array of message IDs |
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success |
Request Example
curl https://demo.udesk.cn/open_api_v1/im/messages/read_messages?session_id=1234&message_ids=['123','123456']&email=admin@udesk.cn&sign_version=v2×tamp=1646827326&sign=06f59041bbbec54bd2a0b15b45672c9f43539135&nonce=1646827326
Get Customer Sensitive Word Configuration
Get the customer's sensitive word configuration.
GET /im/im_sensitive_words
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success |
customer_words_string | String | Configured sensitive words, separated by commas (e.g., "a,b,c,d") |
customer_is_open | Int | 1 for enabled, 0 or empty for disabled |
Request Example
curl https://demo.udesk.cn/open_api_v1/im/im_sensitive_words?email=admin@udesk.cn&sign_version=v2×tamp=1646827326&sign=06f59041bbbec54bd2a0b15b45672c9f43539135&nonce=1646827326
Get Agent Unread Messages
Agent unread messages are messages successfully sent to the agent by the customer that the agent has not yet read. Get the number of unread messages for the specified session and the number of unhandled messages left within 7 days.
GET /im/messages/agent_unread_messages
Request Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
agent_ids | Array | Yes | Agent ID array, limited to 30 |
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code |
results | Array | Result set |
results.agent_id | Int | Agent ID |
results.unread_session_message_num | Int | Number of unread messages |
results.unsolved_leave_message_num | Int | Number of unhandled messages left within 7 days |
Request Example
curl https://demo.udesk.cn/open_api_v1/im/messages/agent_unread_messages?email=admin@udesk.cn&sign_version=v2×tamp=1646817998&sign=7ab7fb49d9c32ea246504b3af75a9w65210bca87&nonce=1646827998&agent_ids[]=13
Send Customer Message Read Status
Request Method
Send the customer message read status.
POST {Receiving Message URL}
The Receiving Message URL should be set in the Admin->Settings->Channel Management->Interface Messages.
Request Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
session_id | Int | Yes | Session ID |
message_ids | Array | Yes | Message ID list |
Response Data
Return HTTP status code 200, and the response body should be empty. Note:
- Please respond within 5 seconds; otherwise, UDesk will consider the send timeout.
- If there are 10 timeouts within 60 seconds, UDesk will stop calling the address for 60 seconds starting from the last timeout.
Reply Message Notification
Request Method
The agent pushes a message to the API customer.
POST {Receiving Message URL}
The push format is JSON. The Receiving Message URL should be set in the Admin->Settings->Channel Management->Interface Messages.
Request Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
customer_token | String | Yes | Unique identifier for the customer on the application side |
assign_type | String | Yes | Assignment type, 'robot', 'agent', 'urobot' |
messages | Array | Yes | Messages |
The format of the messages object varies depending on the assign_type . | |||
When assign_type is 'robot', the messages format is as follows: |
messages: Array
type: Message type
message_id: Message ID, String
data: Message content
question_id: 0 for greetings library, non-0 for Q&A; non-0 can evaluate the usefulness of Q&A
question_title: Question content, String
answer: Text of the question answer, String
gus_list: Question guidance list
- question_title: Question content, String
relate_list: Related question list
- question_title: Question content, String
third_url: Related recommended link
url: Link address, String
{
"customer_token": "axb",
"assign_type": "robot",
"messages": [{
"type": "message",
"message_id": "f862f80d-89aa-4f31-92d9-ccd4fcacffcf",
"data": {
"question_id": 210530,
"question_title": "What is the company's business?",
"answer": "Hi, we are a company that does cloud customer service. Different developments can communicate and manage users on Weibo and WeChat web.",
"gus_list": [
{"question_title": "What business do you do"},
{"question_title": "What business does your company have"}
],
"relate_list": [
{"question_title": "Where is the company located"},
{"question_title": "What are the contact details"}
],
"third_url": {
"url": "https://www.udesk.cn"
}
}
}]
}
When assign_type
is 'urobot', the messages
format is as follows:
messages: Object
sessionId: Session ID, String
logId: Message ID
aid: Answer ID
ansContent: Answer content
ansType: Answer type (1 for normal answer, 2 for answer and suggestion list, 3 for suggestion list, 4 for returning greetings, 6 for unknown speech, 8 for sensitive words)
hitQuestion: Question content
suggestQuestionList: Suggestion list
flowId: Current process ID
flowTitle: Current process title
flowContent: Current process answer
{
"sessionId": 1835244,
"logId": 3574331,
"aid": 12,
"ansContent": "Appeal process",
"ansType": 1,
"hitQuestion": "Account appeal",
"suggestQuestionList": [
{
"id": 434,
"content": "Question 1",
"type": 1
}
]
}
When assign_type
is 'agent', the messages
format is as follows:
messages: # Array
type: Message type, 'message', 'image', 'audio', 'video', 'file', 'rich(rich text message)', 'struct(structured conversation)', 'survey(satisfaction evaluation related events)', 'transfer(transfer event)', 'info_transfer(transfer event, attribute distinction)'
message_id: Message ID
agent_id: Agent ID
agent_name: Agent name
agent_avatar: Agent avatar
im_sub_session_id: Session ID
message_created_at: Message creation time "20170711 09:52:11"
data: # Same as the content of the sent message
font: Font, only supports message
content: Content
{
"customer_token": "axb",
"assign_type": "agent",
"messages": [
{
"type": "start_session",
"message_id": "xxxxx",
"agent_id": 1,
"agent_name": "TOM",
"agent_avatar": "https://123.com/1.png",
"im_sub_session_id": 3,
"message_created_at": "20170711 09:52:11",
"data": {
"content": "Dialogue started"
}
},
{
"type": "message",
"message_id": "xxxxx",
"agent_id": 1,
"agent_name": "TOM",
"agent_avatar": "https://123.com/1.png",
"im_sub_session_id": 3,
"message_created_at": "20170711 09:52:12",
"data": {
"font": "Font, only supports message",
"content": "Hello, what can I help you with?",
}
},
{
"type": "rich",
"message_id": "xxxxx",
"agent_id": 1,
"agent_name": "TOM",
"agent_avatar": "https://123.com/1.png",
"im_sub_session_id": 3,
"message_created_at": "20170711 09:52:13",
"data": {
"content": "Our company's promotional products are hot-selling. Don't miss it. <a href=\"https://xxx.com/1.png\">Hot sale.com</a>",
}
},
{
"type": "close",
"message_id": "xxxxx",
"agent_id": 1,
"agent_name": "TOM",
"agent_avatar": "https://123.com/1.png",
"im_sub_session_id": 3,
"message_created_at": "2018-01-01 00:00:00",
"data": {
"close_type": "normal(normal)|redirect(redirect)|force(force)"
"content": "Close the session",
"survey_options": "See survey_options section",
}
}
]
}
Response Data
Return HTTP status code 200, and the response body should be empty. Note:
- Please respond within 5 seconds; otherwise, UDesk will consider the send timeout.
- If there are 10 timeouts within 60 seconds, UDesk will stop calling the address for 60 seconds starting from the last timeout.
Message Content Format
Type and Supported List
Type | Type | Meaning | Send | Receive | Remarks |
---|---|---|---|---|---|
message | message | Text message | ✓ | ✓ | |
message | image | Image message | ✓ | ✓ | |
message | audio | Voice message | ✓ | × | Supports amr format |
message | video | Video message | ✓ | × | Supports mp4 format |
message | file | File message | ✓ | × | |
message | rich | Rich text message | ✓ | ✓ | Supports common html tags |
message | struct | Structured conversation message | × | × | Not supported yet |
event | start_session | Dialogue start | × | ✓ | Pushed to the customer when the dialogue starts |
event | transfer | Transfer event | × | ✓ | Pushed to the customer when they are transferred, customers need to modify im_sub_session_id to the new one |
event | info_transfer | Transfer event with display content | × | × | Displayed to the customer when they are transferred |
event | close | Session close event | ✓ | ✓ | Pushed to the customer when the session is closed |
event | survey | Satisfaction evaluation related events | × | × | Only displayed in the customer service IM workbench |
event | active_guest | Customer service initiating conversation event | × | × | Only supports web visitors |
event | info_appoint | Customer service assigning customer event | × | × | Not supported yet |
event | form | Send form message event | × | × | Not supported yet |
event | form_received | Accept form message event | × | × | Not supported yet |
event | info | Pre-inquiry form is_receive: false | × | × | Only for customer service display |
event | robot_transfer | Robot transfers the conversation | × | × | Only for customer service display |
Note: Messages that are not supported/temporarily not supported/only for customer service display should not be displayed and processed in the client.
Message Content Details
Depending on the type, the structure of the data
field also varies:
# Ordinary message
type: 'message'
data:
font: Font format, optional, for example
content: Text content Note: Text content can contain rich text html tags
# Image message
type: 'image'
data:
content: url
# Voice message
type: 'audio'
data:
content: url
filename: 'football.mp4' #
filesize: "4.3M"
duration: 200 # Voice duration, may not have # Unit is seconds
type: 'video' # Only supports mp4
data:
content: url
filename: 'football.mp4' # File name
filesize: "4.3M" # File size
type: 'rich' # Supported
data:
content: <p>Hello, Xiao Ya customer service is happy to serve you. May I help you with anything?</p>
# type: struct Structured message, currently only supports web/sdk
# Related documentation <https://www.udesk.cn/website/doc/apiv1/im/#im_2>
# start_session Session starts, usually pushed in an array, followed by a welcome message message
type: "start_session",
data:
content: "Dialogue started"
# transfer The session is transferred, usually pushed in an array, followed by the transfer content message such as: 'Session transfer successful, customer service xx is serving you'
type: "transfer",
data:
content: "Session transfer"
type: "info_transfer",
data:
content: "Customer service Jerry213 transfers the session"
type: "close",
data:
content: "Session closed"
Robot Q&A Evaluation
Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
customer_token | String | Yes | Unique identifier for the customer on the application side |
message_id | String | Yes | Message ID of the robot's answer to be evaluated |
question_id | Integer | Yes | Question ID |
useful | Boolean | Yes | Whether the question is useful |
Return
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success |
Urobot Robot Session Evaluation (Urobot Usage)
POST /im/sessions/robot_survey
Parameters
Attribute Name | Type | Required | Description |
---|---|---|---|
customer_token | String | Yes | Unique identifier for the customer on the application side |
im_sub_session_id | Int | Yes | Session ID |
option_id | Int | Yes | Evaluation option ID (2: Satisfied, 3: Average, 4: Unsatisfied) |
remark | String | No | Evaluation remark |
robot_id | Int | Yes | Udesk robot ID (obtained in the system IM Robot module) |
scene_id | Int | Yes | Udesk robot corresponding scene ID |
Return Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success |
message | String | Return message |
Example
Request
curl https://demo.udesk.cn/open_api_v1/im/sessions/robot_survey?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
\
-X POST \
-H 'content-type: application/json' \
-d '{
"customer_token":"1234121123123",
"im_sub_session_id":101,
"option_id":2,
"robot_id":1101,
"scene_id":39,
"remark":"Very good"
}'
Return
{
"code": 1000,
"message": "Thank you for your feedback"
}
Session Evaluation (Evaluating Customer Service)
POST /im/sessions/survey
Request Parameters
Attribute Name | Required | Type | Description |
---|---|---|---|
im_sub_session_id | Yes | Int | Session ID |
option_id | Yes | Int | Evaluation option ID |
remark | No | String | Evaluation remark |
resolved_state_v2 | No | Int | Whether resolved option value (0: option 1 indicates resolved, 1: option 2 indicates unresolved) |
- Note: The range of option_id values refers to the evaluation IDs returned when creating a session. Specifically, refer to the survey_options example to determine the type of show_type returned when creating a session, and the id values range from the current satisfaction type's options parameter.
Return Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success |
Example
Request
curl https://demo.udesk.cn/open_api_v1/im/sessions/robot_survey?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
\
-X POST \
-H 'content-type: application/json' \
-d '{
"im_sub_session_id":1001001000,
"option_id":"111"
}'
Return
{
"code": 1000,
"message": "Thank you for your feedback"
}
Answer Evaluation (Only for Urobot Usage)
POST /im/messages/answer_survey
Request Parameters
Attribute Name | Type | Required | Description |
---|---|---|---|
customer_token | String | Yes | Unique identifier for the customer on the application side |
message_id | Integer | Yes | Message ID where the answer is located |
im_sub_session_id | Integer | Yes | Session ID |
option_id | Integer | Yes | Evaluation option ID (1: Satisfied, 2: Unsatisfied, default is satisfied) |
robot_id | Integer | Yes | Udesk robot ID |
scene_id | Integer | Yes | Udesk robot corresponding scene ID |
Return Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success |
message | String | Return message |
Example
Request
curl https://demo.udesk.cn/open_api_v1/im/messages/answer_survey?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
\
-X POST \
-H 'content-type: application/json' \
-d '{
"customer_token":"123411111",
"message_id":111,
"im_sub_session_id":11,
"option_id":1,
"robot_id":12,
"scene_id":1
}'
Return
{
"code": 1000,
"message": "Thank you for your feedback"
}
Flow Question Interface
POST /im/messages/flow
Only for Urobot usage
Request Parameters
Attribute Name | Type | Required | Description |
---|---|---|---|
customer_token | String | Yes | Unique identifier for the customer on the application side |
im_sub_session_id | Int | Yes | Session ID |
flow_id | Int | Yes | Selected flow_id |
robot_id | Int | Yes | Udesk robot ID |
scene_id | Int | Yes | Udesk robot corresponding scene ID |
How to get the flow_id:
When you receive a push message with a messages.flowContent
field and tags that contain data-type="2"
, you can call this interface.
For example:
<p><b data-type="2" class="flow-item" data-id="81" data-robotid="54">Flow subitem A jumps to subitem -1</b></p><p>Flow subitem A jumps to subitem -2<br/></p>
<p><b data-type="1" class="flow-item" data-id="307" data-robotid="54">Classification question A</b></p><p>Classification question B</p>
When you click on Flow subitem A jumps to subitem -1, you can use flow_id=81
to call this interface.
Return Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success |
The push data refers to the return data of the Urobot reply message notification interface.
Example
Request
curl https://demo.udesk.cn/open_api_v1/im/messages/flow?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
\
-X POST \
-H 'content-type: application/json' \
-d '{
"customer_token":"1234121123123",
"messgae_id":1001,
"im_sub_session_id":17001700,
"option_id":1,
"robot_id":1,
"scene_id":1
}'
Return
{
"code": 1000
}
User Click Behavior Interface
POST /im/messages/hit
Request Parameters
Attribute Name | Type | Required | Description |
---|---|---|---|
customer_token | String | Yes | Unique identifier for the customer on the application side |
im_sub_session_id | Int | Yes | Session ID |
message_id | Int | Yes | Message ID of the robot's answer |
robot_id | Int | Yes | Robot ID |
question | Int | No | Question content |
query_type | Int | Yes | Click type |
Return Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success |
Example
Request
curl https://demo.udesk.cn/open_api_v1/im/messages/hit?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
\
-X POST \
-H 'content-type: application/json' \
-d '{
"customer_token":"111",
"message_id":1,
"im_sub_session_id":10,
"robot_id":1,
"scene_id":1,
"question_id":1,
"query_type":1
}'
Return
{
"code": 1000
}
Get Urobot List
GET /im/urobots
Return Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success |
message | String | Return result information |
urobot_list | Array | Detailed information about the robot list |
urobot_list
Attribute Name | Type | Description |
---|---|---|
id | Int | Urobot robot ID |
name | String | Robot name |
logo | String | Robot avatar |
scene_list | Array | Suitable scene information, including id (scene ID), name (scene name) |
created_at | String | Time the robot was created |
Example
Request
curl https://demo.udesk.cn/open_api_v1/im/urobots?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
Return
{
"code": 1000,
"message": "Request successful",
"urobot_list": [
{
"id": 2,
"name": "Default Robot",
"logo": "",
"scene_list": [
{
"id": 114,
"name": "Default Scene"
},
{
"id": 116,
"name": "System Default Scene"
}
],
"created_at": "2018-01-23T10:55:20.000+08:00"
},
{
"id": 3,
"name": "Test",
"logo": "",
"scene_list": [
{
"id": 120,
"name": "System Default Scene"
}
],
"created_at": "2018-02-05T11:25:30.000+08:00"
}
]
}
Transfer to Human Statistics Interface (Urobot Usage)
POST /im/sessions/transfer_survey
Request Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
im_sub_session_id | Int | Yes | Session ID |
robot_id | Int | Yes | Robot ID |
scene_id | Int | Yes | Robot scene ID |
Return Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Status |
message | String | Request result |
Example
Request
curl https://demo.udesk.cn/open_api_v1/im/sessions/transfer_survey?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
\
-X POST \
-H 'content-type: application/json' \
-d '{
"im_sub_session_id":"111",
"robot_id":1,
"scene_id":10
}'
Return
{
"code": 1000,
"message": "success"
}
Query Queue Status
GET /im/queue_status
Request Parameters
Parameter Name | Required | Description |
---|---|---|
customer_token | Yes | Unique identifier for the customer on the application side |
Return Data
Attribute Name | Type | Description |
---|---|---|
code | Int | Execution result code, 1000 represents success |
status | String | Queue status, 'In queue', 'Not in queue', 'In session', 'Assigning' |
count | Int | Queue position |
Example
Request
curl https://demo.udesk.cn/open_api_v1/im/queue_status?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
&customer_token=1234121123123
Return
{
"code": 1000,
"status": "Not in queue",
"count": 0
}
Query Customer Status
Used to check if a customer is in a session, supports querying with customer_token
, web_token
, or sdk_token
.
GET /im/customer_status
Request Parameters
Parameter Name | Required | Description |
---|---|---|
customer_token | No | OpenApi unique customer identifier |
web_token | No | Web unique customer identifier |
sdk_token | No | SDK unique customer identifier |
session_key | No | When web_token exists, supports different session statuses for multiple sessions |
Note: One of customer_token
, web_token
, or sdk_token
must be present, taking the first parameter with a value in order.
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Integer | Execution result code, 1000 represents success |
status_code | Integer | 0, 1, 2, 3 |
status | String | 'No session', 'In session', 'In queue', 'Invalid customer' |
Example
Request
curl https://demo.udesk.cn/open_api_v1/im/customer_status?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
&customer_token=1234121123123&session_key=179306259
Response
{
"code": 1000,
"status_code": 0,
"status": "No session"
}
Query Agent Status
View the online status of all current agents.
GET /im/agent_status
Request Parameters
Parameter Name | Required | Description |
---|---|---|
group_id | No | If specified, only view agents in the given group |
If not specified, all agents are returned.
Response Parameters
Attribute Name | Type | Description |
---|---|---|
code | Integer | Execution result code, 1000 represents success, 11012 if the specified group does not exist |
agents | Array | Returns agent data, see Agent Status Details for more information |
Agent Status Details
Attribute Name | Type | Description |
---|---|---|
id | Integer | |
name | String | Agent's name |
nick | String | Agent's nickname, used to display to customers; if empty, the agent's name is displayed |
avatar | String | Agent's avatar |
im_status | String | Online status: online/busy/offline (Online/Busy/Offline) |
im_custom_status | String | Custom status, only valid when im_status is busy |
im_session_num | Integer | Current number of customers being served, only valid when im_status is online/busy, may be 0, has no significant meaning |
im_max_join_num | Integer | Maximum number of customers an agent can serve, only valid when im_status is online/busy, may be 0, has no significant meaning |
Example
Request
curl https://demo.udesk.cn/open_api_v1/im/agent_status?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
&group_id=37540
Response
{
"code": 1000,
"agents": [
{
"id": 43230,
"name": "Tom",
"im_nick": "Tom",
"avatar": "",
"profile": "all",
"im_status": "offline",
"im_custom_status": "",
"im_session_num": 1,
"im_max_join_num": 10
},
{
...
},
...
]
}
Abandoned Queue Inquiry
Used to obtain information about users who have abandoned the queue.
Request
GET /im/im_queues
Parameters
Parameter Name | Required | Description |
---|---|---|
start_time | Yes | Start time |
end_time | Yes | End time |
page | No | Page number, starting from 1, default is 1 |
per_page | No | Number of items per page, default is 30, maximum is 100 |
- Note: When sending a request with other tools, do not set the Content-Type header to application/json, otherwise an error will occur.
Response Data
Attribute Name | Type | Description |
---|---|---|
code | Integer | Execution result code, 1000 represents success |
shut_queues | Array | List of customers |
shut_queues Element Data Structure
Attribute Name | Type | Description |
---|---|---|
customer_id | Integer | ID |
customer_name | String | Customer nickname |
channel | String | Channel, such as web, wechat, ios, android, weibo, api, mchat |
queue_start_time | String | Time when the customer started queuing |
queue_seconds | String | Time spent in the queue |
queue_name | String | Name of the queue |
current_page | Integer | Current page number |
total_pages | Integer | Total number of pages |
count | Integer | Total number of items on the current page |
Example
Request
curl https://demo.udesk.cn/open_api_v1/im/im_queues?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
&start_time=2019-02-10&end_time=2019-02-15
Response
{
"code": 1000,
"shut_queues": [
{
"id": 123,
"customer_id": 1234,
"channel": "web",
"queue_start_time": "2022-03-25T15:55:20.000+08:00",
"queue_seconds": 27,
"queue_name": "xxx",
"customer_name": {
"id": 12345,
"email": "123.123.123.123@temp.com",
"signature": null,
"notify": null,
"weibo_name": null,
"weixin_openid": null,
"nick_name": "xxx",
"weibo_id": null,
"company_id": 1,
"created_at": "2022-03-25T15:55:03.000+08:00",
"updated_at": "2022-03-25T15:55:04.000+08:00",
"organization": null,
"cellphone": null,
"telephone": null,
"weixin_id": null,
"authentication_token": null,
"description": "IM user:ip(123.123.123.123)",
"qq": null,
"platform_id": 4,
"ticket_show_filters": {
"show_user": "true",
"show_assignee": "true",
"show_created_at": "true",
"show_priority": "true",
"show_status": "true",
"show_platform": "true"
},
"wechat_status": "offline",
"custom_fields": {
"SelectField_3999": [
"0"
]
},
"leave_msg_expire_at": null,
"customer_import_record_id": null,
"web_token": "1f85c1b8-61b9-44f3-3468-9f5w164d099f",
"sdk_token": null,
"is_anonym": false,
"owner_id": null,
"ip": "123.123.123.123",
"from": "xxxxx",
"weibo_status": null,
"weibo_leave_msg_expire_at": null,
"deleted": false,
"weixin_api_status": null,
"weixin_appid": null,
"weixin_appsecret": null,
"owner_group_id": null,
"source_channel": "web_im",
"weixin_channel_id": null,
"province": "xx",
"city": "xx",
"phone_service_provider": null,
"isp": "xxx",
"last_contact_at": null,
"first_contact_at": null,
"contact_count": null,
"last_contact_at_via_phone": null,
"first_contact_at_via_phone": null,
"contact_count_via_phone": null,
"last_contact_at_via_im": null,
"first_contact_at_via_im": null,
"contact_count_via_im": null,
"latest_device_info": {
"os": "Win7",
"browser": "Chrome99",
"resolution": "1920*1080"
},
"organization_id": null,
"is_blocked": false,
"generated_channel": null,
"weibo_channel_id": null,
"level": "normal",
"open_api_token": null,
"current_ticket_id": null,
"mchat_openid": null
},
"im_web_plugin_id": 16,
"menu_names": "xxx"
}
],
"meta": {
"current_page": 1,
"total_pages": 1,
"count": 1
}
}
Send IM Structured Message
This interface is used to send structured messages to customers through IM. Rate limit: 1 time/2 seconds
Authentication
The signature method is described in Authentication Method, but note the following two points:
- The order of the Query String must be
im_sub_session_id
,customer_id
,agent_id
,timestamp
; - Replace the shared secret with the "Structured Message KEY". You can find it in the backend of the website under 'Management Center' -> 'Channel Management' -> 'Instant Messaging' -> 'Structured Messages'.
Request Method
POST /im/sessions/struct_messages
Request Parameters (Query String)
Parameter Name | Required | Description |
---|---|---|
im_sub_session_id | Yes | Session ID |
customer_id | Yes | Customer ID |
agent_id | Yes | Agent ID |
timestamp | Yes | Timestamp |
Note: Customers created through the API cannot be used for this interface.
Request Parameters (Request Body)
Parameter Name | Required | Type | Description |
---|---|---|---|
jid_resource | No | String | SDK Channel Source |
data | Yes | Object | Structured Message |
data
Parameter Name | Required | Type | Description |
---|---|---|---|
title | Yes | String | Title |
description | Yes | String | Description |
img_url | Yes | String | Image URL |
buttons | Yes | Array | Buttons List |
buttons Element Structure
Parameter Name | Required | Type | Description |
---|---|---|---|
type | Yes | String | Button Type |
text | Yes | String | Button Title |
value | Yes | String | Button Value |
callback_name | No | String | Callback Name, only valid when type is sdk_callback |
type Values
Value | Meaning |
---|---|
link | Link Button |
phone | Phone Button |
sdk_callback | Callback Button (SDK only) |
Response Data
Attribute Name | Type | Description |
---|---|---|
status | Integer | Execution result code, 1000 represents success |
message | String | Execution result description |
Example
curl https://demo.udesk.cn/open_api_v1/im/sessions/struct_messages?im_sub_session_id=1&customer_id=1&agent_id=1×tamp=1494814031&sign=129da7df812jdfsa9912jfdadf81 \
-X POST \
-H 'content-type: application/json' \
-d '
{
"data": {
"title": "Test API sends structured message",
"description": "This message is from the API.",
"img_url": "https://www.udesk.cn/images/index/banner01.jpg",
"buttons": [
{
"type": "link",
"text": "Visit",
"value": "https://www.udesk.cn"
},
{
"type": "phone",
"text": "Dial a phone call",
"value": "010-12345678"
},
{
"type": "sdk_callback",
"callback_name": "sdk_callback",
"text": "Callback button",
"value": "v1"
}
]
}
}'
Response
{
"status": 1000,
"message": "Send Success"
}
Custom IM Structured Messages List Page
Custom IM structured messages list page is an HTML page provided by you, which contains commonly used structured messages for customer service to quickly select and send to customers in the Udesk IM console. To use a custom IM structured messages list page, you need to follow these two steps:
- First, you need to write an HTML page and provide the public address of the page;
- Set the "Embedded Link" in Udesk 'Management Center' - 'Structured Messages'.
Writing HTML Page
Udesk will present your HTML page to customer service in an iframe when they need to select a structured message, and pass the following parameters to your HTML page as query strings:
Parameter Name | Description |
---|---|
im_sub_session_id | Session ID |
customer_id | Customer ID |
agent_id | Agent ID |
jid_resource | SDK Source |
timestamp | Timestamp |
Additionally, the signature calculated in accordance with the Authentication Method will also be passed as the sign parameter. |
The calculation of the signature is slightly different from Authentication Method and consistent with the Send IM Structured Message Interface. When you receive the request, it is recommended to first verify whether the
sign
value is valid before deciding to return the HTML page. At the same time, in the HTML page, you can use the above parameters to call the Send IM Structured Message Interface to complete the sending of structured messages.
Settings
- Log in to the Udesk system as an administrator;
- Go to 'Management Center' - 'Channel Management' - 'Instant Messaging' - 'Structured Messages';
- Set the "Embedded Link" to the public address of the HTML page you provided.
Example
Assuming the following settings in the Management Center:
- Embedded Link:
https://www.demo.com/struct_messages
- KEY:
708ff6dc-41d5-4med-9ebc-0388zz9d76f1
When the customer service agent clicks the "Structured Messages" list icon in the IM console chat interface, Udesk will display an iframe page containing an address similar to the following:
https://www.demo.com/struct_message?im_sub_session_id=1&customer_id=1&agent_id=1&jid_resource=12dsafdaslj129das-12fds912-12dsa×tamp=1484272693&sign=4666293b3dfe91aa97179dc701be7afc
Note that the calculation method of the sign
is as follows:
md5("im_sub_session_id=1&customer_id=1&agent_id=1×tamp=1484272693&708ff6dc-41d5-4med-9ebc-0388zz9d76f1")
# => 4666293b3dfe91aa97179dc701be7afc
FAQ
What conditions do we need to meet to use this API interface?
This API interface requires a significant amount of development and has high requirements. You must meet the following conditions:
- You must have your own Instant Messaging platform.
- Udesk is only responsible for pushing to your server, not to your customers.
- You must already have an instant messaging platform or the ability to build one, or use a third-party platform.
- If your customers are all on the WeChat/Weibo platform, you can be considered to have an instant messaging platform.
- You must have strong backend development capabilities and need to perform the following work:
- Maintain customer information and update users to the Udesk platform
- Maintain customer sessions
- Maintain conversation content and push customer service responses to customers
- [Optional] Maintain satisfaction display and results
What is the format of the request sent to the server address we specify?
It is a POST request in JSON format.
Why does the customer not exist when I request a session?
Before requesting a session, you need to request the creation of a customer, see:
Our server does not receive customer service responses, how can we confirm if Udesk has pushed them?
It is recommended to:
- Use nginx/apache as a front-end, so you can see the logs whether the request has been received regardless of whether the backend application is processed correctly
- The application server should first print the received request body to the log to see if the request has been received, and then proceed with business logic development
Why does the reply message return multiple messages at different times?
- When some events and messages have strong order bindings, such as the start of a session event and the welcome message.