Upload Mini Drama Subtitles
Uploads a subtitle file from a public URL to your BytePlus space and optionally links it to a video. Upload a separate file for each language. Mini Drama Player displays linked subtitles when you enable automatic subtitles.
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
Field | Type | Description | Required | Example |
|
| The client key of your mini app. | Yes |
|
|
| The download URL of the subtitle file. The URL must be a publicly accessible HTTP or HTTPS link. TikTok reads the format from the file extension, which must be | Yes |
|
|
| The file name of the subtitle. | Yes |
|
|
| The language of the subtitle. | Yes |
|
|
| The name of the BytePlus space to upload the subtitle to. | Yes |
|
|
| The ID of the BytePlus account to upload the subtitle to. | Yes |
|
|
| The ID of the video to link the subtitle to. | No |
|
Request example
curl --location 'https://open.tiktokapis.com/v2/sg/shortdrama/subtitle/' \
--header 'Authorization: Bearer CLIENT_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"client_key": "CLIENT_KEY",
"subtitle_url": "https://example.com/subtitles/episode-01.srt",
"title": "episode-01.srt",
"language": "eng-US",
"space_name": "SPACE_NAME",
"byteplus_account_id": "BYTEPLUS_ACCOUNT_ID",
"vid": "VID"
}'Replace the following:
CLIENT_ACCESS_TOKEN: your mini app's client access token.CLIENT_KEY: your mini app's client key.SPACE_NAME: the name of your BytePlus space.BYTEPLUS_ACCOUNT_ID: the ID of the BytePlus account bound to your mini app.VID: the ID of the video to link the subtitle to.
Response
Response body
Field | Type | Description |
| The uploaded subtitle. | |
| The error object. |
SubtitleUploadData
Field | Type | Description | Example |
|
| The ID of the subtitle file. |
|
|
| The BytePlus material ID of the subtitle. |
|
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": {
"file_id": "file_0000example",
"mid": "example0000000000000"
},
"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 |
| A field is missing or invalid. For example, | Correct the field named in the message. Use an accessible URL with an |
| The video wasn't found. | Verify the |
| The BytePlus account, space, or video doesn't match. | Confirm that |
| TikTok couldn't download the subtitle file. | Confirm that the URL is publicly accessible and the file is valid, then retry. |