Skip to content

关注 ​

关注或取消关注一个视频号用户。

接口地址: POST /finderFollow

说明与注意 ​

  • userName 来自搜索、主页类接口的返回。
  • meUserName、meRoleType 从获取个人主页的返回里取。

请求参数 ​

参数名必选类型说明
wId是string登录实例标识
userName是string目标视频号用户编码
meUserName是string自己的视频号用户编码
meRoleType是int自己的视频号角色类型
type是int操作类型:1 关注,2 取消关注

请求示例 ​

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

{
  "wId": "{{wId}}",
  "meUserName": "v2_060000231003b20faec8cae18a1ec5d0cb07eab077ba915250774edbea38082ea6b24af229@finder",
  "userName": "v2_060000231003b20faec8c6e78010c3d4c605eb3cb077f16e37c172145877400390b1170a0299@finder",
  "meRoleType": 3,
  "type": 1
}
bash
curl -X POST '{BASE_URL}/finderFollow' \
  -H 'Authorization: Bearer <你的调用凭证>' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "wId": "{{wId}}",
  "meUserName": "v2_060000231003b20faec8cae18a1ec5d0cb07eab077ba915250774edbea38082ea6b24af229@finder",
  "userName": "v2_060000231003b20faec8c6e78010c3d4c605eb3cb077f16e37c172145877400390b1170a0299@finder",
  "meRoleType": 3,
  "type": 1
}'
python
import requests

url = "{BASE_URL}/finderFollow"
headers = {"Authorization": "Bearer <你的调用凭证>", "Content-Type": "application/json"}
body = """{
  "wId": "{{wId}}",
  "meUserName": "v2_060000231003b20faec8cae18a1ec5d0cb07eab077ba915250774edbea38082ea6b24af229@finder",
  "userName": "v2_060000231003b20faec8c6e78010c3d4c605eb3cb077f16e37c172145877400390b1170a0299@finder",
  "meRoleType": 3,
  "type": 1
}"""

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}/finderFollow";
String body = "{\n" +
    "  \"wId\": \"{{wId}}\",\n" +
    "  \"meUserName\": \"v2_060000231003b20faec8cae18a1ec5d0cb07eab077ba915250774edbea38082ea6b24af229@finder\",\n" +
    "  \"userName\": \"v2_060000231003b20faec8c6e78010c3d4c605eb3cb077f16e37c172145877400390b1170a0299@finder\",\n" +
    "  \"meRoleType\": 3,\n" +
    "  \"type\": 1\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}/finderFollow';
$body = <<<'JSON'
{
  "wId": "{{wId}}",
  "meUserName": "v2_060000231003b20faec8cae18a1ec5d0cb07eab077ba915250774edbea38082ea6b24af229@finder",
  "userName": "v2_060000231003b20faec8c6e78010c3d4c605eb3cb077f16e37c172145877400390b1170a0299@finder",
  "meRoleType": 3,
  "type": 1
}
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": {
    "userName": "v2_060000231003b20faec8c6e78010c3d4c605eb3cb077f16e37c172145877400390b1170a0299@finder",
    "nickName": "中国日报",
    "headUrl": "https://wx.qlogo.cn/finderhead/ver_1/example/0",
    "signature": "",
    "authInfo": {
      "authIconType": 2,
      "authProfession": "中国日报社",
      "detailLink": "pages/index/index.html?showdetail=true&username=v2_060000231003b20faec8c6e78010c3d4c605eb3cb077f16e37c172145877400390b1170a0299@finder",
      "appName": "gh_4ee148a6ecaa@app"
    },
    "extInfo": {
      "country": "CN",
      "province": "",
      "city": "",
      "sex": null
    },
    "userMode": null,
    "bindInfo": "CAESwwIKwAIKD2doXzM3MDdkOTU0MWMzZhIM..."
  }
}

错误响应 ​

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

响应参数 ​

参数名类型说明
codestring1000 成功;其他值都是失败,通常是 1001
messagestring反馈信息
dataobject目标视频号用户信息
data.userNamestring目标视频号用户编码
data.nickNamestring昵称
data.headUrlstring头像地址
data.signaturestring个性签名
data.authInfoobject认证信息
data.extInfoobject扩展资料
data.userModeint用户模式,可能为 null
data.bindInfostring绑定信息,按原样保存