RESTfull API provides access to the following resources:
- Video
- Subtitles
- Applications
All requests to video and subtitles resources must be signed with application token. Application token is a string that must be obtained via the following API.
GET /api/v1/app/<application-key>/token?video=<video-id>
URL parameter:
<application-key>
is a secret key generated by feel-subtitles admin via admin interface. Please contact us to obtain the key.<video-id>
- (optional) video id to allow access to. If video id is provided, access with this token will be limited to playing this video only (GET request to /api/v1/videos//subtitles) If video id is not provided, this token will allow all operations.
{
apptoken: 'application-token'
}
The token is valid for 24 hours. Please note that each subsequent request can return a different application token. Multiple tokens obtained this way can be valid at the same time as long as they are not expired.
For security reason, to avoid application key exposure we recommend to perform such requests from server side only, not from the client side.
Each application belongs to a group. Each group can contain one or more applications.
Videos and subtitles created by one group are not visible by applications of any other group.
Please contact the platform administrator if you need several applicaitons to be grouped.
GET /api/v1/videos?apptoken=<apptoken>
apptoken
- application token
{
"total_pages": 1,
"objects": [
{
"subtitles_count": 2,
"created": "2016-01-12T15:48:15.633558",
"external_id": "video-id",
"name": "",
"description": null
},
{
"subtitles_count": 0,
"created": "2016-01-14T14:41:00.870006",
"external_id": "another video",
"name": "another video",
"description": null
},
],
"num_results": 2,
"page": 1
}
GET /api/v1/videos/<video-id>/subtitles?apptoken=<apptoken>
video-id
- video IDapptoken
- application token
Returns a new subtitle object in JSON format. Example:
[
{
"description": "Subs description,\ncan be multiline",
"created": "2016-01-13T14:47:00.368874",
"text": "{0:0, 1:1}",
"video_external_id": "video-id",
"type": "penetration",
"id": 28,
"name": "Subs name"
},
{
"description": "Subs description,\ncan be multiline",
"created": "2016-01-13T14:50:06.239584",
"text": "{0:0, 1:1}",
"video_external_id": "video-id",
"type": "penetration",
"id": 29,
"name": "Subs name"
}
]