User Following

Endpoints:

GET /users/{user_id}/following

Scope: any

Retrieve a list of user objects that the specified user is following.

URL Parameters

Name Description
user_id ID of the user whose following to retrieve

Query Parameters

Sort

Name Description
order One of id, last_post_id, or followed_at. Default is by followed_at
Example
curl "https://api.pnut.io/v1/users/3/following?count=2" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns a list of users

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

GET /users/{user_id}/followers

Scope: any

Retrieve a list of user objects that are following the specified user.

URL Parameters

Name Description
user_id ID of the user whose followers to retrieve

Query Parameters

Sort

Name Description
order One of id, last_post_id, or followed_at. Default is by followed_at
Example
curl "https://api.pnut.io/v1/users/@shawn/followers?count=2" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns a list of users

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

PUT /users/{user_id}/follow

Token: user

Scope: follow

Follow a user.

URL Parameters

Name Description
user_id ID of the user to follow
Example
curl "https://api.pnut.io/v1/users/246/follow" \
    -X PUT \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns the followed user

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

DELETE /users/{user_id}/follow

Token: user

Scope: follow

Unfollow a user.

URL Parameters

Name Description
user_id ID of the user to unfollow
Example
curl "https://api.pnut.io/v1/users/246/follow" \
    -X DELETE \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns the unfollowed user

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