Query a Mini Drama Video
Retrieves the upload status and details of a mini drama video. After you upload a video, poll this endpoint with the job_id until upload_status is 2, then use the returned vid in an episode.
Endpoint
HTTP URL |
|
HTTP method |
|
Scopes |
|
Request
Headers
Field | Type | Description | Required | Example |
|
| The client access token of your mini app, prefixed with | Yes |
|
Query parameters
Field | Type | Description | Required | Example |
|
| The client key of your mini app. | Yes |
|
|
| The ID of the BytePlus account the video was uploaded to. | Yes |
|
|
| Required when | Conditional |
|
|
| Required when | Conditional |
|
Request example
curl --location --request GET 'https://open.tiktokapis.com/v2/sg/shortdrama/video?client_key=CLIENT_KEY&job_id=vod%3Ajob%3A1234567890&byteplus_account_id=BYTEPLUS_ACCOUNT_ID' \
--header 'Authorization: Bearer CLIENT_ACCESS_TOKEN'Replace the following:
CLIENT_KEY: your mini app's client key.BYTEPLUS_ACCOUNT_ID: the ID of the BytePlus account bound to your mini app.CLIENT_ACCESS_TOKEN: your mini app's client access token.
Response
Response body
Field | Type | Description |
| The video details. | |
| The error object. |
VideoInfo
Field | Type | Description | Example |
|
| The upload status. One of: |
|
|
| The BytePlus ID of the uploaded video. |
|
|
| The upload task ID. |
|
|
| The playback URL of the video. |
|
|
| The title of the video. |
|
|
| The duration of the video in milliseconds. |
|
|
| The URL of the video cover. |
|
|
| The raw BytePlus video information, as a JSON string. Use it for debugging. |
|
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": {
"upload_status": 2,
"vid": "v0d000example0000000000000000000",
"job_id": "vod:job:1234567890",
"byteplus_url": "https://example.com/play/episode-01.m3u8",
"title": "episode_01",
"duration_ms": 10079,
"cover_url": "https://example.com/cover/episode-01.jpg",
"raw_video_info_json": "{\"Vid\":\"v0d000example0000000000000000000\"}"
},
"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 query is invalid. | Provide |
| The uploaded resource isn't a valid video. | Upload a valid video and retry. |
| The video wasn't found. | Verify the |
| The BytePlus account doesn't match the video's account and space. | Use the account the video belongs to. |
| The BytePlus upload task failed. | Check the source media and submit a new upload. |