The track resources are related to a video.
http://api.annotationstool.com/v1/videos/#{videoId}/tracks
Name | Type | Description | Default |
---|---|---|---|
id * | Long |
The track id. | Generated at creation |
name* | String |
The track name. | EMPTY |
description | String |
The track description. | EMPTY |
settings | String |
List of track settings, not well defined at the moment. | NULL |
tags | String |
String of related tags. | NULL |
+ | logging attributes |
Add the given track to the video with id videoId. The track id must not be given . Anyway it will be overwritten.
Method | Path | Parameters | HTTP Response |
---|---|---|---|
POST | /videos/#{videoId}/tracks | NONE | 201 Created : Resource created, 400 Bad request : Request not valid, 401 Unauthorized : Operation not authorized for the user, 500 Internal server error : Error happened on the server side. |
POST http://api.annotationstool.com/v1/videos/123/tracks
name=example+track&description=simple+track&settings={color:blue,picture=http%3A%2F%2Ficon.org%2FmyTrackIcon.png}&access=1
Location parameter in header give the URI from the new resource.
{
id: 1,
name: 'example track',
description: 'Simple track to add some basic annotations',
settings: '{
// Some possible settings, not well defined at the moment
color: \"blue\",
picture: \"http://icon.org/myTrackIcon.png\"
}',
access: 1
updated_by: 123,
updated_at: 32421410,
created_by: 123,
created_at: 32421410
}
Get a video track with the id trackId
Method | Path | Parameters | HTTP Response |
---|---|---|---|
GET | /videos/#{videoId}/tracks/#{trackId} | NONE | 200 Ok : Resource returned, 401 Unauthorized : Operation not authorized for the user, 404 Not found : Resource not found, 500 Internal server error : Error happened on the server side. |
GET http://api.annotationstool.com/videos/123/tracks/1
NO CONTENT
{
id: 1,
name: 'example track',
description: 'Simple track to add some basic annotations',
settings: '{
// Some possible settings, not well defined at the moment
color: \"blue\",
picture: \"http://icon.org/myTrackIcon.png\"
}',
access: 1,
updated_by: 123,
updated_at: 32421410,
created_by: 123,
created_at: 32421410
}
Query tracks from a video.
Method | Path | Parameters | HTTP Response |
---|---|---|---|
GET | /videos/#{videoId}/tracks | list queries parameters ![]() |
200 Ok : Resources returned, 401 Unauthorized : Operation not authorized for the user, 404 Not found : Resource not found (#{videoId} does not exist), 500 Internal server error : Error happened on the server side. |
By default, the tracks list should be sorted by name.
GET http://api.annotationstool.com/videos/123/tracks?limit=2
NO CONTENT
{
count: 2, // Result length SPRINT 2 needed?
offset: 0, // Offset parameter to use in case of pagination needs SPRINT 2 needed?
tracks: [
{
id: 1,
name: 'example track',
description: 'Simple track to add some basic annotations',
settings: {
color: 'blue',
picture: 'http://icon.org/myTrackIcon.png'
},
access: 'public'
},
{
id: 2,
name: 'George private track',
description: 'The private track from George',
settings: {
color: 'red',
picture: 'http://icon.org/anotherIcon.png'
},
access: 0,
updated_by: 123,
updated_at: 32421410,
created_by: 123,
created_at: 32421410
}
]
}
Update the track with the given trackId.
Method | Path | Parameters | HTTP Response |
---|---|---|---|
PUT | /videos/#{videoId}/tracks/#{trackId} | NONE | 200 Ok : Resource modified, 304 Not Modified : Resource not modified, 400 Bad request : Request not valid, 401 Unauthorized : Operation not authorized for the user, 404 Not found : Resource not found, 500 Internal server error : Error happened on the server side. |
PUT http://api.annotationstool.com/v1/videos/123/tracks/1
Send the resource parameters as query parameters.
name=example+track&description=simple+track&settings={color:blue,picture=http%3A%2F%2Ficon.org%2FmyTrackIcon.png}&access=1
Return the status code corresponding the operation done and the Location in the header if resource created.
{
id: 1,
name: 'example track',
description: 'Simple track',
settings: '{
// Some possible settings, not well defined at the moment
color: "blue",
picture: "http://icon.org/myTrackIcon.png"
}',
access: 1,
updated_by: 123,
updated_at: 32423432,
created_by: 123,
created_at: 32421410
}
Method | Path | Parameters | HTTP Response |
---|---|---|---|
DELETE | /videos/#{videoId}/tracks/#{trackId} | NONE | 204 No content : Resource deleted, 401 Unauthorized : Operation not authorized for the user, 404 Not found : Resource not found. |
DELETE http://api.annotationstool.com/v1/videos/123/tracks/1
NO CONTENT
NO CONTENT
< Rest API documentation [1]: rest-get-parameters