POST
消息

发送链接卡片消息(包含视频号)

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

接口用途

用于发送链接卡片消息(包含视频号)。

请求说明

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

返回说明

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

请求参数

字段类型说明
instance_guid必填string星云实例标识(inst_xxxx),标识本次操作的账号
conversationId必填number会话唯一标识,可表示单聊或群聊会话。
content必填object链接卡片内容对象;字段见下。
content.linkUrlstring卡片点击后跳转的目标链接。
content.imageUrlstring卡片封面图地址。
content.titlestring卡片标题。
content.descriptionstring卡片描述(摘要)。

请求示例

{
  "instance_guid": "inst_xxxxxxxx",
  "conversationId": "10758922947847562",
  "content": {
    "linkUrl": "https://example.com/...",
    "imageUrl": "https://example.com/...",
    "title": "星云API 测试链接卡片",
    "description": "这是一条测试链接卡片消息"
  }
}

响应字段

字段类型说明
idnumber发送成功后的消息内部标识。
syncKeynumber增量同步游标,后续同步时应回传该值。
messageTypenumber消息类型编号;具体枚举以消息协议为准。
fromUserIdnumber消息发送方用户标识。
toUserIdnumber消息接收方用户标识。
roomIdstring群聊或客户群唯一标识。
contentTypenumber消息内容类型编号;具体枚举以消息协议为准。
sendTimenumber消息发送时间戳。
senderNamestring消息发送方名称。
contentobject发送成功后返回的消息内容或内容片段。
content.imageUrlstring图片资源地址。
content.titlestring标题。
content.descriptionstring描述信息。
flagnumber状态或能力标识;具体枚举以协议为准。

响应示例

{
  "ok": true,
  "code": 0,
  "message": "success",
  "request_id": "nb_xxxxxxxx",
  "data": {
    "id": 1003089,
    "syncKey": 9548397,
    "messageType": 1,
    "fromUserId": 1688857970889847,
    "toUserId": 0,
    "roomId": "10758922947847562",
    "contentType": 13,
    "sendTime": 1788430205,
    "senderName": "示例名称",
    "content": {
      "imageUrl": "https://example.com/...",
      "title": "星云API 测试链接卡片",
      "description": "这是一条测试链接卡片消息"
    },
    "flag": 83886080
  }
}

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

在线调试

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

基础信息

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

联系客服

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