Authentication
GET
/api/v1/me
Every request outside the status endpoint carries a token, as a bearer token in the Authorization header. Get one by registering or logging in through the API, or make one by hand in security settings.
A key acts as you, with exactly the access you have. Make one per integration, so you can revoke it alone.
Tokens do not expire. They are revoked rather than refreshed, either by logging out or from the security screen.
Rate limit
Sixty requests per minute, per user, shared by every key and device. Every answer carries the budget left in X-RateLimit-Remaining.
GET
curl https://friends.ban.is/api/v1/me \
-H "Authorization: Bearer $MONICA_TOKEN"
const response = await fetch('https://friends.ban.is/api/v1/me', {
headers: { Authorization: `Bearer ${token}` },
})
const data = await response.json()
$response = Http::withToken($token)->get('https://friends.ban.is/api/v1/me');
Response
200
{
"data": {
"type": "user",
"id": "1",
"attributes": {
"first_name": "Michael",
"last_name": "Scott",
"email": "michael.scott@dundermifflin.com"
},
"links": {
"self": "https://friends.ban.is/api/v1/me"
}
}
}
Keys act as you, with exactly the access you have. Make one per integration so you can revoke it alone.