Introduction
Getting Started
Get started by reaching out to the Carbon Trail team at support@carbontrail.net to get an application provisioned for your organization.
Once an application is provisioned, the appropriate credentials will be sent to you via email. You can then use these credentials to access the API.
You will also be provided the unique organization ID for your organization in the Carbon Trail platform as that will be needed to access the API.
Authentication
The API uses OAuth2 authentication with the client_credentials grant type.
How to get a token
To get a token, you will need to send a POST request to the /oauth/token endpoint with the following parameters:
grant_type: set toclient_credentialsclient_id: the client ID provided to you by the Carbon Trail teamclient_secret: the client secret provided to you by the Carbon Trail teamaudience: set tohttps://api.carbontrail.net/partner
For example, using curl:
curl -X POST \
https://auth.carbontrail.net/oauth/token \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&audience=https://api.carbontrail.net/partner'
The response will contain the access token, which you can use to authenticate subsequent requests to the API.
Authorization
By default, the application will be allowed access to all the APIs. If you'd like to restrict access to specific APIs, let us know when you submit your request to our team and we can grant only the required appropriate permissions to the application.