Skip to content

Authentication

Send your token as a bearer token on every request.

Terminal window
curl "https://app.ridebox.my/api/user" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json"

Refreshing returns a new token, with the same response as signing in, and revokes the one you sent. Save the new token straight away.

Terminal window
curl -X POST "https://app.ridebox.my/api/auth/refresh" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json"
Terminal window
curl -X POST "https://app.ridebox.my/api/auth/logout" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json"

This returns 204 and ends that token only.

A 401 response tells you what to do through its code field.

code Meaning What to do
token_expired The token passed its expires_at Sign in again
token_revoked The token is no longer valid Sign in again. Do not retry with this token
No code No token was sent Send the Authorization header

Changing the account password signs out every other token.

A token acts as the account that created it. Devices, rides and alerts owned by anyone else return 404.