Query Information of a Message Channel

Query the detailed information of a specific message channel.

Note: This API endpoint can be used to query the information of SMS channel, WhatsApp channel, and Facebook channel. To query the information of a Live Chat channel, see Query Information of a Live Chat Channel.

Request URL

GET {base_url}/{api_path}/message_channel/get?access_token={access_token}

Request parameters

Table 1.
Parameter Required Type Description
id Yes Integer The unique ID of the message channel.
Note: You can query message channel ID using Search Specific Message Channels.

Response parameters

Table 2.
Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
data Object<Msg_Channel> The detailed information of the message channel.
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.
  • fqdn
  • nat
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.
  • sms
  • whatsapp
  • facebook
channel String The service provider of the message channel.
  • SMS service provider.
  • whatsapp
  • facebook
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.
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.
  • 0: Not allowed.
  • 1: Allowed. A new session can be created even if another active session exists with the same sender and receiver; the original session is then removed from the previous handler's session list and taken over by the new creator, retaining the complete chat history.
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.
country_code String

The code of the country/region where the agents provide services (e.g., 86).

When messages are triggered during a call (e.g., those triggered by keypress event or missed extension calls), the system uses this code to automatically populate customer phone numbers that are not in E.164 format, and then sends messages to this number.

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.
  • extension: Extension user.
  • queue: Message queue.
  • api: Third-party message analytics platform (Transmitted via API).
  • message_flow: Message flow.
Members
Parameter Type Description
text String The name of the member.
text2 String The information of the member, depending on the member type.
  • For extension: Extension number is returned.
  • For extension group: Extension group name is returned.
  • For organization: An empty string is returned.
value String The unique ID of the member.
type String Member type.
  • extension
  • ext_group
  • organization

Examples

Request example

Query the information of a message channel (ID: 3).

GET /openapi/v1.0/message_channel/get?access_token=IhFe7Gv1L3chn45Bwmxz3GKKKmjXAaDs&id=3 HTTP/1.1

Host: yeastardocs.example.yeastarcloud.com

Response example

HTTP/1.1 200 OK
{
    "errcode": 0,
    "errmsg": "SUCCESS",
    "data": {
        "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",
                "country_code": "86",
                "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",
        "enb_duplicate_active_session": 1
    }
}