Before you begin
You need your OAuth client ID and client secret. The API base URL ishttps://api.kapa.energy.
Get an access token
SetKAPA_CLIENT_ID and KAPA_CLIENT_SECRET in your environment, then send a client credentials request:
access_token, token_type, and expires_in.
Set KAPA_ACCESS_TOKEN to the returned access token. Request a new token when it expires.
Authenticate requests
SendAuthorization: Bearer <access_token> with every request except POST /token.
Use the token to read battery information.
Errors
Token requests return OAuth errors as JSON. A400 response indicates an invalid token
request, such as an unsupported grant type. A 401 response with invalid_client
indicates an unknown client or an incorrect secret.
Other API endpoints return 401 with the Problem Details code unauthorized when
your token is missing, invalid, or expired. Request a new token when it expires.