Web Services

The web services REST API provides a set of simple interfaces for Social Module functionality.

All REST resources support both XML and JSON response formats, with XML being the default. To request a JSON response, the "Accept" header of the HTTP request for a particular REST resource should be set to "application/json". For example:

GET /twigkit/api/social/myrequest HTTP/1.1
Accept: application/jsonrequest
...

Comment on documents

Users provide additional information about documents by commenting on them. For example, users might comment on the quality or relavance of a document, expand upon information in a document, or refer to related documents.

Methods and resource URIs are:

  • GET /twigkit/api/social/comments: Retrieve comments that match one or more predicates.

  • GET /twigkit/api/social/comment/{id}: Retrieve a single comment, identified by the id parameter.

  • POST /twigkit/api/social/comment: Post a comment.

  • DELETE /twigkit/api/social/comment/{id}: Delete a single comment, identified by the id parameter.

Bookmark documents

Bookmarks are used to identify documents for later retrieval or reference. Each bookmark is given a title, which serves to describe the intended reference. Like all other annotations, a bookmark can be optionally associated with a topic.

Methods and resource URIs are:

  • GET /twigkit/api/social/bookmark/{id}: Retrieves a single bookmark, identified by the id parameter.

  • POST /twigkit/api/social/bookmark: Creates a new bookmark for the authenticated user.

  • DELETE /twigkit/api/social/bookmark/{id}: Deletes permanently the bookmark identified by the id parameter.

  • GET /twigkit/api/social/bookmarks: Returns a collection of bookmarks matching some number of filter predicates.

Search for annotated documents

All annotations (bookmarks, comments, likes, and tags) are linked to external documents.

The method and resource URI are:

  • GET /twigkit/api/social/annotated: Retrieves a list of documents that have been annotated, according to some search criteria.

Protect against CSRF attacks

To help protect against Cross-Site Request Forgery (CSRF) attacks on social web services, App Studio can ensure that all requests are tokenized. That is, each request is provided with a randomized Appkit request token.