Get the message event sets for ad creation
GET/ctm/message_event_set/get/Via 360: GET https://partner.quantri360.com/v1/tiktok_business/ctm/message_event_set/get/
Description
Use this endpoint to obtain the message event sets that can be used to create TikTok Instant Messaging Ads.
Request
Endpoint
GET https://partner.quantri360.com/v1/tiktok_business/ctm/message_event_set/get/
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 |
|---|---|---|---|---|---|
| messaging_app_type | query | string | Yes | The type of instant messaging app.
Enum values:
- MESSENGER: Messenger.
- WHATSAPP: WhatsApp.
- ZALO: Zalo. | |
| messaging_app_account_id | query | string | Yes | The ID of the instant messaging app account.
- If messaging_app_type is MESSENGER, specify a Facebook Page ID. A valid Facebook Page ID contains numbers only.
- To find your Facebook Page ID, go to your Facebook Page and click About below your cover photo, then click Page transparency.
- If messaging_app_type is WHATSAPP, specify your WhatsApp phone number following the format: region calling code followed by phone number without any special symbols. For instance, if the region calling code is +1, and the phone number is (555) 555-1234, set this field to 15555551234.
- If messaging_app_type is ZALO, specify the Zalo Official Account ID. | |
| message_event_name | query | string | No | The name of the message event set to filter the results by. Exact match is supported. | |
| message_event_set_ids | query | string[] | No | The ID list of the message event sets to filter the results by. Max size: 10. |
Request examples
curl -s "https://partner.quantri360.com/v1/tiktok_business/ctm/message_event_set/get/?messaging_app_type=&messaging_app_account_id=" \ -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/ctm/message_event_set/get/",
params={
"messaging_app_type": "",
"messaging_app_account_id": ""
},
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/ctm/message_event_set/get/');
for (const [k, v] of Object.entries({"messaging_app_type":"","messaging_app_account_id":""})) 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/ctm/message_event_set/get/' . '?' . http_build_query(['messaging_app_type' => '', 'messaging_app_account_id' => '']); $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 | Response code. For the complete list of response codes and descriptions, see Appendix-Return Code. | |
| message | string | Response message. For details, see Appendix - Return Codes. | |
| request_id | string | The log ID of a request, which uniquely identifies the request. | |
| data | object | Returned data. | |
| message_event_set_list | object[] | The list of existing message event sets within the specified ad account. | |
| message_event_set_id | string | The ID of the message event set. | |
| message_event_name | string | The name of the message event set. | |
| create_time | string | The time when the message event set was created, in the format of `YYYY-MM-DD HH:MM:SS`. Example: `2024-01-01 00:00:01`. | |
| matched_event_set | object | The information about the only message event set that is associated with the instant messaging app account (`messaging_app_account_id`). | |
| message_event_set_id | string | The ID of the message event set. | |
| message_event_name | string | The name of the message event set. | |
| create_time | string | The time when the message event set was created, in the format of `YYYY-MM-DD HH:MM:SS`. Example: `2024-01-01 00:00:01`. |
Response sample
HTTPS/1.1 200 OK
{
"code": 0,
"message": "OK",
"request_id": "{{request_id}}",
"data": {
"message_event_set_list": [
{
"message_event_set_id": "{{message_event_set_id}}",
"create_time": "2024-04-18 14:25:28",
"message_event_name": "{{message_event_name}}"
},
{
"message_event_set_id": "{{message_event_set_id}}",
"create_time": "2024-10-25 09:42:04",
"message_event_name": "{{message_event_name}}"
}
],
"matched_event_set": {
"message_event_set_id": "{{message_event_set_id}}",
"create_time": "2024-10-25 09:42:04",
"message_event_name": "{{message_event_name}}"
}
}
}
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