User Lookup

Endpoints:

GET /users/{user_id}

Scope: none

Retrieve a user object.

URL Parameters

Name Description
user_id User ID or username with "@" symbol of the user to retrieve
Example
curl "https://api.pnut.io/v0/users/1" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns the user object

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

GET /users

Scope: none

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

Query String Parameters

Name Description
ids Comma-separated list of user IDs. IDs are required; no other identifiers are allowed.
Example
curl "https://api.pnut.io/v0/users?ids=4,12,1000" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns a list of users

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

GET /apps/me/users/ids

Token: app

Retrieve a list of all user IDs that authorize the requesting app. It is not paginated.

Requires an app token.

Example
curl "https://api.pnut.io/v0/apps/me/users/ids" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns a list of user IDs

{
  "meta": {
    "code": 200
  },
  "data": [
    "user_id",
    "user_id",
    "user_id"
  ]
}

GET /apps/me/users/tokens

Token: app

Retrieve a list of all user token objects that authorize the requesting app. Not currently paginated.

Requires an app token.

Example
curl "https://api.pnut.io/v0/apps/me/users/tokens" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns a list of user tokens

{
  "meta": {
    "code": 200
  },
  "data": [
    {"..User Token..."},
    {"..User Token..."},
    {"..User Token..."}
  ]
}