Before you begin
You need your OAuth client ID, client secret, and the ID of a battery accessible to your client. 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.
Read battery information
SetKAPA_BATTERY_ID to your battery ID, then send the token in the Authorization header: