Post Lookup

Endpoints:

GET /posts/{post_id}

Scope: none

Retrieve a post object.

URL Parameters

Name Description
post_id Post to retrieve
Example
curl "https://api.pnut.io/v1/posts/20" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns a post

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

GET /posts

Scope: none

Retrieve a list of specified post objects. Only retrieves the first 200 found.

Query String Parameters

Name Description
ids Comma-separated list of post IDs.
Example
curl "https://api.pnut.io/v1/posts?ids=20,21,4" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns a list of posts

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

GET /posts/{post_id}/revisions

Scope: none

Retrieve a list of previous versions of a post, not including the most recent. Currently a post can only have one previous version.

Revisions returned will have revision as a String number indicating which version of the post it is. Revisions start at "0".

URL Parameters

Name Description
post_id Post ID to retrieve any revisions of
Example
curl "https://api.pnut.io/v1/posts/2392/revisions" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns a list of posts

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