Reporting authentication

Start by generating a reporting token to make reporting API requests. Make a HTTP POST request to the relevant endpoint + /api/oauth/token/. Use a reporting access token.


curl --location --request POST '' 
--header 'Content-Type: application/x-www-form-urlencoded' 
--data-urlencode 'grant_type=client_credentials' 
--data-urlencode 'client_id=<reporting_key>'
--data-urlencode 'client_secret=<reporting_secret>’


Try it out

If your request was successful you will receive a reporting token like this in the response eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElkIjoxLCJzY29wZSI6WyJwYXkiXSwiaXNzIjoiaHR0cDovL2FwcC5kZXYucGF5dnluZS5zeXN0ZW1zIiwiZXhwIjoxNTg2MzY5NzExLCJpYXQiOjE1ODYzNjYxMTEsImF1dGhvcml0aWVzIjpbIlJPTEVfUEFZIl0sImp0aSI6ImExY2UzZjdmLTE3MzItNDhmNC04NTI3LTA5NWQ5NjlhNjkzNSIsImNsaWVudF9pZCI6IllNUFE2aDZQYTNaYmpEMXplbkQ0eXcifQ.g3XSXftyHvlCL1z1tlW6khboY7hzbiZVZgIzKHF2Rdc


Helpful to know

Reporting tokens expire after 60 minutes and can be used for multiple calls during this period. In order to prevent unnecessary processing you should store the reporting token generated and use it for all calls during the 60 minute period. After it expires you should request a new token.