wiki:BookmarksProject/RestAPI

Version 2 (modified by peter, 9 years ago) (diff)

link in title

Bookmarks Project API

GET /
  Lists the bookmarks

  Params:
    format=json|xbel|text|csv|html
    tag={tag} (repeatable)
    limit={limit}
    offset={offset} (only if limit is given)

GET /{id}
  Gets a individual bookmark

GET /{id}/{field}
  Gets an individual field of an individual bookmark

GET /feed
  Gets an Atom feed of the bookmarks

  Params:
    tag={tag} (repeatable)

POST /
  Create or update a bookmark

POST /{id}
  Update a bookmark

TODO

PUT /{id}
  Create or update a bookmark; requires the entire resource representation to be given in JSON or XBEL

DELETE /{id}
  Delete a bookmark

  -- bookmarks that have been deleted
  create table deleted_bookmarks (
      id integer,
      dtime integer
  );
  create view active_bookmarks as select * from bookmarks where id not in (select id from deleted_bookmarks)

  insert into deleted_bookmarks (id) values (?)  <-- {id}

  then a request to /{id} checks the deleted_bookmarks table and issues a 410 (cacheable) if it is in there

PUT /{id}/{field}
  Set a single field of a bookmark