Post Bookmarks

Endpoints:

Bookmarking is an action for users to keep track of posts. You can see others' bookmarks as well.

GET /users/{user_id}/bookmarks

Token: user

Scope: any

Retrieve a list of bookmarks made by the specified user.

Returned posts may include a note string field if looking up bookmarks made by the authorized user.

URL Parameters

Name Description
user_id What user's bookmarks to look up
Example
curl "https://api.pnut.io/v1/users/1/bookmarks" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns a list of posts.

{
    "meta": {
        "more": false,
        "max_id": "0",
        "min_id": "0",
        "code": 200
    },
    "data": [
        {"...Post Object..."}
    ]
}

PUT /posts/{post_id}/bookmark

Token: user

Scope: write_post

Bookmark a post.

URL Parameters

Name Description
post_id Post to bookmark

PUT Body Data

Name Description
note Optional 128-character note that will only be visible when a user retrieves their own bookmarks. It is not escaped.
Example
curl "https://api.pnut.io/v1/posts/2375/bookmark" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "Content-Type: application/json" \
    -d "{\"note\": \"Robert has great posts.\"}" \
    -X PUT \
    -H "X-Pretty-Json: 1"

Returns the bookmarked post.

{
    "meta": {
        "code": 200
    },
    "data": {"...Post Object..."}
}

DELETE /posts/{post_id}/bookmark

Token: user

Scope: write_post

Delete a bookmark.

URL Parameters

Name Description
post_id Post to delete a bookmark for
Example
curl "https://api.pnut.io/v1/posts/2375/bookmark" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -X DELETE \
    -H "X-Pretty-Json: 1"

Returns the post a bookmark was removed from.

{
    "meta": {
        "code": 200
    },
    "data": {"....Post Object..."}
}