Resource /api/cytes

Make requests to this resource and receive lists of cytes.

Cyte Object

The cyte object consists of the following fields:

id:integer identifier.
title:the title of the page that was cyted.
live_view_url:the url of the page that was cyted.
icyte_view_url:the url of our snapshot of the page.
screenshot_url:the url of a 200x100px screenshot of the snapshot.
selection_text:the text selected by the user when making the cyte (will be set to an automatically generated extract of the document when no selection is made).
project_id:the id of the project this cyte is in.
owner_id:the id of the user who created this cyte.
taglist:a comma seperated list of tags given to this cyte.
note:the note the owner made on this cyte.
created_at:the time when the cyte was created.
updated_at:the time when the cyte was last modified.

Permissions

  • Permissions are enforced at project level.
  • Any cyte that is in a public project is readable by all users.
  • Any other cyte is readable and writable by users that have been added to that cyte’s project.

Methods

public instance

  1. index
  2. search
  3. show

Public instance methods

index ()
GET /api/cytes[.format]

Returns a list of cytes, given the filter provided, consisting of zero or more of:

project_id:return cytes from this project.
owner_id:return cytes created by this user.
tag:return cytes with this tag.
per_page:the number of cytes to return (default:20, maximum: 50).
page:the page to begin on given the per_page setting.
sort_field:the order to sort in, one of (name, project, owner, tags, date), default: date.

Examples

/api/cytes?filter[project_id]=1

Returns the newest 20 cytes in the project with id 1.

/api/cytes.json?filter[tag]=test&filter[sort_field]=project&filter[page]=2

Returns cytes 21-40 with the tag ‘test’ sorted by project name.

search ()
GET /api/cytes/search[.format]

Search for cytes matching a search query. Use a search filter:

query:the query to search with (see below) [REQUIRED].
public:search over all public cytes, or just this user’s personal cytes. Default: true.
per_page:the number of cytes to return (default:20, maximum: 50).
page:the page to begin on given the per_page setting.

Query syntax

The query syntax is very simple. Double quotes “” can be used to construct phrase queries. AND or OR can be used to construct boolean queries (AND is the default).

Note that results are always ordered by relevance to the search query.

Examples

/api/cytes/search?search[query]=test

Returns the first 20 cytes that contain the term ‘test’, ordered by relevance.

/api/cytes/search?search[query]=foo bar&public=false

Search for cytes with both ‘foo’ and ‘bar’ in projects this user is a member of.

show ()
GET /api/cytes/id[.format]

Returns a single cyte, given an id. Ensure that you have read access to the cyte.