Query Information of Multiple Message Channels
Query the detailed information of multiple message channels, including SMS channel, WhatsApp channel, and Facebook channel.
Request URL
GET {base_url}/{api_path}/message_channel/query?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| ids | Yes | String | The unique ID(s) of the message channel(s). Note:
|
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.
|
| list | Array<Msg_Channel> | The detailed information of the message channels. |
- Msg_Channel
-
Table 3. Parameter Type Description id Integer The unique ID of the message channel. name String Name of the message channel. domain_type String The type of domain used in the Webhook URL. fqdnnat
webhook_gid String Global identifier of the Webhook. webhook_url String The Webhook URL used for messaging webhook. type String Type of the message channel. smswhatsappfacebook
channel String The service provider of the message channel. generalapidazeathenabandwidthflowrouteixicasiptrunkskyeteltelnyxtwiliovettavoicemeupwhatsappfacebook
account_data Array<Auth_Info> The data required by the service provider for message channel connection. verify_token String The token used for webhook verification. phone_number_id String Phone number ID. Note: This parameter only returns value when querying a WhatsApp channel.business_account_id String WhatsApp Business Account ID. Note: This parameter only returns value when querying a WhatsApp channel.send_rate Integer Message sending rate, which indicates the number of messages that PBX can send per second via the message channel. auto_close_session Integer Whether messaging sessions will be automatically closed after being inactive for a specified period of time. 0: Disabled.1: Enabled.
session_expired_time Integer The duration of inactivity (in days) after which a session is automatically closed. dids Array<Msg_Routing> The details of message routing rule for the message channel. accompanying_msg String Accompanying text content for chat file. Note: This parameter only returns value when querying an Apidaze SMS channel.
Examples
Request example
Query the information of two message channels (ID: 3 & 206).
GET /openapi/v1.0/message_channel/query?access_token=gE3xGWAULl1wn6fiWSjOnf2Dcn3lnkKP&ids=3,206 HTTP/1.1
Host: yeastardocs.example.yeastarcloud.com
Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"list": [
{
"id": 3,
"name": "WhatsApp Channel",
"webhook_gid": "90c8a2b5b3434471bd73e7c802952f96",
"type": "whatsapp",
"channel": "whatsapp",
"account_data": [
{
"k": "access_token",
"v": "EAAXmEG1QQccBO9wpYSY3r1ZApPu4mmEUvOszfHil3mYLn8xnIlOtirhNoZAybL3TKFHxhgFzdOO9ZBk2XVRPnAHNZCCRmrKZClsM4VCqBPqJWRIt3yaZAjYJZC79UO2pTYaJbtSlIhvHEmSdXXgzmGpsfMFCHEh4N3bY7rsarAf214VP2JFbwNihmXQZAmeSFwZDZD"
},
{
"k": "app_secret",
"v": "41665cf6ef8971b3e1778432ffc2f077"
}
],
"auto_close_session": 1,
"session_expired_time": 1,
"dids": [
{
"did_number": "+15550193510",
"destination_id": "5",
"destination_number": "",
"members": [
{
"text": "Default_All_Extensions",
"text2": "Default_All_Extensions",
"value": "1",
"type": "ext_group"
}
],
"destination_type": "api"
}
],
"webhook_url": "https://docs.example.yeastar.com/api/v1.0/webhook/whatsapp/90c8a2b5b3434471bd73e7c802952f96",
"send_rate": 80,
"phone_number_id": "11577555571069",
"verify_token": "braxzqj5z8md6e29",
"domain_type": "fqdn",
"accompanying_msg": "",
"business_account_id": "10615155550235"
},
{
"id": 206,
"name": "Apidaze SMS Channel",
"webhook_gid": "858ba05206654893aa3ecd1a6eeb6e91",
"type": "sms",
"channel": "apidaze",
"account_data": [
{
"k": "api_key",
"v": "AKIAIOSFODNN7EXAMPLE"
},
{
"k": "api_secret",
"v": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
}
],
"auto_close_session": 0,
"session_expired_time": 0,
"dids": [
{
"id": 214,
"omnichannel_id": 206,
"did_number": "+13599900000",
"destination_id": "136",
"destination_number": "1001",
"destination_name": "1001",
"members": [
{
"text": "Sales",
"value": "2",
"type": "organization"
},
{
"text": "Pre-Sales",
"value": "3",
"type": "organization"
}
],
"destination_type": "extension"
}
],
"webhook_url": "https://docs.example.yeastar.com/api/v1.0/webhook/apidaze/858ba05206654893aa3ecd1a6eeb6e91",
"send_rate": 1,
"phone_number_id": "",
"verify_token": "",
"domain_type": "nat",
"accompanying_msg": "Sent by Yeastar",
"business_account_id": ""
}
]
}