Annota - documentation

API

Errors

Bad request

In case when the api call does not contain all the required parameters.

HTTP/1.1 400 Bad Request
          

Not logged in

In case when user is not logged in or cookie was not sent.

HTTP/1.1 401 Unauthorized
          

Don't have permission

In case when user doesn't have permission to call api or doesn't have access to specified resource.

HTTP/1.1 403 Forbidden
          

Tags

Index

Lists tags used by user along with count of usages for every tag. Tags are ordered by decreasing count.

Method GET
URI http://annota.fiit.stuba.sk/api/v2/tags
Params
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X GET  http://annota.fiit.stuba.sk/api/v2/tags
        
Response
 [
    {
        "tag": "tag",
        "count": "4"
    },
    {
        "tag": "novy",
        "count": "1"
    }
]
  

Show

Returns tag along with users documents associated with this tag

Method GET
URI http://annota.fiit.stuba.sk/api/v2/tags/tag_name
Params
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X GET  http://annota.fiit.stuba.sk/api/v2/tags/tag_name
        
Response
{
    "tag": "tag_name",
    "document_count": 2,
    "documents": [
        {
            "id": 7,
            "url": "http://www.google.com",
            "created_at": "2012-07-17T13:44:12Z",
            "updated_at": "2012-07-17T13:44:12Z"
        },
        {
            "id": 12,
            "url": "file///dev/null",
            "created_at": "2012-07-17T18:30:21Z",
            "updated_at": "2012-07-17T18:30:21Z"
        }
    ]
}
  

Create

Associates tag to document.

Method POST
URI http://annota.fiit.stuba.sk/api/v2/tags
Params
tag
- Tag to be associated to document.
document
- Id of document to associate tag to. Id or url is required.
url
- Url of document to associate tag to. Id or url is required.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"tag":"novy","document":15}'  http://annota.fiit.stuba.sk/api/v2/tags
        
Response
HTTP/1.1 200 OK

{"name":"novy", "created_at":"2012-07-18T21:46:42Z", "updated_at":"2012-07-18T21:46:42Z", "document_id":15, "url":"http://www.yahoo.fr"}
  

Destroy

Removes tag associated to document.

Method DELETE
URI http://annota.fiit.stuba.sk/api/v2/tags/tag
Params
tag
- Tag to remove from document.
document
- Id of document to remove tag from. Id or url is required.
url
- Url of document to remove tag from. Id or url is required.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X DELETE -d '{"document":15}'  http://annota.fiit.stuba.sk/api/v2/tags/novy
        
Response
HTTP/1.1 200 OK

{"name":"novy", "document_id":15, "url":"http://www.yahoo.fr", "created_at":"2012-07-18T21:46:42Z", "updated_at":"2012-07-18T21:46:42Z",}
  

Bookmarks

Index

Lists users bookmarks.

If page is shared with user but is not bookmarked by the user, it will not be listed.

Method GET
URI http://annota.fiit.stuba.sk/api/v2/bookmarks
Params
page
- Page number used in pagination. Page size is 100, default value id 1.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X GET  http://annota.fiit.stuba.sk/api/v2/bookmarks
        
Response
 {
    "bookmark_count": 3,
    "bookmarks": [
        {
            "id": 7,
            "bookmark_id": 1,
            "url": "http://www.google.com",
            "title": "Gogle Search",
            "note": "poznamka",
            "public_note": "verejna poznamka",
            "read_later": false,
            "favorite": false,
            "path": null,
            "last_visit": "2012-07-17T13:44:12Z",
            "created_at": "2012-07-17T13:44:12Z",
            "updated_at": "2012-07-17T13:44:12Z"
        },
        {
            "id": 12,
            "bookmark_id": 3,
            "url": "file///dev/null",
            "title": "flush",
            "note": null,
            "read_later": true,
            "favorite": true,
            "path": null,
            "last_visit": "2012-07-30 10:05:12"
            "created_at": "2012-07-17T18:30:21Z",
            "updated_at": "2012-07-17T18:30:21Z"
        },
        {
            "id": 15,
            "bookmark_id": 10,
            "url": "http://www.yahoo.fr",
            "title": "Yahoo",
            "note": null,
            "read_later": false,
            "favorite": false,
            "path": "file:///home/user/file.pdf",
            "last_visit": "2012-07-18T20:53:21Z",
            "created_at": "2012-07-18T20:53:21Z",
            "updated_at": "2012-07-18T20:53:21Z"
        }
    ]
}
  

Show

Returns bookmark along with associated annotations and tags.

Method GET
URI http://annota.fiit.stuba.sk/api/v2/bookmarks/:id
Params
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X GET  http://annota.fiit.stuba.sk/api/v2/bookmarks/15
        
Response
{
    "id": 15,
    "bookmark_id": 10,
    "url": "http://www.yahoo.fr",
    "title": "Yahoo"
    "note": null,
    "public_note": "verejna poznamka",
    "read_later": false,
    "favorite": false,
    "path": "file:///home/user/file.pdf",
    "last_visit": "2012-07-18T20:53:21Z",
    "created_at": "2012-07-18T20:53:21Z",
    "updated_at": "2012-07-18T20:53:21Z",
    "folder": {
        "id": 2,
        "name": "moj adresar",
        "created_at": "2012-07-16T16:42:12Z",
        "updated_at": "2012-07-16T16:42:12Z",
    },
    "annotation_count": 1,
    "tag_count": 2,
    "tags": [
        "tag",
        "novy"
    ],
    "annotations": [
        {
            "id": 1,
            "after_content": "after highlighted text",
            "before_content": "before highlighted text",
            "annotated_content": "highlighted text",
            "occurrence": 1,
            "start_page": 1,
            "end_page": 1,
            "text": null,
            "created_at": "2012-07-19T15:52:52Z",
            "updated_at": "2012-07-19T15:52:52Z"
        }
    ]
}

  

Create

Creates bookmark using specified url.

Method POST
URI http://annota.fiit.stuba.sk/api/v2/bookmarks
Params
url
- Url of stored page. One of parameters url.
title
- Title of the document.
note
- Note associated with bookmark. This parameter is not required.
public_note
- Public note associated with bookmark. This note will be visible to all users in Annota. This parameter is not required.
read_later
- Mark as read_later or not [true/false]. Default value is false.
favorite
- Mark as favorite or not [true/false]. Default value is false.
public
- Mark as public or not [true/false]. Default value is false.
folder_id
- Id of a folder where the bookmark should be stored in. This parameter is not required.
tags
- An array of strings or a comma-separated string of tags. This parameter is not required.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"url":"http://www.google.com","note":"Some note to be saved with bookmark", "public_note":"Some public note to be saved with bookmark", "read_later":true, "folder_id":2, "tags":"tag1,tag2,tag3"}'  http://annota.fiit.stuba.sk/api/v2/bookmarks
        
Response
HTTP/1.1 200 OK

{
    "id": 7,
    "url": http://www.google.com,
    "title": "Google Search",
    "note": "Some note to be saved with bookmark",
    "public_note": "Some public note to be saved with bookmark",
    "path": file:///home/user/Desktop/google.html,
    "last_visit": "2012-07-17T13:44:12Z",
    "created_at": "2012-07-17T13:44:12Z",
    "updated_at": "2012-07-17T13:44:12Z",
    "read_later": false,
    "favorite": false,
    "folder": {
        "id": 2,
        "name": "moj adresar",
        "created_at": "2012-07-16T16:42:12Z",
        "updated_at": "2012-07-16T16:42:12Z",
    },
    "annotation_count": 0,
    "bookmark_id": 1,
    "tag_count": 3,
    "tags": ["tag1", "tag2", "tag3"],
    "bookmarked": true,
    "shared": false,
    "annotations": [],
    "shared_annotations": [],
    "groups": [],
    "public": true,
}


  

Destroy

Destroys the bookmark and returns it.

Method DELETE
URI http://annota.fiit.stuba.sk/api/v2/bookmarks/:id
Params
bookmark_id
- Id of a bookmark to destroy. This parameter is not required.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X DELETE  http://annota.fiit.stuba.sk/api/v2/bookmarks/15
        
Response
{
    "id": 15,
    "bookmark_id": 10,
    "url": "http://www.yahoo.fr",
    "title": "Yahoo"
    "note": null,
    "public_note": "verejna poznamka",
    "read_later": false,
    "favorite": false,
    "path": "file:///home/user/file.pdf",
    "last_visit": "2012-07-18T20:53:21Z",
    "created_at": "2012-07-18T20:53:21Z",
    "updated_at": "2012-07-18T20:53:21Z"
}
  

Find

Finds bookmark by url.

Finds shared pages too. If such page is not bookmarked by the user, bookmarked attribute will be set to "false".

Along with bookmark information, list of the user's groups sharing this page is provided.

If page is shared, shared annotations are provided as well.

Method GET
URI http://annota.fiit.stuba.sk/api/v2/bookmarks/find
Params
url
- Url of searched document.
log
- Information if user want or does not want to log his action [true/false]. Default value is true.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X GET  http://annota.fiit.stuba.sk/api/v2/bookmarks/find?url=file%3A%2F%2F%2Fhome%2Fuser%2FDesktop%2Fgoogle.html
        
Response
{
    "id": 23,
    "url": http://annota.fiit.stuba.sk//pages/23/google.html,
    "title": "Google Search",
    "note": null,
    "public_note": "verejna poznamka",
    "path": file:///home/user/Desktop/google.html,
    "last_visit": "2012-07-18T20:53:21Z",
    "created_at": "2012-07-18T20:53:21Z",
    "updated_at": "2012-07-18T20:53:21Z",
    "read_later": false,
    "favorite": false,
    "folder": {
        "id": 2,
        "name": "moj adresar",
        "created_at": "2012-07-16T16:42:12Z",
        "updated_at": "2012-07-16T16:42:12Z",
    },
    "annotation_count": 1,
    "tag_count": 2,
    "tags": [
        "tag",
        "novy"
    ],
    "bookmarked": true,
    "shared": true,
    "log":true,
    "download":"http://url.nejkaurl.com",
    "pdf_selector":".pdf_link",
    "annotations": [
        {
            "id": 4,
            "after_content": "after highlighted text",
            "before_content": "before highlighted text",
            "annotated_content": "highlighted text",
            "occurrence": 1,
            "start_page": 1,
            "end_page": 1,
            "text": null,
            "private": false,
            "created_at": "2012-07-19T15:52:52Z",
            "updated_at": "2012-07-19T15:52:52Z"
        }
    ],
        "shared_annotations": [
        {
            "id": 3,
            "author": "sharing_user",
            "after_content": " to you.",
            "before_content": " I say ",
            "annotated_content": "hello world",
            "occurrence": 1,
            "start_page": 1,
            "end_page": 1,
            "text": null,
            "type": "Highlight",
            "created_at": "2012-08-08T09:27:16Z",
            "updated_at": "2012-08-08T09:27:16Z"
        },
    ],
    "groups": [
        {
            "name": "prva",
            "description": "prva pokusna skupina",
            "created_at": "2012-08-28T12:59:24Z",
            "updated_at": "2012-08-28T12:59:24Z"
        }
    ],
}


          

Upload

Stores file (html or pdf) for document.

Method POST
URI http://annota.fiit.stuba.sk/api/v2/bookmarks
Params
id
- Id of document to attach file to. Id or url is required.
url
- Url of document to attach file to. Id or url is required.
file
- PDF ot HTML file.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: multipart/form-data" -X POST http://annota.fiit.stuba.sk/api/v2/bookmarks/upload -d '{"id":15}' -F file=@file.html
        
Response
{
    "id": 15,
    "url": "http://www.yahoo.fr",
    "title": "Yahoo"
    "note": null,
    "public_note": "verejna poznamka",
    "read_later": false,
    "favorite": false,
    "path": "file:///home/user/file.pdf",
    "last_visit": "2012-07-18T20:53:21Z",
    "public": true,
    "created_at": "2012-07-18T20:53:21Z",
    "updated_at": "2012-07-18T20:53:21Z",
}
  

Groups

Index

Lists active groups, the user is a member of.

Method GET
URI http://annota.fiit.stuba.sk/api/v2/groups
Params
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X GET  http://annota.fiit.stuba.sk/api/v2/groups
        
Response
[

    {
        "id": 1,
        "name": "prva",
        "description": "prva pokusna skupina",
        "research_objectives": "objective1, objective2",
        "created_at": "2012-08-28T12:59:24Z",
        "updated_at": "2012-08-28T12:59:24Z"
    }

]
          

Show

Returns details about an active or archived group.

Method GET
URI http://annota.fiit.stuba.sk/api/v2/groups/:id
Params
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X GET  http://annota.fiit.stuba.sk/api/v2/groups/1
        
Response
{

    "id": 1,
    "name": "prva",
    "description": "prva pokusna skupina",
    "research_objectives": "objective1, objective2",
    "status":"active",
    "created_at": "2012-08-28T12:59:24Z",
    "updated_at": "2012-08-28T12:59:24Z"

}
          

Create

Creates a new group.

Method POST
URI http://annota.fiit.stuba.sk/api/v2/groups
Params
name
- Name of the group.
description
- Group description. This argument is not required.
research_objectives
- Comma-separated string of research objectives of the group. This argument is not required.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"name":"prva", "description":"prva pokusna skupina", "research_objectives":"objective1, objective2"}'  http://annota.fiit.stuba.sk/api/v2/groups
        
Response
HTTP/1.1 200 OK

{
        "id": 1,
        "name": "prva",
        "description": "prva pokusna skupina",
        "research_objectives": "objective1, objective2",
        "created_at": "2012-07-21T14:13:27Z",
        "updated_at": "2012-07-21T14:13:27Z"
}
  

Exists

Checks if a group exists, or if user is a member of a group.

Method GET
URI http://annota.fiit.stuba.sk/api/v2/groups/exists
Params
name
- Name of the group.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X GET  http://annota.fiit.stuba.sk/api/v2/groups/exists?name=prva
        
Response
If the user is a member of the specified group:

HTTP/1.1 200 OK
member

If the user is not a member of the specified group, but the group exists:

HTTP/1.1 200 OK
exists

If the group does not exist:

HTTP/1.1 200 OK
does_not_exist
  

Share

Shares a bookmark in an existing group or groups.

Method POST
URI http://annota.fiit.stuba.sk/api/v2/groups/share
Params
id
- Id of the group or an array of group ids with which to share a bookmark.
url
- URL of the bookmark to share.
comment
- A comment concerning the bookmark which will be shared with the specified group(s). This argument is not required.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":[1,2], "url":"http://www.google.com", "comment":"moj komentar"'  http://annota.fiit.stuba.sk/api/v2/groups
        
Response
It returns all active groups of the user with which the bookmark is shared:

HTTP/1.1 200 OK

[

    {
        "id": 1,
        "name": "prva",
        "description": "prva pokusna skupina",
        "research_objectives": "objective1, objective2",
        "created_at": "2012-08-28T12:59:24Z",
        "updated_at": "2012-08-28T12:59:24Z"
    },
    {
        "id": 2,
        "name": "druha",
        "description": "druha pokusna skupina",
        "research_objectives": "objective2, objective3",
        "created_at": "2012-08-28T13:01:42Z",
        "updated_at": "2012-08-28T13:01:42Z"
    },
]

If an id of an archived or deleted group is supplied, or of a group that the user is not a member,
it will not share the bookmark and ends with error:

HTTP/1.1 403 Forbidden
  

Highlights

Index

Lists users highlights.

Method GET
URI http://annota.fiit.stuba.sk/api/v2/highlights
Params
page
- Page number used in pagination. Page size is 100, default value id 1.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X GET  http://annota.fiit.stuba.sk/api/v2/highlights
        
Response
{
    "highlight_count": 1,
    "highlight": [
        {
            "id": 1,
            "before_content": "before highlighted text",
            "after_content": "after highlighted text",
            "annotated_content": "highlighted text",
            "occurrence": 1,
            "start_page": 1,
            "end_page": 1,
            "text": "comment text",
            "document_id": 15,
            "private": false,
            "created_at": "2012-07-19T15:52:52Z",
            "updated_at": "2012-07-19T15:52:52Z"
        }
    ]
}
          

Show

Returns details about highlight.

Method GET
URI http://annota.fiit.stuba.sk/api/v2/highlights/:id
Params
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X GET  http://annota.fiit.stuba.sk/api/v2/highlights/1
        
Response
{
    "id": 1,
    "before_content": "before highlighted text",
    "after_content": "after highlighted text",
    "annotated_content": "highlighted text",
    "occurrence": 1,
    "start_page": 1,
    "end_page": 1,
    "text": "comment text",
    "document_id": 15,
    "private": false,
    "created_at": "2012-07-19T15:52:52Z",
    "updated_at": "2012-07-19T15:52:52Z"
}
          

Create

Creates or updates highlight for document.

Method POST
URI http://annota.fiit.stuba.sk/api/v2/highlights
Params
before_content
- Text before highlighted content.
after_content
- Text after highlighted content.
annotated_content
- Selected content. Required parameter.
occurrence
- If highlight starts on the same page as it ends, it is order of selected text occurrence in page, else it is order of selected text in whole document. Starting from 1. Default value is 1.
start_page
- Page number where highlight starts. Necessary for PDF documents. For web pages is always 1. Default value is 1.
end_page
- Page number where highlight ends. Necessary for PDF documents. For web pages is always 1. Default value is 1.
text
- Text associated as comment.
private
- Boolean value, if annotation is private or not. default value is false.
document
- Id of document to associate comment to. Not necessary if url is specified.
url
- Url of document to associate comment to. Not necessary if id is specified.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"document":7, "before_content":"before", "after_content":"after", "annotated_content":"selected","occurrence":3, "start_pag":1, "end_page":1, "text":"comment text", "private":true}'  http://annota.fiit.stuba.sk/api/v2/highlights
        
Response
HTTP/1.1 200 OK

{"id":3, "before_content":"before", "after_content":"after", "annotated_content":"selected", "occurrence":3, "start_page":1, "end_page":1, "text":"comment text", "document_id":7, "private":true, "created_at":"2012-07-21T14:13:27Z", "updated_at":"2012-07-21T14:13:27Z"}
  

Destroy

Removes highlight from document.

Method DELETE
URI http://annota.fiit.stuba.sk/api/v2/highlights
Params
annotated_content
- Selected content. Required parameter.
occurrence
- Order of selected text occurrence in document. Starting from 1. Required parameter.
start_page
- Page number where highlight starts. See create method.
end_page
- Page number where highlight ends. See create method.
document
- Id of document to associate comment to. One of document and url is required.
url
- Url of document to associate comment to. One of document and url is required.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X DELETE -d '{"document":7, "annotated_content":"selected", "occurrence":3, "end_page":1, "end_page":1}'  http://annota.fiit.stuba.sk/api/v2/highlights
        
Response
HTTP/1.1 200 OK

{"id":3, "before_content":"before", "after_content":"after", "annotated_content":"selected", "occurrence":3, "start_page":1, "end_page":1 "text":"comment text", "document_id":7, "private":false, "created_at":"2012-07-21T14:13:27Z", "updated_at":"2012-07-21T14:13:27Z"}
  

Search

Search

Searches in bookmarks by keyword query.

Method GET
URI /api/v2/search/keyword
Params
page
- Page number used in pagination. Page size is 10, default value id 1.
q
- Query string.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X GET  /api/v2/search/keyword?q=test
        
Response
{
    "total_count": 2,
    "results": [
        {
            "id": 337,
            "url": "http://dl.acm.org/citation.cfm?id=1292594",
            "created_at": "2012-10-08T00:03:37Z",
            "updated_at": "2013-02-26T22:57:59Z",
            "title": "A formal model of annotations of digital content",
            "favorite": false,
            "tags": [
                "tag"
            ],
            "note": "",
            "summary": "This article is a study of the themes and issues concerning the annotation of digital contents, such as textual documents, images, and multimedia documents in general. Furthermore, it is built on previously existing models and may be seen as an extension of them.",
            "public_note": null,
            "last_visit": "2012-10-24T14:50:38Z",
            "path": null,
            "public": true
        },
        {
            "id": 6398,
            "url": "http://dl.acm.org/citation.cfm?id=2185499",
            "created_at": "2012-10-19T23:15:53Z",
            "updated_at": "2013-01-31T16:20:36Z",
            "title": "Bridging informal tagging and formal semantics via hybrid navigation",
            "favorite": false,
            "tags": [
                "tag"
            ],
            "note": "",
            "summary": null,
            "public_note": null,
            "last_visit": "2012-10-19T23:25:18Z",
            "path": null,
            "public": true
        }
    ]

}
          

Read later

Lists read later marked bookmarks ordered by last visited.

Method GET
URI /api/v2/search/read_later
Params
page
- Page number used in pagination. Page size is 10, default value id 1.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X GET  /api/v2/search/read_later
        
Response
{
    "total_count": 2,
    "results": [
        {

            "id": 2,
            "url": "http://annota.fiit.stuba.sk/bookmarks",
            "created_at": "2012-10-08T00:02:07Z",
            "updated_at": "2013-02-24T18:17:23Z",
            "title": "Annota",
            "favorite": true,
            "tags": [
                "tag"
            ],
            "note": "",
            "summary": "",
            "public_note": "",
            "last_visit": "2013-02-24T18:17:23Z",
            "path": null,
            "public": true

        },
        {

            "id": 674,
            "url": "http://dl.acm.org/citation.cfm?id=2151553",
            "created_at": "2012-10-09T10:28:40Z",
            "updated_at": "2013-02-07T12:39:49Z",
            "title": "Clanok",
            "favorite": true,
            "tags": [
                "tag"
            ],
            "note": null,
            "summary": "",
            "public_note": null,
            "last_visit": "2013-02-07T12:27:54Z",
            "path": null,
            "public": true

        }
    ]

}
          

Related

Searches in all documents by pre-stemmed query.

Method GET
URI /api/v2/search/related
Params
page
- Page number used in pagination. Page size is 10, default value id 1.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X GET  /api/v2/search/related?q=stem+phrase
        
Response
{
    "total_count": 2,
    "results": [
        {

            "id": 2,
            "url": "http://annota.fiit.stuba.sk/bookmarks",
            "created_at": "2012-10-08T00:02:07Z",
            "updated_at": "2013-02-24T18:17:23Z",
            "title": "Annota",
            "favorite": true,
            "tags": [
                "tag"
            ],
            "note": "",
            "summary": "",
            "public_note": "",
            "last_visit": "2013-02-24T18:17:23Z",
            "path": null,
            "public": true

        },
        {

            "id": 674,
            "url": "http://dl.acm.org/citation.cfm?id=2151553",
            "created_at": "2012-10-09T10:28:40Z",
            "updated_at": "2013-02-07T12:39:49Z",
            "title": "Clanok",
            "favorite": true,
            "tags": [
                "tag"
            ],
            "note": null,
            "summary": "",
            "public_note": null,
            "last_visit": "2013-02-07T12:27:54Z",
            "path": null,
            "public": true

        }
    ]

}
          

UserActions

Leave

Logs user actions on page when leaving.

Method POST
URI http://annota.fiit.stuba.sk/api/v2/user_actions/leave
Params
id
- Id of document to log actions for. Id or url is required.
url
- Url of document to log actions for. Id or url is required.
duration
- Time in seconds page was opened for.
referrer
- Url user used to get to the tab page.
copied
- Array of texts copied from page.
selected
- Array of texts selected on page.
scroll_count
- Count of scroll events on page.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"url":"http://www.google.com", "duration":324, "referrer":"http://google.com?q=google", "copied":["Title text", "Search result text"], "selected":["more texts"], "scroll_count":57}'  http://annota.fiit.stuba.sk/api/v2/user_actions/leave
        
Response
HTTP/1.1 200 OK

{"id":"15", "url":"http://www.google.com", "created_at": "2012-07-18T20:53:21Z", "updated_at": "2012-07-18T20:53:21Z"}
  

Tab_switch

Logs user action of switching to another tab.

Method POST
URI http://annota.fiit.stuba.sk/api/v2/user_actions/tab_switch
Params
id
- Id of document to log actions for. Id or url is required.
url
- Url of document to log actions for. Id or url is required.
duration
- Time in seconds last tab was opened for.
previous_tab
- Url of previous tab.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"url":"http://www.google.com", "duration":34, "previous_tab":"http://www.yahoo.com"}'  http://annota.fiit.stuba.sk/api/v2/user_actions/tab_switch
        
Response
HTTP/1.1 200 OK

{"id":"15", "url":"http://www.google.com", "created_at": "2012-07-18T20:53:21Z", "updated_at": "2012-07-18T20:53:21Z"}
  

Search

Logs term user searched for.

Method POST
URI http://annota.fiit.stuba.sk/api/v2/user_actions/search
Params
id
- Id of document to log actions for. Id or url is required.
url
- Url of document to log actions for. Id or url is required.
query
- Comma separated terms user searched for.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"url":"http://www.google.com", "query":"annotation,social"}'  http://annota.fiit.stuba.sk/api/v2/user_actions/search
        
Response
HTTP/1.1 200 OK

{"id":"15", "url":"http://www.google.com", "created_at": "2012-07-18T20:53:21Z", "updated_at": "2012-07-18T20:53:21Z"}
  

Acm_tab

Logs opening tab on ACM article page.

Method POST
URI http://annota.fiit.stuba.sk/api/v2/user_actions/acm_tab
Params
id
- Id of document to log actions for. Id or url is required.
url
- Url of document to log actions for. Id or url is required.
tab_name
- Name of tab user switched to.
CURL
curl -v --cookie "cookie-name=cookie-content" -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"url":"http://www.google.com", "tab_name":"abstract"}'  http://annota.fiit.stuba.sk/api/v2/user_actions/acm_tab
        
Response
HTTP/1.1 200 OK

{"id":"15", "url":"http://www.google.com", "created_at": "2012-07-18T20:53:21Z", "updated_at": "2012-07-18T20:53:21Z"}