最近更新时间: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=FollowAction&Version=2021-01-01
请求header
ServiceName:content
参数 | 描述 | 类型 | 是否必填 | 说明 |
---|---|---|---|---|
Partner | 渠道号 | String | 是 | |
AccessToken | 用户唯一标识 | String | 是 | |
ToUserId | 作者id | String | 是 | 被关注作者的唯一标识 |
Source | 关注来源 | int | 否 | 41:列表页 |
FromGid | 从哪条内容上点击的关注 | String | 否 |
参数 | 描述 | 类型 | 说明 |
---|---|---|---|
Result | 返回结果 | String | success:成功 |
public static void main(String[] args) { //初始化一个service StreamConsumerService streamConsumerService = StreamConsumerServiceImpl.getInstance(); //设置ak,sk 此为请求的凭证 streamConsumerService.setAccessKey("ak"); streamConsumerService.setSecretKey("sk"); //初始化一个request FollowActionRequest req = new FollowActionRequest(); req.setTimestamp(LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8"))); req.setAccessToken("accessToken"); req.setPartner("partner"); req.setToUserId("xxxxx"); try { FollowActionResponse response = streamConsumerService.followAction(req); System.out.println(JSON.toJSONString(response)); } catch (Exception e) { e.printStackTrace(); } }
{ "ResponseMetadata":{ "Action":"FollowAction", "Region":"cn-north-1", "RequestId":"202210281739180101510832240F00D034", "Service":"content", "Version":"2021-01-01" }, "Result":"success" }