This endpoint allows you to work with caption files

Collection /caption

To work with captions that have been uploaded to the platform

GET /caption/:id.{output_format}

Get the contents of an uploaded caption file in a specific format. Very useful for transcoding services and screen readers

  • id - string: the caption id
  • format - DEFAULT json. get the captions in json format (json|vtt|txt|xml)

item value
Access user
Full url https://api.buto.tv/v2/caption/{id}.{format}
verb GET
params string:id

POST /caption

Create captions for a video from a captions file.

item | value
-|-
Access | Client Key, System Key
Full url | https://api.buto.tv/v2/caption/
verb | POST
params | string:title string:language string:media_id string:url


Example Usage

JSON Request Body
{
    "title": "English Captions",
    "language": "en-GB",
    "media_id": "NFSdb",
    "url": "https://s3.amazonaws.com/my-bucket/captions.srt"
}

  • language - ISO Language code
  • media_id - ID of media from the organisation of the authenticated user to
    associate captions with
  • url - Publicly accessible URL to a captions file of one of the following
    supported formats:
    • .srt
    • .sbv
    • .sub
    • .vtt
Request
api_key=<your api key>
curl -X POST -u ${api_key}:x \
  --include https://api.buto.tv/v2/caption \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "English Captions",
    "language": "en-GB",
    "media_id": "NFSdb",
    "url": "https://s3.amazonaws.com/my-bucket/captions.srt"
    }'
Response
HTTP/1.1 200 OK
...
Content-Type: application/json

[
    {
        "caption_id": "cnBsjmq",
        "organisation_id": "Bt5xk",
        "created_by_user_id": "w2JSW",
        "group_id": "0",
        "title": "English Captions",
        "language": "en-GB",
        "media_id": "NFSdb",
        "time_created": "2014-02-21 13:59:38",
        "time_last_modified": "2014-02-21 13:59:38",
        "last_modified_by_user_id": "w2JSW",
        "caption_line_id": "clYlNcb",
        "part_of_caption_id": "cnBsjmq",
        "time_code_begin": "00:04",
        "time_code_end": "00:06",
        "caption_text": "This is Brian"
    },
    ...
]

PUT /caption/:caption_id

Update an existing caption:
* Replace captions file
* Change title, language and media_id fields

item | value
-|-
Access | Client Key, System Key
Full url | https://api.buto.tv/v2/caption/:caption_id
verb | PUT
params | string:title string:language string:media_id string:url


Example Usage

Given the example caption created in the POST section.

JSON Request Body
{
    "title": "New English Captions",
    "language": "en-GB",
    "media_id": "NFSdb",
    "url": "https://s3.amazonaws.com/my-bucket/captions-new.srt"
}

  • language - ISO Language code
  • media_id - ID of media from the organisation of the authenticated user to
    associate captions with
  • url - Publicly accessible URL to a captions file of one of the following
    supported formats:
    • .srt
    • .sbv
    • .sub
    • .vtt
Request
api_key=<your api key>
caption_id=cnBsjmq
curl -X PUT -u ${api_key}:x \
  --include https://api.buto.tv/v2/caption/${caption_id} \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "New English Captions",
    "language": "en-GB",
    "media_id": "NFSdb",
    "url": "https://s3.amazonaws.com/my-bucket/captions-new.srt"
    }'
JSON Response
HTTP/1.1 200 OK
...
Content-Type: application/json

[
    {
        "caption_id": "cnBsjmq",
        "organisation_id": "Bt5xk",
        "created_by_user_id": "w2JSW",
        "group_id": "0",
        "title": "New English Captions",
        "language": "en-GB",
        "media_id": "NFSdb",
        "time_created": "2014-02-21 14:30:38",
        "time_last_modified": "2014-02-21 14:30:38",
        "last_modified_by_user_id": "w2JSW",
        "caption_line_id": "clXyjJM",
        "part_of_caption_id": "cnBsjmq",
        "time_code_begin": "00:02",
        "time_code_end": "00:18",
        "caption_text": "This is Brian and i've changed what I said"
    },
    ...
]

DELETE /caption/:caption_id

Delete an existing caption:

item | value
-|-
Access | Client Key, System Key
Full url | https://api.buto.tv/v2/caption/:caption_id
verb | DELETE
params |


Example Usage

Given the example caption created in the POST section.

Request
api_key=<your api key>
caption_id=cnBsjmq
curl -X DELETE -u ${api_key}:x \
  --include https://api.buto.tv/v2/caption/${caption_id}
JSON Response
HTTP/1.1 202 Accepted
...
Content-Type: application/json

{

    "status": "Accepted",
    "message": {
        "caption_id": "cnBsjmq",
        "deleted": true
    }
}