取消订阅
您可以使用本接口取消订阅。
v1.2与v1.3版本对比
以下表格概括了 v1.2与v1.3接口的变化。
``xtable
|变化内容{30%}|v1.2{35%}|v1.3{35%}|
|---|---|---|
|接口路径|/v1.2/subscription/unsubscribe/|/v1.3/subscription/unsubscribe/|
|请求参数类型|app_id: number<br>subscription_id:number|app_id: string<br>subscription_id:string|
|返回参数类型|subscription_id:number|subscription_id`:string|
## 请求
**地址**
https://business-api.tiktok.com/open_api/v1.3/subscription/unsubscribe/
**方法** POST
**Header**
```xtable
|字段|类型|描述|
|---|---|---|
|Content-Type {必填}|string|请求消息类型。<br>允许值: `"application/json"`。 |
参数
|字段|类型|描述|
|---|---|---|
|app_id {必填}|string| 开发者应用ID。您可以导航至<strong>[应用管理](https://ads.tiktok.com/marketing_api/apps/)</strong> > <strong>App Detail</strong> > <strong>基本信息</strong>,获取<strong>应用ID</strong>。|
|secret {必填}|string| 开发者应用密钥。您可以导航至<strong>[应用管理](https://ads.tiktok.com/marketing_api/apps/)</strong> > <strong>App Detail</strong> > <strong>基本信息</strong>,获取<strong>密钥</strong>。|
|subscription_id {必填}|string| 订阅ID。<br>您可通过[/subscription/get/](https://ads.tiktok.com/marketing_api/docs?id=1739093832125442)返回的`subscription_id`获取单个App下所有订阅的ID。 |
示例
(code curl http)
curl -H "Access-Token:xxx" -H "Content-Type:application/json" -X POST \
-d '{
"secret": "SECRET",
"app_id": "APP_ID",
"subscription_id": "SUBSCRIPTION_ID"
}' \
https://business-api.tiktok.com/open_api/v1.3/subscription/unsubscribe/
(/code)
返回
|字段|类型|描述|
|---|---|---|
|code |number|返回码。完整返回码列表及描述,可查看[附录-返回码](https://ads.tiktok.com/marketing_api/docs?id=1737172488964097)。 |
|message |string|返回信息。更多信息可查看[附录-返回码](https://ads.tiktok.com/marketing_api/docs?id=1737172488964097)。 |
|data |object|返回数据。 |
#|subscription_id |string| 订阅 ID。 |
|request_id |string|请求的日志ID,唯一标识一个请求。 |
示例
(code Success-Response http)
HTTPS/1.1 200 OK
{
"message": "OK",
"code": 0,
"data": {
"subscription_id": 6934682745658408966
},
"request_id": "2021030113504601023101600705098212"
}
(/code);