最近更新时间:2023.02.28 17:57:49
首次发布时间:2021.10.18 11:12:18
调用该接口,拉取用户关注的所有作者列表。
请求方法
GET/POST(Content-Type: application/x-www-form-urlencoded)
请求url
https://mercury.volcengineapi.com/?Action=FollowList&Version=2021-01-01
请求header
ServiceName:content
参数 | 描述 | 类型 | 是否必填 | 说明 |
---|---|---|---|---|
Partner | 渠道号 | String | 是 | |
AccessToken | 用户唯一标识 | String | 是 | |
Cursor | 索引 | int | 否 | 首次传0,翻页(LoadMore)的时候传上一次火山引擎返回的Cursor; |
Count | 指定返回的条数 | int | 否 | 用于指定返回多少条数据,默认20 |
参数 | 描述 | 类型 | 说明 |
---|---|---|---|
Result | 响应结果 | Result |
public static void main(String[] args) { //初始化一个service StreamConsumerService streamConsumerService = StreamConsumerServiceImpl.getInstance(); //设置ak,sk 此为请求的凭证 streamConsumerService.setAccessKey("ak"); streamConsumerService.setSecretKey("sk"); //初始化一个request FollowListRequest req = new FollowListRequest(); req.setTimestamp(LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8"))); req.setAccessToken("accessToken"); req.setPartner("partner"); req.setCursor(0); req.setCount(2); try { FollowListResponse response = streamConsumerService.followList(req); System.out.println(JSON.toJSONString(response)); } catch (Exception e) { e.printStackTrace(); } }
{ "ResponseMetadata":{ "Action":"FollowList", "Region":"cn-north-1", "RequestId":"20221028201423010208045153060C36DB", "Service":"content", "Version":"2021-01-01" }, "Result":{ "Cursor":2, "Data":[ { "Info":{ "AuthType":"3", "AvatarUrl":"url", "Description":"Description", "Follow":false, "FollowersCount":111, "HomePage":"HomePageUrl", "MediaId":0, "Name":"Name", "UserId":123123, "UserVerified":true, "VerifiedContent":"" }, "Relation":{ "FollowTime":123123, "FollowersCount":123123, "FollowingsCount":0, "IsFollowing":1, "UpdateArticleTime":0 } }, "Info":{ "AuthType":"3", "AvatarUrl":"url", "Description":"Description", "Follow":false, "FollowersCount":111, "HomePage":"HomePageUrl", "MediaId":0, "Name":"Name", "UserId":123123, "UserVerified":true, "VerifiedContent":"" }, "Relation":{ "FollowTime":123123, "FollowersCount":123123, "FollowingsCount":0, "IsFollowing":1, "UpdateArticleTime":0 } } ], "HasMore":true, "Total":6 } }