查询多条消息渠道信息

查询单条指定消息渠道的详细信息,包括 SMS 短信渠道、WhatsApp 消息渠道和 Facebook 消息渠道。

请求 URL

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

请求参数

1.
参数 是否必填 类型 说明
ids String 消息渠道的唯一 ID。
注:

响应参数

2.
参数 类型 说明
errcode Integer 返回错误码。
  • 0:请求成功。
  • 非零值:请求失败。
注: 更多错误码和错误信息说明,请参见 错误码 & 错误信息
errmsg String 返回信息。
  • SUCCESS:请求成功。
  • FAILURE:请求失败。
list Array<Msg_Channel> 消息渠道详情。
Msg_Channel
3.
参数 类型 说明
id Integer 消息渠道的唯一 ID。
name String 消息渠道名称。
domain_type String Webhook URL 所使用的域名类型。
  • fqdn:Yeastar FQDN。
  • nat:通过 NAT 映射公网 IP 后的域名。
webhook_gid String Webhook 的全局唯一标识。
webhook_url String 用于消息推送 webhook 的 Webhook URL。
type String 消息渠道类型。
  • sms
  • whatsapp
  • facebook
channel String 消息渠道的运营商。
  • general
  • apidaze
  • athena
  • bandwidth
  • flowroute
  • ixica
  • siptrunk
  • skyetel
  • telnyx
  • twilio
  • vetta
  • voicemeup
  • whatsapp
  • facebook
account_data Array<Auth_Info> 运营商要求的消息渠道连接所需信息。
verify_token String 用于 Webhook 验证的令牌。
phone_number_id String 号码 ID。
注: 此参数仅在查询 WhatsApp 消息渠道时会返回信息。
business_account_id String WhatsApp 账户 ID。
注: 此参数仅在查询 WhatsApp 消息渠道时会返回信息。
send_rate Integer 消息发送速率,表示 PBX 通过该消息渠道每秒可发送的消息数量。
auto_close_session Integer 是否自动关闭在指定时间内无任何互动的消息会话。
  • 0:禁用。
  • 1:启用。
session_expired_time Integer 会话超时时间 (天)。消息会话在超过此指定时间未有任何互动后将自动关闭。
dids Array<Msg_Routing> 消息渠道的消息路由规则详情。
accompanying_msg String 发送聊天文件时附带的默认文本内容。
注: 此参数仅在查询 Apidaze SMS 短信渠道时返回信息。
Auth_Info
参数 类型 说明
k String 运营商要求的对接信息的字段名。
v String 对接信息字段值。
Msg_Routing
参数 类型 说明
id Integer DID 号码的唯一 ID。
omnichannel_id Integer DID 号码绑定的消息渠道的唯一 ID。
did_number String 与消息渠道绑定的 DID 号码。
destination_id String 消息接收目的地的 ID。
destination_number String 消息接收目的地的号码。
destination_name String 消息接收目的地的名称。
members Array<Members> 允许使用此 DID 号码创建会话以发送消息的成员。
destination_type String 消息接收目的地的类型。
  • extension:分机用户。
  • queue:消息队列。
  • api:第三方分析平台 (消息通过二次开发接口传递)
Members
参数 类型 说明
text String 成员的名称。
text2 String 成员信息,依据成员类型而定。
  • 对于分机,此参数返回分机号码。
  • 对于分机组,此参数返回分机组名称。
  • 对于部门,此参数返回为空。
value String 成员的唯一 ID。
type String 成员类型。
  • extension:分机。
  • ext_group:分机组。
  • organization:部门。

示例

请求示例

查询两条消息渠道的信息 (ID:3 & 206)。

GET /openapi/v1.0/message_channel/query?access_token=gE3xGWAULl1wn6fiWSjOnf2Dcn3lnkKP&ids=3,206 HTTP/1.1

Host: yeastardocs.example.yeastarcloud.com

响应示例

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": ""
        }
    ]
}