Skip to content

获取互动消息列表 ​

分页获取视频号的互动消息,类型用 reqScene 选:点赞、评论或关注。

接口地址: POST /finder/getMentionList

说明与注意 ​

  • myUserName、myRoleType 从获取个人主页的返回里取。
  • mentionContent 可能含微信自定义标签,直接展示前要处理。

请求参数 ​

参数名必选类型说明
wId是string登录实例标识
lastBuff是string分页参数;首次传空,翻页时传响应中的 lastBuff
myUserName是string自己的视频号用户编码
myRoleType是int自己的视频号角色类型
reqScene是int消息类型:3 点赞,4 评论,5 关注

请求示例 ​

http
POST {BASE_URL}/finder/getMentionList
Authorization: Bearer <你的调用凭证>
Content-Type: application/json

{
  "wId": "{{wId}}",
  "lastBuff": "",
  "myUserName": "v2_060000231003b20faec8cae18ec5d0cb07ea33b077ba915250774edbea38082ea6b24af229@finder",
  "myRoleType": 3,
  "reqScene": 3
}
bash
curl -X POST '{BASE_URL}/finder/getMentionList' \
  -H 'Authorization: Bearer <你的调用凭证>' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "wId": "{{wId}}",
  "lastBuff": "",
  "myUserName": "v2_060000231003b20faec8cae18ec5d0cb07ea33b077ba915250774edbea38082ea6b24af229@finder",
  "myRoleType": 3,
  "reqScene": 3
}'
python
import requests

url = "{BASE_URL}/finder/getMentionList"
headers = {"Authorization": "Bearer <你的调用凭证>", "Content-Type": "application/json"}
body = """{
  "wId": "{{wId}}",
  "lastBuff": "",
  "myUserName": "v2_060000231003b20faec8cae18ec5d0cb07ea33b077ba915250774edbea38082ea6b24af229@finder",
  "myRoleType": 3,
  "reqScene": 3
}"""

resp = requests.post(url, headers=headers, data=body.encode("utf-8"))
print(resp.text)
java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

String url = "{BASE_URL}/finder/getMentionList";
String body = "{\n" +
    "  \"wId\": \"{{wId}}\",\n" +
    "  \"lastBuff\": \"\",\n" +
    "  \"myUserName\": \"v2_060000231003b20faec8cae18ec5d0cb07ea33b077ba915250774edbea38082ea6b24af229@finder\",\n" +
    "  \"myRoleType\": 3,\n" +
    "  \"reqScene\": 3\n" +
    "}";

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder(URI.create(url))
    .header("Authorization", "Bearer <你的调用凭证>")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(body))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
php
<?php

$url = '{BASE_URL}/finder/getMentionList';
$body = <<<'JSON'
{
  "wId": "{{wId}}",
  "lastBuff": "",
  "myUserName": "v2_060000231003b20faec8cae18ec5d0cb07ea33b077ba915250774edbea38082ea6b24af229@finder",
  "myRoleType": 3,
  "reqScene": 3
}
JSON;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer <你的调用凭证>',
    'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;

成功响应 ​

json
{
  "code": "1000",
  "message": "获取消息列表成功",
  "data": {
    "lastBuff": "CC0QAA==",
    "list": [
      {
        "flag": 0,
        "svrMentionId": 45,
        "headUrl": "https://wx.qlogo.cn/mmhead/ver_1/example/132",
        "description": "我-要-带-他 #奥利奥 ",
        "likeInfo": {
          "followMyFirstLike": 1,
          "likeId": 14427663669542524928,
          "likeType": 1
        },
        "refObjectNonceId": "16545206785312904238",
        "contact": {
          "relationType": 1,
          "contact": {
            "nickname": "阿",
            "headUrl": "https://wx.qlogo.cn/mmhead/ver_1/example/132",
            "username": "v5_020b0a166104010000000000f97523fa9f9a980000b1afa7d8728e3dd43ef4317a780e33c2996857e4fdf7e8b0f6772a3d0ed77295b3d890228fa85a9b3fee4fcea2e482220cc39f99b859576a7cdc4350fe20426405885897b149a5e97b8b4747be@stranger"
          }
        },
        "nickname": "阿",
        "mentionType": 7,
        "thumbUrl": "http://wxapp.tc.qq.com/251/20304/stodownload?...",
        "createtime": 1719911551,
        "refCommentId": 0,
        "mediaType": 4,
        "mentionId": 68719476780,
        "refObjectId": 14426124740495808818,
        "refObjectType": 0,
        "authorContact": {
          "nickname": "王",
          "username": "v2_060000231003b20faec8c4e28a1dc6d4ce04e5b07734d2a64d661f5f4f8fb8178de6c4a63d@finder"
        },
        "mentionContent": "<_wc_custom_img_ color=\"FG_0\" src=\"finder://dynamic_icon/FinderObjectDynamicImageKey_FinderLikeIconPng\" /> -->",
        "refContent": "",
        "username": "wxid_tdkou9quqz22"
      }
    ]
  }
}

错误响应 ​

json
{
  "code": "1001",
  "message": "失败",
  "data": null
}

响应参数 ​

参数名类型说明
codestring1000 成功;其他值都是失败,通常是 1001
messagestring反馈信息
dataobject消息列表结果
data.lastBuffstring下一页分页参数
data.listarray消息列表
data.list[].mentionIdnumber消息 ID
data.list[].svrMentionIdnumber服务端消息 ID
data.list[].mentionTypeint消息类型
data.list[].nicknamestring触发用户昵称
data.list[].usernamestring触发用户微信 ID
data.list[].headUrlstring头像地址
data.list[].descriptionstring消息描述
data.list[].mentionContentstring消息内容
data.list[].refObjectIdnumber关联作品 ID
data.list[].refObjectNonceIdstring关联作品 nonceId
data.list[].refCommentIdnumber关联评论 ID
data.list[].thumbUrlstring作品封面
data.list[].createtimenumber消息时间,Unix 秒级时间戳
data.list[].likeInfoobject点赞信息
data.list[].contactobject触发用户信息
data.list[].authorContactobject作者信息