Appearance
获取互动消息列表
分页获取视频号的互动消息,类型用 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
}响应参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | string | 1000 成功;其他值都是失败,通常是 1001 |
| message | string | 反馈信息 |
| data | object | 消息列表结果 |
| data.lastBuff | string | 下一页分页参数 |
| data.list | array | 消息列表 |
| data.list[].mentionId | number | 消息 ID |
| data.list[].svrMentionId | number | 服务端消息 ID |
| data.list[].mentionType | int | 消息类型 |
| data.list[].nickname | string | 触发用户昵称 |
| data.list[].username | string | 触发用户微信 ID |
| data.list[].headUrl | string | 头像地址 |
| data.list[].description | string | 消息描述 |
| data.list[].mentionContent | string | 消息内容 |
| data.list[].refObjectId | number | 关联作品 ID |
| data.list[].refObjectNonceId | string | 关联作品 nonceId |
| data.list[].refCommentId | number | 关联评论 ID |
| data.list[].thumbUrl | string | 作品封面 |
| data.list[].createtime | number | 消息时间,Unix 秒级时间戳 |
| data.list[].likeInfo | object | 点赞信息 |
| data.list[].contact | object | 触发用户信息 |
| data.list[].authorContact | object | 作者信息 |