Captions API

Creating Captions

POST /api/v1/captions/

Parameters

Name Description
caption_text text of the SRT file
language the ISO-639-2 language code of the file
attachment_id Id of the Video these captions are for
options options for wistia player

Request

Headers

Accept: application/json
X-Api-Token: 39EaxTxEvPwh5Vpc72F9yAsp_synroby2w
X-Api-Email: user-642@example.com

Route

POST /api/v1/captions/

Body

{"caption_text":"1\n00:00:01,478 --\u003e 00:00:04,020\nVimeoSrtPlayer\n\n2\n00:00:05,045 --\u003e 00:00:09,545\nSupport font","language":"fre","attachment_id":70}

cURL

curl "http://localhost:3000/api/v1/captions/" -d '{"caption_text":"1\n00:00:01,478 --\u003e 00:00:04,020\nVimeoSrtPlayer\n\n2\n00:00:05,045 --\u003e 00:00:09,545\nSupport font","language":"fre","attachment_id":70}' -X POST \
	-H "Accept: application/json" \
	-H "X-Api-Token: 39EaxTxEvPwh5Vpc72F9yAsp_synroby2w" \
	-H "X-Api-Email: user-642@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

Content-Type: application/json; charset=utf-8
Content-Length: 271

Status

201 Created

Body

{
  "id": 6,
  "caption_text": "1\n00:00:01,478 --> 00:00:04,020\nVimeoSrtPlayer\n\n2\n00:00:05,045 --> 00:00:09,545\nSupport font",
  "language": "fre",
  "attachment_id": 70,
  "created_at": "2019-10-31T22:06:23Z",
  "updated_at": "2019-10-31T22:06:23Z",
  "school_id": 486,
  "options": {
  }
}