The scale value resources are related to a scale. The base path for them is
http://api.annotationstool.com/v1/scales/#{scaleId}/scalevalues
for "template" scales
http://api.annotationstool.com/v1/videos/#{videoId}/scales/#{scaleId}/scalevalues
for normal scales
Name | Type | Description | Default |
---|---|---|---|
id* | Long |
The scale value id. | Generated at creation |
name* | String |
The scale value name. | EMPTY |
value* | Decimal |
The scale value as decimal. | 0 |
order* | Integer |
The order of the scale value in the scale values list. | 0 |
scale* | scale as JSON Object |
The scale containing this scale value. | EMPTY |
+ | logging attributes |
- Add a new value to a scale
- Get a scale value
- Get all value from a scale
- Update a scale value
- Delete a scale value
Add the given value to the scale with id scaleId. The scale value id must not be given . Anyway it will be overwritten.
Method | Path | Parameters | HTTP Response |
---|---|---|---|
POST | /scales/#{scaleId}/scalevalues or /videos/#{videoId}/scales/#{scaleId}/scalevalues | NONE | 201 Created : Resource created, 400 Bad request : Request not valid, 401 Unauthorized : Operation not authorized for the user, 409 conflict : Resource already exist, 500 Internal server error : Error happened on the server side. |
POST http://api.annotationstool.com/v1//videos/123/scales/2/scalevalues
name=Extraordinary&value=10&order=10
Location parameter in header give the URI from the new resource.
NO CONTENT
Get the scale value with the id scalevalueId
Method | Path | Parameters | HTTP Response |
---|---|---|---|
GET | /scales/#{scaleId}/scalevalues/#{scalevalueId} or /videos/#{videoId}/scales/#{scaleId}/scalevalues/#{scalevalueId} | 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/v1//videos/123/scales/2/scalevalues/12
NO CONTENT
{
id: 12,
name: 'Extraordinary',
value: 10,
order: 10,
scale: {
id: 2,
name: 'Work quality',
description: 'Scale to define the quality of the work presented.'
},
access: 0,
updated_by: 123,
updated_at: 32421410,
created_by: 123,
created_at: 32421410
}
Query values from a scale.
Method | Path | Parameters | HTTP Response |
---|---|---|---|
GET | /scales/#{scaleId}/scalevalues/#{scalevalueId} or /videos/#{videoId}/scale/#{scaleId}/scalevalues | list queries parameters | 200 Ok : Resources 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/v1/videos/123/scales/2/scalevalues?limit=4
NO CONTENT
{
count: 4, // Result lenght
offset: 0, // Offset parameter to use in case of pagination needs
elements: [
{
id: 12,
name: 'Extraordinary',
value: 10,
order: 10,
scale: {
id: 2,
name: 'Work quality',
description: 'Scale to define the quality of the work presented.'
},
access: 0,
updated_by: 123,
updated_at: 32421410,
created_by: 123,
created_at: 32421410
},
{
id: 13,
name: 'Excellent',
value: 9,
order: 9,
scale: {
id: 2,
name: 'Work quality',
description: 'Scale to define the quality of the work presented.'
},
access: 0,
updated_by: 123,
updated_at: 32421411,
created_by: 123,
created_at: 32421411
},
{
id: 14,
name: 'Well done',
value: 8,
order: 8,
scale: {
id: 2,
name: 'Work quality',
description: 'Scale to define the quality of the work presented.'
},
access: 0,
updated_by: 123,
updated_at: 32421412,
created_by: 123,
created_at: 32421412
},
{
id: 15,
name: 'Good',
value: 7,
order: 7,
scale: {
id: 2,
name: 'Work quality',
description: 'Scale to define the quality of the work presented.'
},
access: 0,
updated_by: 123,
updated_at: 32421413,
created_by: 123,
created_at: 32421413
}
]
}
Update the scale value with the given scalevalueId or create a new one with this scalevalueId.
Method | Path | Parameters | HTTP Response |
---|---|---|---|
PUT | /scales/#{scaleId}/scalevalues/#{scalevalueId} or /videos/#{videoId}/scales/#{scaleId}/scalevalues/#{scalevalueId} | NONE | 200 Ok : Resource modified, 201 created : Resource created, 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/scales/2/scalevalues/12
Send the resource parameters as query parameters.
name=Extraordinary&value=8&order=8
Return the status code corresponding the operation done and the Location in the header if resource created.
{
id: 12,
name: 'Extraordinary',
value: 8,
order: 8,
scale: {
id: 2,
name: 'Work quality',
description: 'Scale to define the quality of the work presented.'
},
access: 0,
updated_by: 123,
updated_at: 32421890,
created_by: 123,
created_at: 32421410
}
Delete the scale value with id scalevalueId.
Method | Path | Parameters | HTTP Response |
---|---|---|---|
DELETE | /scales/#{scaleId}/scalevalues/#{scalevalueId} or videos/#{videoId}/scales/#{scaleId}/scalevalues/#{scalevalueId} | 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/scales/2/scalevalues/12
NO CONTENT
NO CONTENT
< Rest API documentation [1]: rest-get-parameters