Media Asset API Overview
Use the Media Asset API to upload mini drama videos, images, and subtitles to your BytePlus account, manage mini drama versions, submit them for review, and publish them for playback in Mini Drama Player. Every endpoint is a server-to-server call authenticated with your mini app's client access token.
Prerequisites
- You have a mini app with the Mini Dramas industry qualification approved.
- You have connected a BytePlus account to your mini app on the Developer Portal.
Authentication
Every request must include a client access token in the Authorization header. To get one, call the client access token endpoint with your mini app's client key and client secret, which you can find in the Credentials section of your app page. The token is valid for 2 hours.
curl --location 'https://open.tiktokapis.com/v2/oauth/token/' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cache-Control: no-cache' \
--data-urlencode 'client_key=CLIENT_KEY' \
--data-urlencode 'client_secret=CLIENT_SECRET' \
--data-urlencode 'grant_type=client_credentials'Replace the following:
CLIENT_KEY: the client key from your app's Credentials section.CLIENT_SECRET: the client secret from your app's Credentials section.
Then pass the token in each request:
--header 'Authorization: Bearer CLIENT_ACCESS_TOKEN'Response structure
Every response contains a data object with the endpoint's business data and an error object. A successful response can return error with only log_id. A failed response returns error.code and error.message, and data can be empty or omitted.
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. |
Mini drama lifecycle
Mini drama content moves through the following stages. Each stage maps to one or more endpoints:
- Upload media. Upload cover images, episode videos, and subtitles to your BytePlus space.
- Create and edit. Create a mini drama, then add its metadata and episodes. Each edit creates a new version.
- Review. Submit a version for review. TikTok reviews it in 1–3 business days, or up to 5 business days during peak periods.
- Publish. Set an approved version as the online version, then list the mini drama. Only a listed online version can play.
Endpoints
The following table lists the Media Asset API endpoints by stage:
Stage | Endpoint | HTTP method |
Upload media |
| |
Upload media |
| |
Upload media |
| |
Upload media |
| |
Upload media |
| |
Create and edit |
| |
Create and edit |
| |
Create and edit |
| |
Create and edit |
| |
Create and edit |
| |
Review |
| |
Review |
| |
Review |
| |
Publish |
| |
Publish |
| |
Transcoding |
| |
Transcoding |
| |
Transcoding |
| |
CDN preload |
| |
CDN preload |
| |
Playback |
|
Transcoding
Transcoding produces multiple bitrates of each episode, which lets viewers choose a quality level and helps episodes start faster and play more smoothly while reducing your playback traffic costs.
If your videos are already transcoded on another platform, you can skip transcoding and import them as single-bitrate videos. To let viewers choose between bitrates, use the transcoding endpoints.