查询多条消息渠道信息
查询单条指定消息渠道的详细信息,包括 SMS 短信渠道、WhatsApp 消息渠道和 Facebook 消息渠道。
请求 URL
GET {base_url}/{api_path}/message_channel/query?access_token={access_token}
请求参数
| 参数 | 是否必填 | 类型 | 说明 |
|---|---|---|---|
| ids | 是 | String | 消息渠道的唯一 ID。 注:
|
响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| errcode | Integer | 返回错误码。
注: 更多错误码和错误信息说明,请参见 错误码 & 错误信息。
|
| errmsg | String | 返回信息。
|
| 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 消息渠道类型。 smswhatsappfacebook
channel String 消息渠道的运营商。 generalapidazeathenabandwidthflowrouteixicasiptrunkskyeteltelnyxtwiliovettavoicemeupwhatsappfacebook
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 短信渠道时返回信息。
示例
请求示例
查询两条消息渠道的信息 (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
响应示例
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": ""
}
]
}