The most obvious use case for the Readability API is to be able to add a bookmark into a user's queue. Here's how it's done:
Request
POST /api/rest/v1/bookmarks
Content-Type: application/x-www-form-urlencoded
url=http://blog.arc90.com/2010/11/30/silence-is-golden/&favorite=1
Response
HTTP/1.0 202 Accepted
Location: /api/rest/v1/bookmarks/119
X-Article-Location: /api/rest/v1/articles/xj28dwkx
You can browse to the new bookmark at the URI returned in the Location header:
Request
GET /api/rest/v1/bookmarks/119 HTTP/1.1
Response
HTTP/1.1 200 OK
Date: Thu, 12 Oct 2010 20:13:58 GMT
Last-Modified: Wed, 12 Oct 2010 12:39:02 -0500
Content-Type: application/json
{
"user_id": 1,
"read_percent": "0.0",
"date_updated": "2010-10-12 13:38:33",
"favorite": true,
"article": {
"domain": "blog.arc90.com",
"title": "Silence is Golden",
"url": "http://blog.arc90.com/2010/11/30/silence-is-golden/",
"lead_image_url": null,
"author": "Tim Meaney",
"excerpt": "I’ve been building software for 15 years and continue to be…",
"direction": "ltr",
"word_count": 1094,
"date_published": "2010-11-30 00:00:00",
"dek": null,
"processed": true,
"id": "tg8if9uj"
},
"id": 119,
"date_archived": null,
"date_opened": null,
"date_added": "2010-10-12 13:38:33",
"article_href": "/api/rest/v1/articles/tg8if9uj",
"date_favorited": "2010-10-12 13:38:33",
"archive": false
}
Example root representation. (application/json)
{
"resources": {
"bookmarks": {
"description": "The Bookmarks Collection Resource",
"href": "/api/rest/v1/bookmarks"
},
"contributions": {
"description": "The Contributions Collection Resource",
"href": "/api/rest/v1/contributions"
},
}
}
Example article representation. (application/json)
{
"domain": "www.newyorker.com",
"next_page_href": null,
"author": "Tim Parks",
"url": "http://www.newyorker.com/arts/critics/atlarge/2011/04/11/110411crat_atlarge_parks?currentPage=all",
"lead_image_url": "http://www.newyorker.com/images/2011/04/11/p233/110411_r20743_p233.jpg",
"content_size": 29426,
"title": "Booted",
"excerpt": "Italian voters used to be charmed by Berlusconi’s libertine ways. Anniversaries are uplifting when you have something to c",
"direction": "ltr",
"word_count": 4291,
"content": "<div><p>[article content here]</p></div>",
"date_published": "2011-04-11 00:00:00",
"dek": "What really ails Italy?",
"processed": true,
"short_url": "http://rdd.me/47g6s8e7",
"id": "47g6s8e7"
}
Example bookmarks representation. (application/json)
{
"conditions": {
"opened_since": null,
"added_until": null,
"opened_until": null,
"archived_until": null,
"favorite": null,
"archived_since": null,
"favorited_since": null,
"user": "jdoe",
"per_page": 2,
"favorited_until": null,
"archive": null,
"added_since": null,
"order": "-date_added",
"page": 1,
"updated_since": null,
"updated_until": null
},
"meta": {
"num_pages": 38,
"page": 1,
"item_count_total": 76,
"item_count": 2
},
"bookmarks": [
{
"user_id": 1,
"read_percent": "0.0",
"date_updated": "2010-10-12 11:38:39",
"favorite": false,
"article": {
"domain": "adobe.com",
"excerpt": "This is an excerpt of the article text, 200 chars or less…",
"word_count": 3482,
"processed": true,
"id": 87,
"title": "A brief overview of the Spark architecture and component set"
"lead_image_url": "http://www.adobe.com/images/2011/04/11/p233/110411_r20743_p233.jpg",
"author": "John Smith",
"direction": "ltr",
"date_published": "2011-04-11 00:00:00",
"dek": null,
"url": "http://www.adobe.com/devnet/flex/articles/flex4_sparkintro.html"
},
"id": 76,
"date_archived": null,
"date_opened": null,
"date_added": "2010-10-12 11:38:29",
"article_href": "/api/rest/v1/articles/87/",
"date_favorited": null,
"archive": false
},
{
"user_id": 1,
"read_percent": "0.13",
"date_updated": "2010-10-12 11:04:46",
"favorite": false,
"article": {
"domain": "w3.org",
"excerpt": "This is an excerpt of the article text, 200 chars or less…",
"word_count": 3482,
"processed": true,
"id": 86,
"title": "Web Application Description Language"
"lead_image_url": null,
"author": null,
"direction": "ltr",
"date_published": null,
"dek": null,
"url": "http://www.w3.org/Submission/wadl/"
},
"id": 75,
"date_archived": null,
"date_opened": null,
"date_added": "2010-10-12 11:04:46",
"article_href": "/api/rest/v1/articles/86/",
"date_favorited": null,
"archive": false
}
]
}
Example deleted bookmarks representation. (application/json)
{
"bookmarks": [
{
"user_id": 1,
"read_percent": "0.00",
"date_updated": "2011-12-07 13:42:06",
"favorite": true,
"article": null,
"id": 486,
"date_archived": null,
"deleted": true,
"date_opened": null,
"date_added": "2011-12-05 17:27:32",
"article_href": null,
"date_favorited": "2011-12-05 17:37:45",
"archive": false
},
{
"user_id": 1,
"read_percent": "0.00",
"date_updated": "2011-12-12 09:43:54",
"favorite": false,
"article": null,
"id": 481,
"date_archived": null,
"deleted": true,
"date_opened": null,
"date_added": "2011-02-23 00:00:00",
"article_href": null,
"date_favorited": null,
"archive": false
}
],
"meta": {
"num_pages": 1,
"page": 1,
"item_count_total": 2,
"item_count": 2
},
"conditions": {
"opened_since": null,
"favorited_since": null,
"domain": "",
"updated_until": null,
"exclude_accessibility": "",
"archived_until": null,
"favorite": null,
"opened_until": null,
"archived_since": null,
"added_until": null,
"updated_since": null,
"user": "jdoe",
"per_page": 20,
"favorited_until": null,
"order": "-date_added",
"only_deleted": 1,
"archive": null,
"added_since": null,
"page": 1
}
}
Example Bookmarks POST Representation (application/x-www-form-urlencoded)
url=http%3A%2F%2Fwww.w3.org%2FSubmission%2Fwadl%2F&favorite=1&archive=0
Example bookmark representation. (application/json)
{
"user_id": 1,
"read_percent": "0.13",
"date_updated": "2010-10-12 11:04:46",
"favorite": false,
"article": {
"domain": "www.newyorker.com",
"title": "Booted",
"url": "http://www.newyorker.com/arts/critics/atlarge/2011/04/11/110411crat_atlarge_parks?currentPage=all",
"lead_image_url": "http://www.newyorker.com/images/2011/04/11/p233/110411_r20743_p233.jpg",
"author": "Tim Parks",
"excerpt": "Italian voters used to be charmed by Berlusconi’s libertine ways. Anniversaries are uplifting when you have something to …",
"direction": "ltr",
"word_count": 4291,
"date_published": "2011-04-11 00:00:00",
"dek": "What really ails Italy?",
"processed": true,
"id": "47g6s8e7"
},
"id": 75,
"date_archived": null,
"date_opened": null,
"date_added": "2010-10-12 11:04:46",
"article_href": "/api/rest/v1/articles/86/",
"date_favorited": null,
"archive": false
}
Example Bookmark POST Representation (application/x-www-form-urlencoded)
favorite=1&archive=0&read_percent=0.2
Example contributions representation. (application/json)
{
"conditions": {
"domain": null,
"since": "2010-09-01",
"page": 1,
"user": "jdoe",
"per_page": 10,
"until": "2010-10-01"
},
"meta": {
"num_pages": 1,
"page": 1,
"item_count_total": 5,
"item_count": 5
},
"contributions": [
{
"date": "2010-09-01",
"contribution": "1.33",
"user": "jdoe",
"domain": "www.nytimes.com",
"num_bookmarks": 1
},
{
"date": "2010-09-01",
"contribution": "1.33",
"user": "jdoe",
"domain": "www.engadget.com",
"num_bookmarks": 1
},
{
"date": "2010-09-01",
"contribution": "1.33",
"user": "jdoe",
"domain": "paulgraham.com",
"num_bookmarks": 1
},
{
"date": "2010-09-01",
"contribution": "1.33",
"user": "jdoe",
"domain": "voices.washingtonpost.com",
"num_bookmarks": 1
},
{
"date": "2010-09-01",
"contribution": "2.67",
"user": "jdoe",
"domain": "gizmodo.com",
"num_bookmarks": 2
}
]
}
Example user representation for the current user. (application/json)
{
"username": "jdoe",
"first_name": "John",
"last_name": "Doe",
"date_joined": "2010-10-08 12:00:17",
"has_active_subscription": false,
"reading_limit": 20
}