Query contracts
GET/rf/contract/query/Via 360: GET https://partner.quantri360.com/v1/tiktok_business/rf/contract/query/
Description
Use this endpoint to query contracts. Since commercial contracts are time-sensitive, you will need to specify a date to check the start and end date of valid contracts that cover that date.
Request
Endpoint
GET https://partner.quantri360.com/v1/tiktok_business/rf/contract/query/
Authentication & shop
| Name | In | Type | Sample | Description |
|---|---|---|---|---|
| Authorization | header | header | Bearer q360_live_ab12cd34_… | Khóa API của brand (tạo ở mục API key). Bắt buộc với mọi request. Brand suy từ key — không truyền mã brand. |
| platform_shop_id | query | string | 7000000000000000001 | Tài sản TikTok Business đã kết nối — "Mã tài sản" ở trang Nền tảng hoặc GET /v1/platforms (tài khoản quảng cáo cho Marketing API, tài khoản TikTok cho Organic / Messaging). Có thể bỏ khi chỉ kết nối một tài sản. |
Request parameters
| Name | In | Type | Required | Sample | Description |
|---|---|---|---|---|---|
| included_date | query | string | Yes | A certain date within the contract validity, or the start/end time of an ad group. Format: "2020-09-18". | |
| rf_campaign_type | query | string | No | Use this field to specify whether you want to query TikTok Pulse contract. Enum values: STANDARD (Reach & Frequency), PULSE(TikTok Pulse).
Note: This is an allowlist-only feature. If you would like to access it, please contact your TikTok representative. |
Request examples
curl -s "https://partner.quantri360.com/v1/tiktok_business/rf/contract/query/?included_date=" \ -H "Authorization: Bearer $KEY"
Python
import requests
KEY = "q360_live_..." # khóa API của brand
r = requests.get(
"https://partner.quantri360.com/v1/tiktok_business/rf/contract/query/",
params={
"included_date": ""
},
headers={"Authorization": f"Bearer {KEY}"},
timeout=60,
)
print(r.status_code)
print(r.json())Node.js
const KEY = 'q360_live_...'; // khóa API của brand
const url = new URL('https://partner.quantri360.com/v1/tiktok_business/rf/contract/query/');
for (const [k, v] of Object.entries({"included_date":""})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
method: 'GET',
headers: { Authorization: `Bearer ${KEY}` },
});
console.log(r.status, await r.json());PHP
<?php $key = 'q360_live_...'; // khóa API của brand $url = 'https://partner.quantri360.com/v1/tiktok_business/rf/contract/query/' . '?' . http_build_query(['included_date' => '']); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key]); $res = curl_exec($ch); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo $status, "\n", $res;
Response
Response fields (as returned by TikTok Business)
| Name | Type | Sample | Description |
|---|---|---|---|
| code | number | Return code. For the complete list of response codes and descriptions, see Appendix - Return Codes | |
| message | string | Return messages. For details, see Appendix - Return Codes | |
| request_id | string | The log ID of a request, which uniquely identifies the request. | |
| data | object | Returned data. | |
| has_valid_contract | boolean | Whether valid contracts can be found. Enum values: `True`, `False`. - The correct contract start date and end date will be returned only when `has_valid_contract` = `True`, which means the specified `included_date` falls within the validity period of the Reach and Frequency contract or TikTok Pulse contract. - If `rf_campaign_type` is not set as `PULSE` in the request, `has_valid_contract` is `True`when the specified `included_date` is a date within the Reach and Frequency contract validity period ( `[start_date, end_date]`). - If `rf_campaign_type` is set as `PULSE` in the request, `has_valid_contract` is `True`when the specified `included_date` is a date within the TikTok Pulse contract validity period ( `[pulse_start_date, pulse_end_date]`). | |
| pulse_start_date | string | Start date of TikTok Pulse contract. Returned when `rf_campaign_type` is set to `PULSE` in your request. Note: When you use /campaign/create/ to create an R&F campaign and set `rf_campaign_type` to `PULSE`, the schedule delivery time of your ad group (`[schedule_start_time, schedule_end_time]`) must fall on the intersection of `[start_date, end_date]` and `[pulse_start_date, pulse_end_date]` returned in this contract endpoint. | |
| pulse_end_date | string | End date of TikTok Pulse contract. Returned when `rf_campaign_type` is set to `PULSE` in your request. Note: When you use /campaign/create/ to create an R&F campaign and set `rf_campaign_type` to `PULSE`, the schedule delivery time of your ad group (`[schedule_start_time, schedule_end_time]`) must fall on the intersection of `[start_date, end_date]` and `[pulse_start_date, pulse_end_date]` returned in this contract endpoint. | |
| start_date | string | Start date of Reach and Frequency contract. | |
| end_date | string | End date of Reach and Frequency contract. |
Response sample
HTTPS/1.1 200 OK
{
"message": "OK",
"code": 0, "data":
{
"has_valid_contract": true,
"start_date": "2020-10-01",
"end_date": "2020-11-30"
},
"request_id": "1E044AD4"}
(/code);
Get started
- Sign up for Partner
- Enable a data type of the Ads (Marketing API) group on the platform page
- Create an API key (tick the TikTok Business channel)
- Call it as in the examples above