VI | EN
Message us on Messenger
Developer resources

Get the MMM data request history — TikTok Business API

Get the MMM data request history · 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.

Get the MMM data request history

GET/mmm/api/history/Via 360: GET https://partner.quantri360.com/v1/tiktok_business/mmm/api/history/
Description

Use this endpoint to retrieve the details of historical Media Mix Modeling (MMM) data requests.

Request

Endpoint

GET https://partner.quantri360.com/v1/tiktok_business/mmm/api/history/

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
from_datequerystringYesStart date, in the format of YYYY-MM-DD (UTC+0 time). The start date cannot be earlier than four years ago.
end_datequerystringYesEnd date, in the format of YYYY-MM-DD (UTC+0 time).

Request examples

curl -s "https://partner.quantri360.com/v1/tiktok_business/mmm/api/history/?from_date=&end_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/mmm/api/history/",
    params={
        "from_date": "",
        "end_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/mmm/api/history/');
for (const [k, v] of Object.entries({"from_date":"","end_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/mmm/api/history/' . '?' . http_build_query(['from_date' => '', 'end_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)

NameTypeSampleDescription
codenumberResponse code. For the complete list of response codes and descriptions, see Appendix-Return Code.
messagestringResponse message. For details, see Appendix - Return Codes.
request_idstringThe log ID of a request, which uniquely identifies the request.
dataobjectReturned data.
historical_requestsstring[]A JSON-formatted string array that displays historical requests, providing details for each request. For the fields `media_type` and `Status`, you might need to convert the returned integer values to string values in other MMM endpoints based on the following mapping: - Supported values for `media_type`: - `0`: corresponds to `All`. - `1`: corresponds to `Earned`. - `2`: corresponds to `Paid`. - Supported values for `Status`: - `1`: corresponds to `request received`. - `3`: corresponds to `in progress`. - `5`: corresponds to `completed - ready for download`. - `2`: corresponds to `failed`. - `4`: corresponds to `failed`.

Response sample

HTTPS/1.1 200 OK
{
    "code": 0,
    "message": "OK",
    "request_id": "{{request_id}}",
    "data": {
        "historical_requests": [
            "{\"RequestID\":\"{{RequestID}}\",\"CreateTime\":\"2024-11-07T22:03:39Z\",\"Message\":\"{\\\"targets\\\":[{\\\"advertiser_id\\\":\\\"{{advertiser_id}}\\\"}],\\\"from_date\\\":\\\"20240729\\\",\\\"to_date\\\":\\\"20240829\\\",\\\"media_type\\\":2}\",\"Status\":5}",
            "{\"RequestID\":\"{{RequestID}}\",\"CreateTime\":\"2024-11-19T19:54:58Z\",\"Message\":\"{\\\"targets\\\":[{\\\"advertiser_id\\\":\\\"{{advertiser_id}}\\\"}],\\\"from_date\\\":\\\"20241104\\\",\\\"to_date\\\":\\\"20241108\\\",\\\"country_code\\\":[\\\"JP\\\"],\\\"media_type\\\":2}\",\"Status\":1}"
        ]
    }
}

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