Badges
Endpoints:
Badges are accessible to users who are current badge holders.
A user can set what badge to display on their profile from their account, or a client can update it by updating the user.
GET /badges/{badge_id}
Scope:
Retrieve a badge object.
Example
curl "https://api.pnut.io/v1/badges/1" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "X-Pretty-Json: 1"
Returns the badge object
{
"meta": {
"code": 200
},
"data": {
"id": "0",
"name": "String",
"description": "String"
}
}
GET /badges
Scope:
Retrieve a list of all badges. It is not paginated.
Example
curl "https://api.pnut.io/v1/badges" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "X-Pretty-Json: 1"
Returns a list of badges
{
"meta": {
"code": 200
},
"data": [
{
"id": "0",
"name": "String",
"description": "String"
}
]
}
GET /users/me/badges
Token:
Scope:
Retrieve a list of all badges for the authenticated user. It is not paginated.
Example
curl "https://api.pnut.io/v1/users/me/badges" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "X-Pretty-Json: 1"
Returns a list of badges in order of most recently awarded.
{
"meta": {
"code": 200
},
"data": [
{
"id": "0",
"name": "String",
"description": "String",
"awarded_at": "ISO 8601"
}
]
}