Comments - readmill/API GitHub Wiki

This is the documentation for v1 of the Readmill API which is deprecated and will be discontinued on 2012-12-16. Please upgrade to v2, the new developer documentations are at developers.readmill.com.

Comments

This part of the API has to do with interacting with comments.

Available endpoints

  • /comments/#{id}, GET, PUT, DELETE

Representation

An example of the JSON representation of a comment below,

{
    "id":1,
    "user":
    {
        "id":2,
        "username":"henrik",
        "firstname":"Henrik",
        "fullname":"Henrik Berggren",
        "avatar_url":"http://static.readmill.com/avatars/c4f503989a8115d83d198c8dd2635ef4-medium.png?1320247666",
        "permalink_url":"http://api.readmill.com/users/2",
        "followers":338,
        "followings":220,
        "uri":"http://api.readmill.com/users/2",
        "permalink_url":"http://readmill.com/henrik"
    },
    "reading_id":40,
    "highlight_id":null,
    "content":"Great beginning so far. I really want to go to India and Mombai now...",
    "posted_at":"2010-12-29T10:30:10Z",
    "uri":"http://api.readmill.com/comments/1"
}

API Calls

GET /comments/#{id}

Retrieves the representation of a single comment.

Parameters

  • id: The id of the comment.

Authentication

  • client_id
  • access_token (optional)

Response

  • Success: 200 and a comment.
  • Failure: 404

Examples

curl http://api.readmill.com/comments/1?client_id=CLIENT_ID


PUT /comments/#{id}

Update a comment

Parameters

  • id (integer): The id of the comment to update.
  • comment[content] '(string): The content of the comment.

Authentication

  • access_token

Response

  • Success: 200
  • Failure: 422

Examples

curl -X PUT http://api.readmill.com/comments/370?access_token=TOKEN -H 'Content-Type: application/json' -d '{"comment": {"content": "An updated comment"}}'


DELETE /comments/#{id}

Deletes a comment

Parameters

  • id: The id of the comment to delete.

Authentication

  • access_token

Response

  • Success: 200
  • Failure: 404

Examples

curl -X DELETE http://api.readmill.com/comments/370?access_token=TOKEN