Authentication and Certificates
Get authenticated and start making API requests with the Carbon Calculators.
mTLS
To securely authenticate, the API uses mutual TLS (mTLS) to ensure that both the client and server are who they say they are. You’ll need a certificate and private key to make requests to the API.
Getting a Certificate
To get a certificate, you’ll need to generate a Certificate Signing Request (CSR) and send it to us. We’ll then sign the CSR and send you back a certificate.
Note: You’ll need to replace your organisation name in the command below.
Email the CSR file (and ONLY the CSR, never disclose your private key to anyone, including us) to contact@aginnovationaustralia.com.au.
Making Requests
Now that you have a private key and certificate, you can make requests to the API. Here’s an example using cURL:
You’ll need to implement the same certificate and key usage in your application to authenticate with the API. We have some example implementations, so if you’re having trouble just let us know what you’re using and we’ll help you out.
User Agent Header
In order for the server to accept your requests, you’ll need to specify a user agent. We recommend you set this to the name of your organisation, for example:
If you do not specify a user agent, you will get a 403 response with a body like:
This is not the only reason that you might get this message, but it is the most common scenario where integration partners experience this issue.
Validating Responses
Responses will come back signed with our certificate. You can validate the response by checking:
- The certificate is not expired.
- The certificate is trusted by your operating system’s trust store.
- The certificate’s common name is
*.aiaapi.com
.
For example, here’s code that will do this for various languages (more coming soon!):
Need Help?
Email us at contact@aginnovationaustralia.com.au and we’ll do our best to reply within 48 hours.