VI | EN
Message us on Messenger
Developer resources

Report App, Web, Offline, or CRM Events — TikTok Business API

Report App, Web, Offline, or CRM Events · call it through Quantri360 with one API key for your own accounts / assets that you connected and authorized — 360 handles request signing and refreshing the authorization you granted.

Report App, Web, Offline, or CRM Events

POST/event/track/Via 360: POST https://partner.quantri360.com/v1/tiktok_business/event/track/
Write endpoint — changes data on TikTok Business. The key must be created with "Allow write API calls" ticked, otherwise you get 403 write_not_allowed. Every call is logged.
Description

Use this endpoint to report a single App, Web, Offline, or CRM (Customer relationship management) event, or multiple App, Web, Offline, or CRM events in batch.

Request

Endpoint

POST https://partner.quantri360.com/v1/tiktok_business/event/track/

Authentication & shop

NameInTypeSampleDescription
AuthorizationheaderheaderBearer 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_idquerystring7000000000000000001Tà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

NameInTypeRequiredSampleDescription
event_sourcebodystringYesThis field is used to specify the type of events you are uploading through Events API. Enum values: - web: The events took place on your website and are measured by a Pixel Code. - To generate sample code in cURL, Python, or Node.js format for reporting Web Events via the Events API 2.0, use the Payload Helper for Web. - app: The events took place on your app and are measured by a TikTok App ID. - offline : The conversions took place in a physical store and are measured by an Offline Event Set ID. - crm: The lead events took place in a CRM system and are measured by a CRM Event Set ID. Note: Reporting App Events using Events API 2.0 is currently an allowlist-only feature. If you would like to access it, please contact your TikTok representative.
event_source_idbodystringYesAn Event Source ID that is used to measure events. - When event_source is set to web, specify a Pixel Code through this field. To obtain a Pixel Code, refer to FAQs - Where can I find the Pixel Code. - When event_source is set to offline, specify an Offline Event Set ID through this field. To obtain an Offline Event Set ID, refer to Setup Guide for Offline. - When event_source is set to app, specify a TikTok App ID through this field. To obtain a TikTok App ID, refer to Setup Guide for App. - When event_source is set to crm, specify a CRM Event Set ID through this field. To obtain a CRM Event Set ID, use /crm/list/.
databodyobject[]YesAn object array of the events you want to report. - If you are sending a single event, pass one object in the array. - If you are batching multiple events in a single payload, you can report up to 1,000 events in one request. If a request contains more than 1,000 events, the entire request will be rejected. - To optimize campaign performance, it's highly recommended to send the event in real-time (without batching) as soon as it is seen on the advertiser's server.

Request examples

curl -s -X POST "https://partner.quantri360.com/v1/tiktok_business/event/track/" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"event_source":"","event_source_id":"","data":[{"event":"","event_time":0}]}'
Python
import requests

KEY = "q360_live_..."  # khóa API của brand
r = requests.post(
    "https://partner.quantri360.com/v1/tiktok_business/event/track/",
    params={},
    json={
        "event_source": "",
        "event_source_id": "",
        "data": [
            {
                "event": "",
                "event_time": 0
            }
        ]
    },
    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/event/track/');
for (const [k, v] of Object.entries({})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
  method: 'POST',
  headers: { Authorization: `Bearer ${KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({"event_source":"","event_source_id":"","data":[{"event":"","event_time":0}]}),
});
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/event/track/' . '?' . http_build_query([]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key, 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"event_source":"","event_source_id":"","data":[{"event":"","event_time":0}]}');
$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)

NameTypeSampleDescription
codenumberResponse code. For the complete list of response codes and descriptions, see Appendix - Return Codes.
messagestringResponse message. For details, see Appendix - Return Codes.
request_idstringThe log ID of the request, which uniquely identifies a request.
dataobjectReturned data.

Response sample

HTTPS/1.1 200 OK
{
  "code": 0, 
  "message": "OK", 
  "request_id": "{{request_id}}", 
  "data": {}
}

Get started

  1. Sign up for Partner
  2. Enable a data type of the Ads (Marketing API) group on the platform page
  3. Create an API key (tick the TikTok Business channel)
  4. Call it as in the examples above