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/v1/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 or usernames with "@" symbol
Example
curl "https://api.pnut.io/v1/users?ids=4,@ludolphus,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/v1/apps/me/users/ids" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns a list of user IDs

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

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/v1/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..."}
  ]
}