Table of contents

Captions API

The Captions API allows users to view, add, or delete caption files from an item. This is useful for managing multiple caption files for a single item.

Get all captions for an item

GET /api/data/items/{item_id}?only=captions.captions

Response

{
    "_id": "35f96d382189f166f71e685d321ad8ba",
    "captions": {
        "captions": [
            {
                "id": "5b20557199bf28c679bbecbf1f94a2e0",
                "language": {},
                "source": "captions",
                "transcript": [
                    {
                        "end_at": 3.269,
                        "start_at": 1.7349999999999999,
                        "text": "Mom,"
                    },
                    {
                        "end_at": 4.204,
                        "start_at": 3.304,
                        "text": "I may not have the words"
                    },
                    {
                        "end_at": 5.672,
                        "start_at": 4.2379999999999995,
                        "text": "to thank you for everything"
                    },
                    {
                        "end_at": 8.641,
                        "start_at": 5.7059999999999995,
                        "text": "you've done for me -"
                    },
                    {
                        "end_at": 10.943999999999999,
                        "start_at": 8.676,
                        "text": "the sacrifices you've made,"
                    },
                    {
                        "end_at": 13.947,
                        "start_at": 10.978,
                        "text": "the love and care you've given..."
                    },
                    {
                        "end_at": 15.482,
                        "start_at": 13.981,
                        "text": "But no matter what,"
                    },
                    {
                        "end_at": 17.884,
                        "start_at": 15.516,
                        "text": "you'll always have my respect,"
                    },
                    {
                        "end_at": 20.787,
                        "start_at": 17.918,
                        "text": "my gratitude"
                    },
                    {
                        "end_at": 23.423,
                        "start_at": 20.821,
                        "text": "and most especially,"
                    },
                    {
                        "end_at": 25.558,
                        "start_at": 23.457,
                        "text": "my love."
                    },
                    {
                        "end_at": 28.962,
                        "start_at": 25.593,
                        "text": "Happy Mother's day."
                    }
                ]
            }
        ]
    },
    "container_id": "3c8371eb1401ae71f24301cbb9935b73",
    "location_id": "5ab2bc3e874fc40c5ec1e26219b5766f"
}

Download a caption file

GET /api/data/items/{item_id}/captions/download?caption_id={caption_id}

Add a caption file

POST  /api/data/items/{item_id}/captions
form-data: (key="caption_file" file="caption.SRT")

Delete a caption file

DELETE /api/data/items/{item_id}/captions?caption_id={caption_id}

This documentation is generated from the latest version of GrayMeta Platform. For documentation relevant to your own deployed version, please use the documentation inside the application.