AIOZ Stream API
Video caption

Video Caption


Add Video Caption in a Specific Language

This endpoint is used to add a caption in a specific language for a video.

POSThttps://api.aiozstream.network/api/videos/:video_id/captions/:lan

Parameters

video_id* The unique identifier of the video.
lan* The language of the video's caption in BCP 47 format (e.g. en, fr)

Headers

Authorization* Bearer your_access_token_here
stream-public-key* your_public_key_here
stream-secret-key* your_secret_key_here

Body

file* Caption file in .vtt format.

Response

201: Created
{
  "status": "success",
  "data": {
    "caption": {
      "id": "string",
      "video_id": "string",
      "url": "string",
      "language": "string",
      "is_default": true,
      "created_at": "2023-06-11T11:11:11.111111Z"
    }
  }
}
curl --location --request POST 'https://api.aiozstream.network/api/videos/video_id/captions/en' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'stream-public-key: your_public_key_here' \
--header 'stream-secret-key: your_secret_key_here' \
--form 'file=@"/path/to/your/caption.vtt"'

Get Video Captions List

This endpoint will list all captions for your video.

GEThttps://api.aiozstream.network/api/videos/:video_id/captions

Parameters

video_id* The unique identifier of the video.

Query

offset The number of records to skip before starting to return the results (default: 0).
limit The maximum number of records to return in a query (default: 25, max: 100).

Headers

Authorization* Bearer your_access_token_here
stream-public-key* your_public_key_here
stream-secret-key* your_secret_key_here

Response

200: OK
{
  "status": "success",
  "data": {
    "captions": [
      {
        "id": "string",
        "video_id": "string",
        "url": "string",
        "language": "string",
        "is_default": true,
        "created_at": "2023-06-11T11:11:11.111111Z"
      }
    ],
    "total": 1
  }
}
curl --location --request GET 'https://api.aiozstream.network/api/videos/video_id/captions?offset=0&limit=10' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'stream-public-key: your_public_key_here' \
--header 'stream-secret-key: your_secret_key_here'

Set Video's Default Caption

This endpoint will set your video's default caption.

PATCHhttps://api.aiozstream.network/api/videos/:video_id/captions/:lan

Parameters

video_id* The unique identifier of the video.
lan* The language code of the video's caption (e.g., en, fr).

Headers

Authorization* Bearer your_access_token_here
stream-public-key* your_public_key_here
stream-secret-key* your_secret_key_here

Body

is_default* Set to `true` to make this caption the default, `false` otherwise.

Response

200: OK
{
  "status": "success",
  "message": "Set default caption successfully."
}
curl --location --request PATCH 'https://api.aiozstream.network/api/videos/video_id/captions/en' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'stream-public-key: your_public_key_here' \
--header 'stream-secret-key: your_secret_key_here' \
--header 'Content-Type: application/json' \
--data '{
    "is_default": true
}'

Remove Video Caption

This endpoint will remove your video's caption for a specific language.

DELETEhttps://api.aiozstream.network/api/videos/:video_id/captions/:lan

Parameters

video_id* The unique identifier of the video.
lan* The language code of the video's caption to remove (e.g., en, fr).

Headers

Authorization* Bearer your_access_token_here
stream-public-key* your_public_key_here
stream-secret-key* your_secret_key_here

Response

200: OK
{
  "status": "success",
  "message": "Delete caption successfully."
}
curl --location --request DELETE 'https://api.aiozstream.network/api/videos/video_id/captions/en' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'stream-public-key: your_public_key_here' \
--header 'stream-secret-key: your_secret_key_here'