To make requests to the API a Bearer JWT token will need to be generated and attached to every API request.
Client Credentials
A Client ID and a Client Secret will be provided to you during Partner and Scanning devices on boarding.
Keep the Client Secret stored securely
Using the provided Client ID and Client Secret make a request to https://auth.prismlabs.tech/oauth/token to generate a Bearer token to be used when making request to Prism API.
Sandbox vs. Production
The url to generate the access token will always be https://auth.prismlabs.tech/oauth/token.
The audience value will change depending on environment:
https://sandbox-api.prismlabs.tech/ when using sandbox credentials
https://api.prismlabs.tech/ when using production credentials
Extract and cache the access_token until it expires for requests to the API. Failure to cache may result in additional costs or revoking access to Prism API.
From now on, every time you make a call to our API endpoints attach the cached access_token as a Bearer token to the Authorization header.
'Authorization: Bearer GENERATED_ACCESS_TOKEN'
Below you can find sample code for an example of creating a new user via the /users endpoint: