Authentication
This API requires authentication to access its endpoints. Authentication is managed using a bearer token in the HTTP Authorization header. The bearer token is a string that must be included in the Authorization header of each request to the API.
Receiving a Token
Follow these steps to obtain a bearer token:
- Ensure you are registered as a user with the API service.
- Send a POST request to the
/api/tokenendpoint with your registered username and password.
The API service will respond with an access token, a refresh token, and the token type. The access token is used to authenticate your requests to the API service. The refresh token is used to obtain a new access token when the current access token expires. The token type is always bearer.
Request Example
POST /api/token
Headers:
Content-Type: application/x-www-form-urlencoded
Form Data:
username: admin
password: admin
Full URL:
https://api.energypeople.com.au/api/token
Response Example
Status Code: 200 OK
Body:
{
"access_token": "eyJhbGciOiJIUzI1NiI...",
"refresh_token": "eyJhbGciOiJIUzI1NiI...",
"token_type": "bearer",
"carrier_type": ""
}