-
Notifications
You must be signed in to change notification settings - Fork 9
API Rankings
Brady Rudesill edited this page Nov 13, 2015
·
7 revisions
- Responds with a 401 if unauthorized
- Responds with a maximum of 11 rankings around the authenticated user, from the requested leaderboard, 5 above, the user themselves and 5 bellow the user.
- It includes user information with the response.
// request format
{
type: <'everyone'|'state'|'friends'>
}
// response format
data: [{
id: <ranking_id>,
type: 'rankings',
attributes: {
rank: <rank>,
score: <score>,
},
relationships: {
user: { data: { id: <user_id>, type: 'users' } }
}
}, /*once for each ranking*/],
included: [{
id: <user_id>,
type: 'users',
attributes: {
email: <email>,
password: <password>,
first_name: <first_name>,
last_name: <last_name>,
state_code: <state_code>,
lat: <geographic_latitude>,
lng: <geographic_longitude>,
photo_thumb_url: <thumbnail_photo_url>,
photo_large_url: <full_size_photo_url>
}
}, /*once for each user*/]