查询消息渠道列表

查询消息渠道列表。

请求 URL

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

请求参数

参数 是否必填 类型 说明
page Integer 定义显示第几个页面。
page_size Integer 定义每页显示几项查询结果。
time_range String 指定时间范围,用于统计或筛选消息渠道的消息。

取值范围

  • today:今天。
  • yesterday:昨天。
  • last_7_days:最近 7 天。
  • last_30_days:最近 30 天。
  • this_month:本月。
  • all:所有。

响应参数

参数 类型 说明
errcode Integer 返回错误码。
  • 0:请求成功。
  • 非零值:请求失败。
注: 更多错误码和错误信息说明,请参见 错误码 & 错误信息
errmsg String 返回信息。
  • SUCCESS:请求成功。
  • FAILURE:请求失败。
total_number Integer 消息渠道总数。
list Array<Msg_Channel> 消息渠道的信息。
Msg_Channel
参数 类型 说明
id Integer 消息渠道的唯一 ID。
status String 消息渠道的连接状态。
  • status_connect_succ:连接成功。
  • status_connect_fail:连接失败。
  • status_sub_invalid:PBX 服务订阅无效。
reason String 消息渠道连接失败的原因。
name String 消息渠道名称。
channel String 消息渠道的运营商。
  • general
  • apidaze
  • athena
  • bandwidth
  • flowroute
  • ixica
  • siptrunk
  • skyetel
  • telnyx
  • twilio
  • vetta
  • voicemeup
  • whatsapp
  • facebook
  • livechat
type String 消息渠道类型。
  • sms
  • whatsapp
  • facebook
  • livechat
number Array<String> 消息渠道绑定的 DID 号码。
sent Integer 已发送消息的总数。
delivered Integer 发送成功的消息数量。
failed Integer 发送失败的消息数量。
received Integer 接收的消息数量。

示例

请求示例

GET /openapi/v1.0/message_channel/list?access_token=bapS7zH2cDjmUiOz8h4Kyb88UqZsHPKD&page=1&page_size=5&time_range=today HTTP/1.1

Host: yeastardocs.example.yeastarcloud.com

响应示例

HTTP/1.1 200 OK
{
    "errcode": 0,
    "errmsg": "SUCCESS",
    "total_number": 47,
    "list": [
        {
            "id": 2,
            "status": "status_connect_succ",
            "reason": "",
            "name": "Customer Support Line",
            "channel": "flowroute",
            "type": "sms",
            "number": [
                "+12345678101",
                "+12345678102",
                "+12345678103"
            ],
            "sent": 0,
            "delivered": 0,
            "failed": 0,
            "received": 0
        },
        {
            "id": 3,
            "status": "status_connect_succ",
            "reason": "",
            "name": "Sales Hotline",
            "channel": "whatsapp",
            "type": "whatsapp",
            "number": [
                "+12025550123"
            ],
            "sent": 0,
            "delivered": 0,
            "failed": 0,
            "received": 0
        },
        {
            "id": 6,
            "status": "status_connect_succ",
            "reason": "",
            "name": "Technical Assistance Channel",
            "channel": "livechat",
            "type": "livechat",
            "number": [
                 "LC00000"
            ],
            "sent": 0,
            "delivered": 0,
            "failed": 0,
            "received": 0
        },
        {
            "id": 7,
            "status": "status_connect_fail",
            "reason": "reason_unauthorized",
            "name": "General Inquiry Line",
            "channel": "facebook",
            "type": "facebook",
            "number": [
                 "10234567890123456"
            ],
            "sent": 0,
            "delivered": 0,
            "failed": 0,
            "received": 0
        },
        {
            "id": 14,
            "status": "status_connect_succ",
            "reason": "",
            "name": "VIP Service Channel",
            "channel": "telnyx",
            "type": "sms",
            "number": [
                "+12345678601",
                "+12345678602"
            ],
            "sent": 0,
            "delivered": 0,
            "failed": 0,
            "received": 0
        }
    ]
}