POST
消息

群发助手-群发

POSThttps://api.xingyapi.com/api/message/groupSend

接口用途

用于群发助手-群发。

请求说明

请求体使用 JSON 格式。设备相关接口通过 instance_guid 指定设备实例;其他字段说明见参数表。

返回说明

统一响应信封 {ok, code, message, request_id, data};code=0 表示成功,业务数据在 data 字段。

请求参数

字段类型说明
instance_guid必填string星云实例标识(inst_xxxx),标识本次操作的账号
customerGroup必填boolean群发对象类型:true=按群群发(receiverList 填群 ID),false=按客户群发(receiverList 填客户 ID)。
contentList必填array消息或素材内容列表。
receiverList必填array接收者列表;须与 customerGroup 对应——customerGroup=true 只能填群 ID,customerGroup=false 只能填客户 ID,两者不可混填。
materialId必填number素材库素材 ID;若 contentList 不是取自素材库,则传 0。

请求示例

{
  "instance_guid": "inst_xxxxxxxx",
  "customerGroup": true,
  "contentList": [
    {
      "contentType": 0,
      "content": [
        {
          "type": 3,
          "text": "[撇嘴]"
        },
        {
          "type": 0,
          "text": "企业"
        }
      ]
    },
    {
      "contentType": 14,
      "content": {
        "id": "<fileId 省略>",
        "size": 570260,
        "width": 828,
        "height": 1792,
        "aesKey": "<省略>",
        "md5": "f6e096cd0aa81c8c7204ba40054442a3"
      }
    },
    {
      "contentType": 22,
      "content": {
        "id": "<fileId 省略>",
        "size": 285357,
        "duration": 2,
        "width": 1280,
        "height": 720,
        "thumbUrl": "https://example.com/...",
        "md5": "991510539179cd7fe6460bf9bfeeefe8"
      }
    },
    {
      "contentType": 20,
      "content": {}
    }
  ],
  "receiverList": [
    "10758922947847562"
  ],
  "materialId": "117159486110430465"
}

响应字段

字段类型说明
msgIdstring消息标识。

响应示例

{
  "ok": true,
  "code": 0,
  "message": "success",
  "request_id": "nb_xxxxxxxx",
  "data": {
    "msgId": "117188871652474860"
  }
}

返回接口目录 · 请求规范 · 错误码

在线调试

在控制台中在线测试 API 接口无需编码,快速验证接口效果。

基础信息

Base URL复制
https://api.xingyapi.com
API Key复制
X-Nebula-Key: <API Key>
Content-Type
application/json

联系客服

客服微信二维码
微信号:xingyunbot
扫码或搜索微信号,添加客服获取支持