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.
Note: You can check the error code and
error message in Error Code and Error Message.
|
| 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. smswhatsappfacebooklivechat
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. campaign: The session is initiated by a message campaign.
Note: If returned empty, it indicates that the session is initiated by an extension user or a third-party message analytics platform (via API).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.
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: yeastardocs.example.yeastarcloud.com
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
}
]
}