v2 - Draft
Benjamin Erb
The Task API represents an external service that enables the handling of certain tasks. In terms of the diretto platform, a task is a request of specific footage. Reporters may take in part in tasks and contribute required documents as submissions. A task is always bound to a location and a time frame. A title and description define the task and optional tags allow to categorize it. Votes help to prioritize different tasks within the community. Tasks can be commented for exchange of ideas. Finally, every user can submit an existing document as footage for the task. The community can then rate the suitability of the submission regarding the task request. Besides the of directed collection of live footage, the Task API can also be used for specialized search queries. In this case, a task represents a search query and all potential results are submissions. This user-driven search is helpful for queries when only users can reason about appropriate hits by analyzing the documents.
This resource represents a comment. Comments can be added by users to a task in order to discuss the task.
http://task.example.foo/v2/task/{task-id}/comment/{comment-id}
http://task.example.foo/v2/task/{task-id}/comments
{
"content":"blablabla"
}
http://task.example.foo/v2/task/{task-id}/comments
{
"comments":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/eafbad70-7972-11e0-a1f0-0800200c9a66/comments"
},
"list":[
{
"comment":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/eafbad70-7972-11e0-a1f0-0800200c9a66/comment/8e252710-77cf-11e0-a1f0-0800200c9a66"
},
"content":"blablabla",
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/tag/ef7987f2bd22f4a8cf236c83a57c1f6b/votes"
},
"up":12,
"down":2
}
}
}
]
}
}
http://task.example.foo/v2/task/{task-id}/comment/{comment-id}
{
"comment":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/eafbad70-7972-11e0-a1f0-0800200c9a66/comment/8e252710-77cf-11e0-a1f0-0800200c9a66"
},
"content":"blablabla",
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/tag/ef7987f2bd22f4a8cf236c83a57c1f6b/votes"
},
"up":12,
"down":2
}
}
}
This entry resource provides information about the service instance.
http://task.example.foo/v2
http://task.example.foo/v2
{
"api":{
"name":"org.diretto.api.external.task",
"version":"v2"
},
"service":{
"name":"diretto Task Node",
"version":"0.1.0"
},
"deployment":{
"title":"fubar Task Service",
"contact":"n/a",
"website":{
"link":{
"rel":"self",
"href":"http://www.diretto.org"
}
}
},
"direttoMainServices":{
"core":{
"link":{
"rel":"self",
"href":"http://core.example.foo/v2"
}
}
},
"links":[
{
"title":"diretto Task API Documentation",
"link":{
"rel":"self",
"href":"http://diretto.github.com/diretto-api-doc/v2/diretto-ext/task.html"
}
},
{
"title":"Task factory resource",
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/tasks"
}
},
{
"title":"Tag factory resource",
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/tags"
}
},
{
"title":"Query dispatching resource",
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/query"
}
}
],
"parameters":{
"paginationSize":20,
"batchLimit":50
}
}
The JSON response contains information about the service identification and version, the actual deployment variables and links to the main service instance.
An interface resource for query execution. A query must be dispatched to the server which will return a URI for the query. This URI then contains the results. Results are paginated using cursors. A query resource stores the initial query parameters, not the result set. Thus, queries can be re-executed by using the same URI, although the corresponding results may have changed. Be aware of this fact when applying caching to query results.
Client Task Service
| |
| |
| (1) POST Query |
|------------------------------>|
| |
| (2) 202 + Location |
|<------------------------------|
| |
| |
| (3) GET Query Resource |
|------------------------------>|
| |
| (4) 303 + 1st page URI |
|<------------------------------|
| |
| |
| (5) GET 1st result page |
|------------------------------>|
| |
| (6) 200 + First page |
|<------------------------------|
| |
Note that step 5 and 6 must be repeated for additional result pages. Also, step 1 and 2 can be skipped if an existing query (client already knows query URI) should be re-executed.
http://task.example.foo/v2/query/stored/{query-id}
http://task.example.foo/v2/query
{
"query":{
"time":{
"start":"2010-06-29T19:15:51.765Z",
"end":"2010-06-29T19:15:50.000Z"
},
"location":{
"bbox":[
100.0,
0.0,
105.0,
1.0
]
},
"tags":[
"http://task.example.foo/v2/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
]
}
}
A query is built using three parameters. While time frame and spatial bounding box are mandatory, the tag list may be empty.
Please not that all parameters are combined conjunctively (using boolean AND), thus each emitted result entry matches all of the parameters.
http://task.example.foo/v2/query/common/{type}?lat1={lat1}&lon1={lon1}&lat2={lat2}&lon2={lon2}
http://task.example.foo/v2/query/stored/{query-id}
http://task.example.foo/v2/query/stored/{query-id}/cursor/{cursor-id}
{
"query":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/query/stored/128ecf542a35ac5270a87dc740918404"
}
},
"results":{
"count":101,
"page":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/query/stored/128ecf542a35ac5270a87dc740918404/cursor/def"
},
"list":[
{
"task":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015"
}
}
}
],
"related":[
{
"link":{
"rel":"first",
"href":"http://task.example.foo/v2/query/stored/128ecf542a35ac5270a87dc740918404/cursor/abc"
}
},
{
"link":{
"rel":"previous",
"href":"http://task.example.foo/v2/query/stored/128ecf542a35ac5270a87dc740918404/cursor/abc"
}
},
{
"link":{
"rel":"next",
"href":"http://task.example.foo/v2/query/stored/128ecf542a35ac5270a87dc740918404/cursor/ghi"
}
}
]
}
}
}
A query result page containing links to the previous, next and first page. The first page link is always present, the others only when the other pages acutally exist.
This resource represents a submission. A submission basically suggests that a document represents a possible solution to the task.
http://task.example.foo/v2/task/{task-id}/submission/{submission-id}
http://task.example.foo/v2/task/{task-id}/submissions
{
"document":{
"link":{
"rel":"self",
"href":"http://core/v2/document/550e8400-e29b-11d4-a716-446655440000"
}
}
}
An example submission of a document.
{
"error":{
"reason":"The spatial location of the document is outside the task area."
}
}
A rejected submission (403) of a document, here due to it's meta data.
http://task.example.foo/v2/task/{task-id}/submissions
{
"submissions":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/eafbad70-7972-11e0-a1f0-0800200c9a66/submissions"
},
"list":[
{
"submission":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000"
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000/votes"
},
"up":123,
"down":42
},
"document":{
"link":{
"rel":"self",
"href":"http://core/v2/document/550e8400-e29b-11d4-a716-446655440000"
}
},
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"tags":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000/tags"
},
"list":[
{
"tag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
},
"baseTag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
}
},
"value":"mytag",
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000/tag/ef7987f2bd22f4a8cf236c83a57c1f6b/votes"
},
"up":12,
"down":2
}
}
}
]
}
}
}
]
}
}
http://task.example.foo/v2/task/{task-id}/submission/{submission-id}
{
"submission":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000"
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000/votes"
},
"up":123,
"down":42
},
"document":{
"link":{
"rel":"self",
"href":"http://core/v2/document/550e8400-e29b-11d4-a716-446655440000"
}
},
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"tags":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000/tags"
},
"list":[
{
"tag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
},
"baseTag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
}
},
"value":"mytag",
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000/tag/ef7987f2bd22f4a8cf236c83a57c1f6b/votes"
},
"up":12,
"down":2
}
}
}
]
}
}
}
This resource represents a tag. Users can append tags on various resources. The tag URI path is appended to the original URI. The following resources of the Task API can be tagged: Task and Submission
Client Task Service
| |
| |
| (1) POST Tag |
|------------------------------>|
| |
| (2) 201/202 + Location |
|<------------------------------|
| |
| |
| (3) POST Tag to Resource |
|------------------------------>|
| |
| (4) 201/202 + Location |
|<------------------------------|
| |
| |
Steps 1+2 create a tag, steps 3+4 append the tag to a resource.
http://task.example.foo/v2/tag/{tag-id}
http://task.example.foo/v2/{resource}/tags
{
"baseTag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
}
}
}
http://task.example.foo/v2/tags
{
"value":"mytag"
}
{
"baseTag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
}
}
}
http://task.example.foo/v2/tags/multiple
{
"values":["t","mytag"]
}
{
"results":{
"mytag":{
"baseTag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
}
}
},
"t":{
"error":{
"reason":"Invalid tag length"
}
}
}
}
http://task.example.foo/v2/{resource}/tags
{
"tags":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/resource/tags"
},
"list":[
{
"tag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
},
"baseTag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
}
},
"value":"mytag",
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/tag/ef7987f2bd22f4a8cf236c83a57c1f6b/votes"
},
"up":12,
"down":2
}
}
}
]
}
}
http://task.example.foo/v2/{resource}/tag/{tag-id}
{
"tag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
},
"baseTag" : {
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
}
},
"value":"mytag",
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/tag/ef7987f2bd22f4a8cf236c83a57c1f6b/votes"
},
"up":12,
"down":2
}
}
}
Note that the creation time denotes the time this tag has been appended to the resource for the first time.
http://task.example.foo/v2/tag/{tag-id}
{
"baseTag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
},
"value":"mytag",
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
}
}
}
Note that the creation time denotes the initial usage of this time.
This resource represents a task.
http://task.example.foo/v2/task/{task-id}
http://task.example.foo/v2/tasks
{
"constraints":{
"time":{
"start":"2010-06-29T16:00:51.765Z",
"end":"2010-06-29T19:15:50.000Z"
},
"location":{
"bbox": [100.0, 0.0, 105.0, 1.0]
}
},
"title":"foo bar",
"description":"foo bar asd lorem"
}
http://task.example.foo/v2/tasks/metadata
{
"tasks":[
"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015",
"http://task.example.foo/v2/task/2671f383-a28c-bla"
]
}
{
"results":{
"http://task.example.foo/v2/task/2671f383-a28c-bla":{
"error":{
"reason":"Not found"
}
},
"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015":{
"task":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015"
},
"constraints":{
"time":{
"start":"2010-06-29T16:00:51.765Z",
"end":"2010-06-29T19:15:50.000Z"
},
"location":{
"bbox":[
100.0,
0.0,
105.0,
1.0
]
}
},
"title":"foo bar",
"description":"foo bar asd lorem",
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/resource/votes"
},
"up":123,
"down":42
}
},
"submissions":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/eafbad70-7972-11e0-a1f0-0800200c9a66/submissions"
}
},
"comments":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/eafbad70-7972-11e0-a1f0-0800200c9a66/comments"
}
},
"tags":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/tags"
}
}
}
}
}
http://task.example.foo/v2/tasks/snapshots
{
"tasks":[
"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015",
"http://task.example.foo/v2/task/2671f383-a28c-bla"
]
}
{
"results":{
"http://task.example.foo/v2/task/2671f383-a28c-bla":{
"error":{
"reason":"Not found"
}
},
"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015":{
"task":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015"
},
"constraints":{
"time":{
"start":"2010-06-29T16:00:51.765Z",
"end":"2010-06-29T19:15:50.000Z"
},
"location":{
"bbox":[
100.0,
0.0,
105.0,
1.0
]
}
},
"title":"foo bar",
"description":"foo bar asd lorem",
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/resource/votes"
},
"up":123,
"down":42
}
}
},
"submissions":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/eafbad70-7972-11e0-a1f0-0800200c9a66/submissions"
},
"list":[
{
"submission":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000"
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000/votes"
},
"up":123,
"down":42
},
"document":{
"link":{
"rel":"self",
"href":"http://core/v2/document/550e8400-e29b-11d4-a716-446655440000"
}
},
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"tags":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000/tags"
},
"list":[
{
"tag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
},
"baseTag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
}
},
"value":"mytag",
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000/tag/ef7987f2bd22f4a8cf236c83a57c1f6b/votes"
},
"up":12,
"down":2
}
}
}
]
}
}
}
]
},
"comments":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/eafbad70-7972-11e0-a1f0-0800200c9a66/comments"
},
"list":[
{
"comment":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/eafbad70-7972-11e0-a1f0-0800200c9a66/comment/8e252710-77cf-11e0-a1f0-0800200c9a66"
},
"content":"blablabla",
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/tag/ef7987f2bd22f4a8cf236c83a57c1f6b/votes"
},
"up":12,
"down":2
}
}
}
]
},
"tags":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/resource/tags"
},
"list":[
{
"tag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
},
"baseTag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
}
},
"value":"mytag",
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/tag/ef7987f2bd22f4a8cf236c83a57c1f6b/votes"
},
"up":12,
"down":2
}
}
}
]
}
}
}
}
http://task.example.foo/v2/tasks
http://task.example.foo/v2/tasks/cursor/{task id}
{
"page":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/tasks/cursor/2671f383-a28c-44d5-b86b-f7f04bb0a015"
}
},
"list":[
{
"task":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015"
}
}
}
],
"related":[
{
"link":{
"rel":"previous",
"href":"http://task.example.foo/v2/tasks/cursor/5330edf0-a68d-11e0-8264-0800200c9a66"
}
},
{
"link":{
"rel":"next",
"href":"http://task.example.foo/v2/tasks/cursor/8d45b5ff-c6b8-4ec3-9fd1-96704233be3e"
}
}
]
}
An example page (containing only one item per page). Please note the related links, which may be available in most cases.
http://task.example.foo/v2/tasks/since/{split date}
http://task.example.foo/v2/task/{task-id}/snapshot
{
"task":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015"
},
"constraints":{
"time":{
"start":"2010-06-29T16:00:51.765Z",
"end":"2010-06-29T19:15:50.000Z"
},
"location":{
"bbox":[
100.0,
0.0,
105.0,
1.0
]
}
},
"title":"foo bar",
"description":"foo bar asd lorem",
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/resource/votes"
},
"up":123,
"down":42
}
},
"submissions":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/eafbad70-7972-11e0-a1f0-0800200c9a66/submissions"
},
"list":[
{
"submission":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000"
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000/votes"
},
"up":123,
"down":42
},
"document":{
"link":{
"rel":"self",
"href":"http://core/v2/document/550e8400-e29b-11d4-a716-446655440000"
}
},
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"tags":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000/tags"
},
"list":[
{
"tag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
},
"baseTag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
}
},
"value":"mytag",
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/submission/550e8400-e29b-11d4-a716-446655440000/tag/ef7987f2bd22f4a8cf236c83a57c1f6b/votes"
},
"up":12,
"down":2
}
}
}
]
}
}
}
]
},
"comments":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/eafbad70-7972-11e0-a1f0-0800200c9a66/comments"
},
"list":[
{
"comment":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/eafbad70-7972-11e0-a1f0-0800200c9a66/comment/8e252710-77cf-11e0-a1f0-0800200c9a66"
},
"content":"blablabla",
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/tag/ef7987f2bd22f4a8cf236c83a57c1f6b/votes"
},
"up":12,
"down":2
}
}
}
]
},
"tags":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/resource/tags"
},
"list":[
{
"tag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
},
"baseTag":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/tag/ef7987f2bd22f4a8cf236c83a57c1f6b"
}
},
"value":"mytag",
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/tag/ef7987f2bd22f4a8cf236c83a57c1f6b/votes"
},
"up":12,
"down":2
}
}
}
]
}
}
http://task.example.foo/v2/task/{task-id}
{
"task":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015"
},
"constraints":{
"time":{
"start":"2010-06-29T16:00:51.765Z",
"end":"2010-06-29T19:15:50.000Z"
},
"location":{
"bbox":[
100.0,
0.0,
105.0,
1.0
]
}
},
"title":"foo bar",
"description":"foo bar asd lorem",
"creationTime":"2010-07-17T18:54:11.939Z",
"creator":{
"link":{
"rel":"self",
"href":"http://core/v2/user/123456"
}
},
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/resource/votes"
},
"up":123,
"down":42
}
},
"submissions":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/eafbad70-7972-11e0-a1f0-0800200c9a66/submissions"
}
},
"comments":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/eafbad70-7972-11e0-a1f0-0800200c9a66/comments"
}
},
"tags":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/task/2671f383-a28c-44d5-b86b-f7f04bb0a015/tags"
}
}
}
This resource represents a vote. Users can vote on various resources. The voting URI path is appended to the original URI. The following resources of the Task API can be voted on: Task, Submission, Comment and Tag (for tasks and submissions)
http://task.example.foo/v2/{resource}/vote/user/{user-id}
http://task.example.foo/v2/{resource}/votes
{
"votes":{
"link":{
"rel":"self",
"href":"http://task.example.foo/v2/resource/votes"
},
"up":123,
"down":42
}
}
http://task.example.foo/v2/{resource}/vote/user/{user-id}
{
"vote": "up"
}
A response containing an up-vote.
{
"vote": "down"
}
A response containing a down-vote.
http://task.example.foo/v2/{resource}/vote/user/{user-id}
http://task.example.foo/v2/{resource}/vote/user/{user-id}/{vote}