Authentication
Login & Obtain Token
Changed onUse HTTP basic auth to exchange username and password for an access token. Remember that you need to include this token in an authorization bearer header for all subsequent data calls. This header has the form: Authorization: Bearer <your_token>
Note: Token expires after 30 minutes. If a data call returns HTTP 401 error code, you will need to call /login again to receive a new token.
get/login
Request
- Base URLhttps://api.watttime.org
- AuthHTTP basic
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Response
Successful Response
Example response
{
"token": "abcdef0123456789fedcabc"
}Changes
- info
the endpoint scheme security
BasicAuthwas added to the API - info
added the non-success response with the status
- info
added the non-success response with the status
- info