POST
收藏

同步收藏

POSThttps://api.xingyapi.com/api/collection/sync

接口用途

用于同步收藏(增量拉取收藏列表)。

请求说明

请求体使用 JSON 格式。设备相关接口通过 instance_guid 指定设备实例;seq 为增量游标,首次传 0。

返回说明

统一响应信封 {ok, code, message, request_id, data};code=0 表示成功,data 为收藏列表。

请求参数

字段类型说明
instance_guid必填string星云实例标识(inst_xxxx),标识本次操作的账号
seq必填integer同步游标;首次传 0,后续传上次返回的最大 updateSeq 继续增量同步。
limit必填integer单次返回数量上限。

请求示例

{
  "instance_guid": "inst_xxxxxxxx",
  "seq": 0,
  "limit": 1000
}

响应字段

字段类型说明
dataarray收藏列表(每个元素一条收藏)。
data[].idnumber收藏项 ID。
data[].businessIdnumber业务 ID。
data[].itemFlagnumber收藏项标记(以实际返回为准)。
data[].createSeqnumber创建序列号(增量游标)。
data[].updateSeqnumber更新序列号(增量游标;下次同步传最大值)。
data[].createTimenumber创建时间(秒级时间戳)。
data[].updateTimenumber更新时间(秒级时间戳)。
data[].appInfostring来源应用信息(以实际返回为准)。
data[].senderNamestring发送者名称。
data[].contentobject收藏内容对象。
data[].content.opTypenumber操作类型(以实际返回为准)。
data[].content.dataobject收藏的消息内容对象(结构与消息记录一致:发送人/会话/正文/媒体等)。
data[].content.favMapobject收藏媒体映射对象。
data[].content.favMap.orgMailIdstring原始媒体标识。
data[].content.favMap.newMailIdstring转存后媒体标识。
data[].content.favMap.orgPicUrlstring原图地址。
data[].content.favMap.newPicUrlstring转存后图片地址。
data[].content.favMap.msgContentTypenumber消息内容类型(以实际返回为准)。
data[].content.favMap.saveRetnumber转存结果(以实际返回为准)。
data[].content.favMap.collectionPicTypenumber收藏图片类型(以实际返回为准)。
data[].content.favMap.coverPicUrlstring封面图地址。
data[].content.favMap.emotionPiCmd5string表情图 MD5。
data[].content.favMap.wxauthKeystring下载鉴权票据。
data[].content.favMap.newFileSizenumber转存后文件大小(字节)。

响应示例

{
  "ok": true,
  "code": 0,
  "message": "success",
  "request_id": "nb_xxxxxxxx",
  "data": [
    {
      "id": 2,
      "businessId": 10002,
      "itemFlag": 4,
      "createSeq": 11195321,
      "updateSeq": 11195323,
      "createTime": 1789042048,
      "updateTime": 1789042048,
      "appInfo": "<省略>",
      "senderName": "",
      "content": {
        "opType": 1,
        "data": {
          "senderId": 1688850000000000,
          "conversationId": 1970320000000000,
          "time": 1789042047,
          "fromType": 0,
          "contentType": 5,
          "content": {
            "id": 0,
            "syncKey": 15875656,
            "messageType": 1,
            "fromUserId": 1688850000000000,
            "toUserId": 1688850000000001,
            "roomId": 1970320000000000,
            "contentType": 15,
            "sendTime": 1788325751,
            "appInfo": "<省略>",
            "senderName": "",
            "content": {
              "id": "<fileId 省略>",
              "name": "message.txt",
              "url": "",
              "size": 14146922,
              "aesKey": "<省略>",
              "md5": "<省略>"
            },
            "extraData": "<省略>",
            "flag": 131074,
            "devInfo": 0,
            "summary": ""
          },
          "origMsgIds": 1005141,
          "filterType": 0,
          "extraSearchData": {
            "userBriefInfos": [
              {
                "userId": 1688850000000000,
                "userEngName": ""
              }
            ],
            "convBriefInfos": [
              {
                "convId": 1970320000000000,
                "convName": ""
              }
            ],
            "fullSearchText": [
              "message.txt"
            ]
          },
          "dataVersion": 3,
          "senderInfo": {
            "senderName": ""
          },
          "emotionSortTime": 1789042047,
          "conversationType": 0,
          "conversationFwId": 0,
          "mixMsgSubId": null,
          "mixMsgContent": null
        },
        "favMap": {
          "orgMailId": "<省略>",
          "newMailId": "<省略>",
          "orgPicUrl": "",
          "newPicUrl": "",
          "msgContentType": 20,
          "saveRet": 0,
          "collectionPicType": 0,
          "coverPicUrl": "",
          "emotionPiCmd5": "",
          "thirdEncrypy": 0,
          "wxauthKey": "",
          "height": 0,
          "weight": 0,
          "newFileSize": 0
        }
      }
    }
  ]
}

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

在线调试

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

基础信息

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

联系客服

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