最近更新时间: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=UnfollowAction&Version=2021-01-01
请求header
ServiceName:content
参数 | 描述 | 类型 | 是否必填 | 说明 |
---|---|---|---|---|
Partner | 渠道号 | String | 是 | |
AccessToken | 用户唯一标识 | String | 是 | |
ToUserId | 作者id | String | 是 | 被取消关注的作者唯一标识 |
source | 取消关注的来源 | int64 | 否 | |
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 UnfollowActionRequest req = new UnfollowActionRequest(); req.setTimestamp(LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8"))); req.setAccessToken("accessToken"); req.setPartner("partner"); req.setToUserId("xxxxxx"); try { UnfollowActionResponse response = streamConsumerService.unfollowAction(req); System.out.println(JSON.toJSONString(response)); } catch (Exception e) { e.printStackTrace(); } }
{ "ResponseMetadata":{ "Action":"UnfollowAction", "Region":"cn-north-1", "RequestId":"202210282002550102112001971D0BA551", "Service":"content", "Version":"2021-01-01" }, "Result":"success" }