Query Message Channel List
Query the message channel list.
Request URL
GET {base_url}/{api_path}/message_channel/list?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| page | Yes | Integer | Define which page is displayed. |
| page_size | Yes | Integer | Define how many records per page. |
| time_range | Yes | String | Specify the time period for counting or
filtering messages of the message
channels. Valid value:
|
Response parameters
| 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.
|
| total_number | Integer | The total number of message channels. |
| list | Array<Msg_Channel> | The information of message channels. |
- Msg_Channel
-
Parameter Type Description id Integer The unique ID of the message channel. status String The connection status of the message channel. status_connect_succ: Successfully connected.status_connect_fail: Connection failed.status_sub_invalid: PBX subscription is invalid.
reason String The reason why the message channel connection fails. name String Name of the message channel. channel String The service provider of the message channel. generalapidazeathenabandwidthflowrouteixicasiptrunkskyeteltelnyxtwiliovettavoicemeupwhatsappfacebooklivechat
type String Type of the message channel. smswhatsappfacebooklivechat
number Array<String> DID number(s) associated with the message channel. sent Integer The number of sent messages. delivered Integer The number of messages sent successfully. failed Integer The number of messages that failed to send. received Integer The number of received messages.
Examples
Request example
GET /openapi/v1.0/message_channel/list?access_token=bapS7zH2cDjmUiOz8h4Kyb88UqZsHPKD&page=1&page_size=5&time_range=today HTTP/1.1
Host: yeastardocs.example.yeastarcloud.com
Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"total_number": 47,
"list": [
{
"id": 2,
"status": "status_connect_succ",
"reason": "",
"name": "Customer Support Line",
"channel": "flowroute",
"type": "sms",
"number": [
"+12345678101",
"+12345678102",
"+12345678103"
],
"sent": 0,
"delivered": 0,
"failed": 0,
"received": 0
},
{
"id": 3,
"status": "status_connect_succ",
"reason": "",
"name": "Sales Hotline",
"channel": "whatsapp",
"type": "whatsapp",
"number": [
"+12025550123"
],
"sent": 0,
"delivered": 0,
"failed": 0,
"received": 0
},
{
"id": 6,
"status": "status_connect_succ",
"reason": "",
"name": "Technical Assistance Channel",
"channel": "livechat",
"type": "livechat",
"number": [
"LC00000"
],
"sent": 0,
"delivered": 0,
"failed": 0,
"received": 0
},
{
"id": 7,
"status": "status_connect_fail",
"reason": "reason_unauthorized",
"name": "General Inquiry Line",
"channel": "facebook",
"type": "facebook",
"number": [
"10234567890123456"
],
"sent": 0,
"delivered": 0,
"failed": 0,
"received": 0
},
{
"id": 14,
"status": "status_connect_succ",
"reason": "",
"name": "VIP Service Channel",
"channel": "telnyx",
"type": "sms",
"number": [
"+12345678601",
"+12345678602"
],
"sent": 0,
"delivered": 0,
"failed": 0,
"received": 0
}
]
}