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.
|
| errmsg | String | Returned message.
|
| list | Array<Msg_Channel> | The detailed information of the message channels. |
Msg_Channel
| 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.
|
| 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.
|
| channel | String | The service provider of the message channel.
|
| 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.
|
| session_expired_time | Integer | The duration of inactivity (in days) after which a session is automatically closed. |
| enb_duplicate_active_session | Integer | Whether the creation of duplicate active sessions (same sender and receiver) are allowed. Note: This parameter only returns when querying an SMS channel or a WhatsApp channel.
|
| 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. |
Auth_Info
| Parameter | Type | Description |
|---|---|---|
| k | String | The name of the key field required by the service provider. |
| v | String | The value corresponding to the key field. |
Msg_Routing
| Parameter | Type | Description |
|---|---|---|
| id | Integer | The unique ID of the DID number. |
| omnichannel_id | Integer | The unique ID of the message channel that is associated with the DID number. |
| did_number | String | The DID number associated with the message channel. |
| destination_id | String | The ID of destination to which inbound messages are sent. |
| destination_number | String | The number of the destination. |
| destination_name | String | The name of the destination. |
| members | Array<Members> | The members that are allowed to initiate a message session using the DID number. |
| destination_type | String | The type of the destination.
|
Members
| Parameter | Type | Description |
|---|---|---|
| text | String | The name of the member. |
| text2 | String | The information of the member, depending on the member type.
|
| value | String | The unique ID of the member. |
| type | String | Member type.
|
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: 192.168.5.150:8088
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.cloudone.co/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",
"enb_duplicate_active_session": 1
},
{
"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.cloudone.co/api/v1.0/webhook/apidaze/858ba05206654893aa3ecd1a6eeb6e91",
"send_rate": 1,
"phone_number_id": "",
"verify_token": "",
"domain_type": "nat",
"accompanying_msg": "Sent by Cloud One",
"business_account_id": "",
"enb_duplicate_active_session": 1
}
]
}