查询多个群发活动信息

查询多个群发活动的详细信息。

请求 URL

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

请求参数

参数 是否必填 类型 说明
ids Integer 群发活动的 ID。
注:
  • 使用半角逗号 , 分隔多个 ID。

响应参数

参数 类型 说明
errcode Integer 返回错误码。
  • 0:请求成功。
  • 非零值:请求失败。
注: 更多错误码和错误信息说明,请参见 错误码 & 错误信息
errmsg String 返回信息。
  • SUCCESS:请求成功。
  • FAILURE:请求失败。
list Array <MSGCampaign_DetailInfo> 查询的群发活动的消息列表。
MSGCampaign_DetailInfo
参数 类型 说明
id Integer 群发活动 ID。
name String 群发活动名称。
channel_type String 群发活动所使用的消息渠道类型。
  • sms:SMS 渠道。
  • whatsapp:WhatsApp 渠道。
omnichannel_id Integer 群发活动所使用的消息渠道 ID。
sender String 用于发送消息的号码。
recipient_type String 在群发活动中添加收信人的方式。
  • input:手动输入或文件导入收信人号码。
  • phonebook:从特定企业联系人群组中获取收信人号码。
recipient_id Integer 存储了收信人号码的企业联系人群组的 ID。
recipient_num_type String 指定号码类型,系统将从指定企业联系人群组中获取此类型号码作为收信人号码。
send_type String 群发活动消息发送时间。
  • immediately:活动保存后立即发送消息。
  • schedule:在指定时间发送消息。
  • draft:活动被保存为草稿,暂不发送消息。
send_time Integer 活动指定发送时间的时间戳。
send_mode String 活动发送模式。
  • new_session:发送活动消息时自动创建新会话,并分配给指定对象。
  • direct:直接发送消息,不创建新会话。
assign_to_type String 新建群发活动会话将被分配到的目的地类型。
  • extension:分机。
  • queue:消息队列。
assign_to_id Integer 新建群发活动会话将被分配到的目的地的 ID。
content_type String 消息内容的类型。
  • text:文本消息。
  • document:文件消息。
  • template:WhatsApp 消息模板。
content String 消息内容。
number_list Array <Number_List> 手动输入或文件导入的电话号码列表。
msg_param String

消息参数,其中包含要填充到模板中的参数,为 JSON 字符串格式。

注: 此参数仅在群发活动中使用的是 WhatsApp 消息模板时返回。
Number_List
参数 类型 说明
id Integer 电话号码 ID。
number String 电话号码。

示例

请求示例

GET /openapi/v1.0/message_campaign/query?access_token=MmkEiOx3iOn4qbIOUh9QI0Bzj69pXza3&ids=245,255 HTTP/1.1
Host: 192.168.5.150:8088

响应示例

HTTP/1.1 200 OK
{
    "errcode": 0,
    "errmsg": "SUCCESS",
    "list": [
        {
            "id": 245,
            "name": "VIP Summer Sale Notification",
            "channel_type": "sms",
            "omnichannel_id": 7,
            "sender": 7,
            "recipient_type": "input",
            "send_type": "immediately",
            "send_mode": "new_session",
            "assign_to_type": "queue",
            "assign_to_id": 1,
            "content_type": "text",
            "content": "Hi! We’re excited to announce our new product line. Check it out on our website and enjoy a special launch offer!",
            "number_list": [
                {
                    "id": 7858,
                    "number": "+8615394416953"
                },
                {
                    "id": 7858,
                    "number": "+8615394416954"
                }
            ]
        },
        {
            "id": 255,
            "name": "New Product Launch",
            "channel_type": "whatsapp",
            "omnichannel_id": 1,
            "sender": 1,
            "recipient_type": "input",
            "send_type": "schedule",
            "send_time": 1753898766,
            "send_mode": "new_session",
            "assign_to_type": "extension",
            "assign_to_id": 2,
            "content_type": "template",
            "content": "{\"id\":1773,\"template_id\":\"1293546285747227\",\"name\":\"docstest\",\"parameter_format\":\"NAMED\",\"components\":[{\"type\":\"HEADER\",\"format\":\"IMAGE\"},{\"type\":\"BODY\",\"text\":\"Hello! 👋\\n\\nAs a valued  {{customer_tier}} member, we’re excited to share a special {{offer_type}} with you! 🎁\\nEnjoy {{offer_details}}—available until {{expiry_date}}.\\n\\nIf you have any questions or want to redeem your offer, simply reply to this message or contact our team.\\n\\nThank you for choosing {{company_name}}! 💙\"},{\"type\":\"BUTTONS\",\"buttons\":[{\"type\":\"FLOW\",\"text\":\"Redeem Offer\",\"flow_id\":657693363952373,\"flow_action\":\"NAVIGATE\",\"navigate_screen\":\"SIGN_UP\"},{\"type\":\"URL\",\"text\":\"Visit website\",\"url\":\"https://test.com/\"},{\"type\":\"VOICE_CALL\",\"text\":\"Contact us\"}]}],\"language\":\"en\",\"category\":\"MARKETING\",\"sub_category\":\"CUSTOM\",\"omnichannel_id\":1}",
            "msg_param": "{\"id\":1773,\"template_id\":\"1293546285747227\",\"name\":\"docstest\",\"language\":{\"code\":\"en\"},\"components\":[{\"type\":\"HEADER\",\"parameters\":[{\"type\":\"IMAGE\",\"file_list\":[{\"id\":\"d8b23d56d9974cdb90d6c2d6927861b9\",\"name\":\"pexels-photo-5632382.jpeg\",\"uri\":\"20250725/d8b23d56d9974cdb90d6c2d6927861b9\",\"type\":\"image/jpeg\",\"size\":88555}]}]},{\"type\":\"BODY\",\"parameters\":[{\"type\":\"TEXT\",\"text\":\"\",\"parameter_name\":\"customer_tier\"},{\"type\":\"TEXT\",\"text\":\"\",\"parameter_name\":\"offer_type\"},{\"type\":\"TEXT\",\"text\":\"\",\"parameter_name\":\"offer_details\"},{\"type\":\"TEXT\",\"text\":\"\",\"parameter_name\":\"expiry_date\"},{\"type\":\"TEXT\",\"text\":\"SmartMal\",\"parameter_name\":\"company_name\"}]},{\"type\":\"BUTTONS\",\"parameters\":[{\"type\":\"FLOW\",\"text\":\"\"},{\"type\":\"URL\",\"text\":\"\"},{\"type\":\"VOICE_CALL\",\"text\":\"\"}]}],\"parameter_format\":\"NAMED\"}"
        }
    ]
}