Create a Mini Drama CDN Preload Task
Creates a task that warms up the CDN with up to 100 video resources before viewers request them. Prewarm before a large-scale launch to reduce buffering on first playback. To check progress, call Query a Mini Drama CDN Preload Task.
Endpoint
HTTP URL |
|
HTTP method |
|
Scopes |
|
Content type |
|
Request
Headers
Field | Type | Description | Required | Example |
|
| The client access token of your mini app, prefixed with | Yes |
|
|
| The media type of the request body. | Yes |
|
Request body
Unlike other Media Asset API endpoints, this endpoint uses PascalCase field names, except client_key.
Field | Type | Description | Required | Example |
|
| The client key of your mini app. | Yes |
|
|
| The ID of the BytePlus account, as a non-empty decimal string. | Yes |
|
|
| The name of the BytePlus space. | Yes |
|
| The resources to preload. Maximum: | Yes | See ResourceItem. |
ResourceItem
Field | Type | Description | Required | Example |
|
| The ID of the video. | Yes |
|
|
| The storage URIs to preload. Use the | Yes |
|
Request example
curl --location --request POST 'https://open.tiktokapis.com/v2/sg/shortdrama/cdn/preload/tasks/' \
--header 'Authorization: Bearer CLIENT_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"client_key": "CLIENT_KEY",
"AccountID": "BYTEPLUS_ACCOUNT_ID",
"SpaceName": "SPACE_NAME",
"Resources": [
{
"Vid": "v0d000example0000000000000000001",
"StoreUris": ["example0000.mp4", "example0000transcode720p"]
}
]
}'Replace the following:
CLIENT_ACCESS_TOKEN: your mini app's client access token.CLIENT_KEY: your mini app's client key.BYTEPLUS_ACCOUNT_ID: the ID of the BytePlus account bound to your mini app.SPACE_NAME: the name of your BytePlus space.
Response
Response body
Field | Type | Description |
| The business data. | |
| The error object. |
PreloadCreateData
Field | Type | Description |
| The response metadata. | |
| The new task. Returned only on success. |
ResponseMetadata
Field | Type | Description | Example |
|
| The ID of the downstream request. |
|
|
| The downstream error, with | N/A |
PreloadCreateResult
Field | Type | Description | Example |
|
| The ID of the preload task. |
|
ErrorStruct
Field | Type | Description |
|
| The error code. Omitted on success. |
|
| A human-readable description of the error. |
|
| The unique identifier for the request. Include this value when contacting support. |
Response example
{
"data": {
"ResponseMetadata": {
"RequestId": "202508010000000000000000000000000"
},
"Result": {
"TaskID": "31c6a06d-e686-42ef-9887-e4b7c39df3fa"
}
},
"error": {
"log_id": "202508010000000000000000000000000"
}
}Error codes
Error code | Description | Resolution |
| The service is temporarily unavailable. | Retry later. If the error persists, contact support with the |
| The request is invalid. | Check the required fields. |
| The BytePlus account is unavailable for CDN preload. | Check the domain binding for your client key, the BytePlus account connection, and the account authorization. |
| BytePlus rejected the request. | Check the resources, domains, and BytePlus configuration, then retry. If the error persists, contact support with the |