When querying the Codat API, you may receive a 403 response when your credentials have not been correctly passed, or are incorrect.
Resolution
- Make sure you have the latest API key for your account, in case it has been refreshed by another user. You can find this on the 'profile' page when you have logged in to your Codat Portal.
- Make sure you have Base-64 encoded the API key - for convenience, if your library does not do this automatically for you, it is included on the profile page as well.
- Ensure you are passing the encoded API key as a HTTP header with they key 'Authorization':
{"Authorization" : "Basic XXXXXX"} - Ensure you are using the correct environment for your account (UAT vs PROD):
* For Production : https://api.codat.io
* For UAT: https://api-uat.codat.io
Examples
Python
import requests
header = {"Authorization" : "COPY YOUR BASE 64 ENCODED KEY HERE"}
r = requests.get("https://api.codat.io/profile", headers=header}
print(r.json())