- API credentials are machine credentials, not people credentials. Your company only needs one set of API credentials, not a set for every developer.
- If your company has different API credentials for every developer, you need to notify your Account Representative to delete old credentials when a developer leaves the company.
- API credentials can only be used by your application to log in through the APIs.
- You cannot use portal credentials with the APIs, and you can’t use API credentials to access the portals.
- API credentials do not expire.
Getting Keys
To Get Started with Mobility APIs
Your application must send an API token in the header of every API request. API uses the OAuth2 “client credentials” grant type, and requires that the API client_id andclient_secret are Base64 encoded.
- Read the documentation on what APIs are available.
- Contact customer support for your API credentials.
- Get API token information.
Notes
Getting Auth Token
Get an API Token
1. Encode your credentials
Concatenate the key and the secret with a colon between them, like this: client_id:client_secret. Then encode the entire string in Base64 format. (To learn more about encoding in Base64 format, visit https://www.rfc-editor.org/info/rfc4648/.)
2. Request a token
Send a POST request to okta.granitenet.com with the encoded string in the header.
Using the Token
Use the Token
The response contains an access_token and an expires_in value, the token lifetime in seconds. Reuse the token until it expires, then request a new one.
Send these headers with every API request:
Authorization: Bearer ACCESS_TOKEN, with the token you received.macnum, the Macnum of your organization’s top-level account.Content-Type: application/jsonwhen the request has a body.
If a request is rejected for access reasons, check the response:
401with an error body (Unauthorized): the token is missing, invalid or expired.401with an empty body: themacnumheader is not allowed for your token.403REQUEST_FAILED.Forbidden: the account in the request is not one you have access to, or does not belong to themacnumyou sent.