Query Information of Multiple Message Sessions
Query the detailed information of multiple message sessions.
Request URL
GET {base_url}/{api_path}/message_session/query?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| ids | Yes | String | The unique ID(s) of the message sessions. Note:
|
Response parameter
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
|
| errmsg | String | Returned message.
|
| list | Array<Session_Info> | The detailed information of the message sessions. |
Session_Info
| Parameter | Type | Description |
|---|---|---|
| id | Integer | The unique ID of the message session. |
| channel_type | String | The type of the message channel for the session.
|
| channel_name | String | The name of the message channel for the session. |
| did_number | String | The DID number used in the message session. |
| to_number | String | The ID or phone number of the external customer. |
| origin | String | The origin of the message session.
|
| page_name | String | The name of the Facebook page. Note: This parameter only returns value for a Facebook session. |
| website_domain | String | The domain of the website where Live Chat widget is embedded. Note: This parameter only returns value for a Live Chat session. |
| pre_chat_form | Object<PreChat_Form> | The content of the pre-chat form filled in by external customer. Note: This parameter only returns value for a Live Chat session. |
| user_info | Object<Customer_Info> | The information of the external customer in the session. |
| participants | Array<Agent_Info> | The information of the message queue agent in the session. Note: This parameter only returns value when the message session is assigned to a message queue and has not been picked up. |
PreChat_Form
| Parameter | Type | Description |
|---|---|---|
| name | String | User name. |
| String | Email address. | |
| phone | String | Phone number. |
| first_name | String | First name. |
| last_name | String | Last name. |
Customer_Info
| Parameter | Type | Description |
|---|---|---|
| user_id | Integer | The ID of the internal user in the session. Note: This parameter always returns 0. |
| user_no | String | The ID or phone number of the external customer. |
| user_type | Integer | The type of the external customer.
|
| avatar | String | The ID of the customer's avatar. |
| username | String | User name of the customer. |
Agent_Info
| Parameter | Type | Description |
|---|---|---|
| user_id | Integer | The ID of the agent's extension. |
| user_no | String | The number of the agent's extension. |
| user_type | Integer | The type of the user.
|
| avatar | String | The ID of the agent's avatar. |
| username | String | The caller ID name of the agent's extension. |
Examples
Request example
Query the detailed information of two message sessions (ID: 3035 & 3073).
GET /openapi/v1.0/message_session/query?access_token=PqR954uFQ5h36g43blSG6rg9HboK4Pdz&ids=3035,3073 HTTP/1.1 Host: 192.168.5.150:8088
Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"list": [
{
"id": 3035,
"channel_type": "sms",
"did_number": "+15551234567",
"to_number": "+18665554444",
"page_name": "",
"user_info": {
"user_id": 0,
"user_no": "+18665554444",
"user_type": 2,
"avatar": "",
"username": "John Doe"
},
"channel_name": "General SMS channel",
"website_domain": "",
"origin": "",
"participants": null
},
{
"id": 3073,
"channel_type": "sms",
"did_number": "+14443335555",
"to_number": "+17778889999",
"page_name": "",
"user_info": {
"user_id": 0,
"user_no": "+17778889999",
"user_type": 2,
"avatar": "",
"username": ""
},
"channel_name": "Apidaze SMS channel",
"website_domain": "",
"origin": "",
"participants": null
}
]
}