The API uses OAuth 2.0 with PKCE and dynamic client registration for authentication.
Note: Basic authentication is deprecated and will be removed in a future update. Please migrate to OAuth 2.0.
client_idTip: Most OAuth 2.0 client libraries handle this flow automatically. Point your library at the server metadata endpoint
/.well-known/oauth-authorization-serverfor automatic configuration.
All endpoints below are relative to https://api.attendium.com.
Send a POST request to /oauth2/register. You only need to do this once per application.
POST /oauth2/register
Content-Type: application/json
{
"redirect_uris": ["https://yourapp.example.com/callback"],
"client_name": "My Application"
}
Save the client_id from the response — you need it for all subsequent requests.
Redirect URIs must use https, or http with a loopback address (localhost, 127.0.0.1, or ::1) for local development.
Generate a PKCE code verifier and challenge:
A-Z, a-z, 0-9, -, ., _, ~) — this is your code_verifiercode_challengeThen redirect the user to:
GET /oauth2/authorize?response_type=code
&client_id=your-client-id
&redirect_uri=https://yourapp.example.com/callback
&code_challenge=your-code-challenge
&code_challenge_method=S256
&state=random-state-value
The user logs in to Attendium and is redirected back to your redirect_uri with an authorization code and your state value.
POST /oauth2/token
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code
&client_id=your-client-id
&redirect_uri=https://yourapp.example.com/callback
&code=the-authorization-code
&code_verifier=your-code-verifier
The response includes an access_token and a refresh_token.
Include the access token in the Authorization header:
curl -H "Authorization: Bearer your-access-token" \
-H "Content-Type: application/json" \
-d '{"query": "{ me { id } }"}' \
https://api.attendium.com/graphql
The token response includes an expires_in field indicating how long the access token is valid. Use the refresh token to get a new access token before it expires:
POST /oauth2/token
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token
&client_id=your-client-id
&refresh_token=your-refresh-token