A Client ID and Client Secret is required to access these APIs. To request access please reach out to: data.services@servictoria.com.au
A different set of credentials will be provided for the Test and Production environments.
This API supports the OAuth 2.0 client credentials flow for authentication, which has the following high level steps:
- Use Client ID and Client Secret to get an access token from token endpoint.
- Call API with access token included in the authorization header.
To get a token for the Test environment use:
- Token endpoint: https://stg.auth.servictoria.com.au/oauth/token
- Audience: https://test.api.servictoria.io/vicland/ddp
Example:
curl --request POST \
--url 'https://stg.auth.servictoria.com.au/oauth/token' \
--header 'content-type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials \
--data client_id=YOUR_CLIENT_ID \
--data client_secret=YOUR_CLIENT_SECRET \
--data audience='https://test.api.servictoria.io/vicland/ddp'To get a token for the Production environment use:
- Token endpoint: https://auth.servictoria.com.au/oauth/token
- Audience: https://api.servictoria.io/vicland/ddp
Example:
curl --request POST \
--url 'https://auth.servictoria.com.au/oauth/token' \
--header 'content-type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials \
--data client_id=YOUR_CLIENT_ID \
--data client_secret=YOUR_CLIENT_SECRET \
--data audience='https://api.servictoria.io/vicland/ddp'On successfully sending the request, you’ll get back a response that includes an access_token. Example:
{
"access_token": "example-308ryntpiwepfnr-jw3-rj3rh34h0trh834thnf3wrh3df-truncated",
"scope": "obj1:read obj2:read obj2:write",
"expires_in": 3600,
"token_type": "Bearer"
}Once obtained an access token can be cached and reused until it expires. The expiry time can be calculated by taking a timestamp prior to requesting the access token and adding expires_in seconds.
To call this API include the access token in the 'authorization' header with the prefix: 'Bearer '. Example:
curl --request GET \
--url https://test.api.servictoria.io/example \
--header 'authorization: Bearer ACCESS_TOKEN'For more information see: