| 1 | = Bookmarks API = |
| 2 | {{{ |
| 3 | GET / |
| 4 | Lists the bookmarks |
| 5 | |
| 6 | Params: |
| 7 | format=json|xbel|text|csv|html |
| 8 | tag={tag} (repeatable) |
| 9 | limit={limit} |
| 10 | offset={offset} (only if limit is given) |
| 11 | |
| 12 | GET /{id} |
| 13 | Gets a individual bookmark |
| 14 | |
| 15 | GET /{id}/{field} |
| 16 | Gets an individual field of an individual bookmark |
| 17 | |
| 18 | GET /feed |
| 19 | Gets an Atom feed of the bookmarks |
| 20 | |
| 21 | Params: |
| 22 | tag={tag} (repeatable) |
| 23 | |
| 24 | POST / |
| 25 | Create or update a bookmark |
| 26 | |
| 27 | POST /{id} |
| 28 | Update a bookmark |
| 29 | }}} |
| 30 | == TODO == |
| 31 | {{{ |
| 32 | PUT /{id} |
| 33 | Create or update a bookmark; requires the entire resource representation to be given in JSON or XBEL |
| 34 | |
| 35 | DELETE /{id} |
| 36 | Delete a bookmark |
| 37 | |
| 38 | -- bookmarks that have been deleted |
| 39 | create table deleted_bookmarks ( |
| 40 | id integer, |
| 41 | dtime integer |
| 42 | ); |
| 43 | create view active_bookmarks as select * from bookmarks where id not in (select id from deleted_bookmarks) |
| 44 | |
| 45 | insert into deleted_bookmarks (id) values (?) <-- {id} |
| 46 | |
| 47 | then a request to /{id} checks the deleted_bookmarks table and issues a 410 (cacheable) if it is in there |
| 48 | |
| 49 | PUT /{id}/{field} |
| 50 | Set a single field of a bookmark |
| 51 | }}} |