Environments & Introduction
Various Environments
Use our Demo Environment as any customer starting your integration:
| API | URL |
|---|---|
| Token API | https://login.demo-eks.snpd.io/oauth/token |
| Snapdocs QC API | https://api.cs-demo0.snpd.io/api/v1/qc/ |
| Audience | https://api.*.snpd.io |
Once the integration is complete, you can then switch to Production Environment.
| API | URL |
|---|---|
| Token API | https://login.snapdocs.com/oauth/token/ |
| Snapdocs QC API | https://api.snapdocs.com/api/v1/qc/ |
| Audience | https://api.snapdocs.com |
Use our Integrator Environment if you are a partner and were given the integrator keys to cx-int0:
| API | URL |
|---|---|
| Token API | https://login.demo-eks.snpd.io/oauth/token |
| Snapdocs QC API | https://api.cx-int0.snpd.io/api/v1/qc/ |
| Audience | https://api.*.snpd.io |
Authenticate with Snapdocs QC
Snapdocs QC uses OAuth 2.0 for authentication. Specifically, we use the OAuth 2.0 Client Credentials grant type, which means when you authenticate with Snapdocs QC, you must pass these client credentials:
- Client Id
- Client Secret
- Grant Type
- Audience
Client Credentials
You cannot retrieve your client credentials from Snapdocs QC directly. However, your Customer Success Manager can provide them.
Your client credentials carry many privileges, so be sure to keep them secure. Because they aren’t available as a secure download, we have some recommendations for how to distribute them securely with your team:
Leverage Gmail’s Confidential Mode to share the client credentials with one-day expiry and enable an SMS passcode for the recipient. Store client credentials under password protection. Use a file protected with a 14+ character password. Securely share the file and password separately.
Audience
The API you intend to call using a token generated by this request, example https://api.snapdocs.com
Grant Type
Use value "client_credentials" for grant type.
"grant_type": "client_credentials"
Example Authentication Request
This example code demonstrates the API requests to retrieve an OAuth access token and use it in the following requests to Snapdocs QC.
from requests import Session token_url = "https://login.demo-eks.snpd.io/oauth/token" test_api_url = "https://api.cs-demo0.snpd.io/api/v1/subscriptions" client_id = 'CLIENT_ID_HERE' client_secret = 'CLIENT_SECRET_HERE' audience = 'https://api.*.snpd.io' data = { "client_id": client_id, "client_secret": client_secret, "audience": audience, "grant_type": "client_credentials" } s = Session() access_token_response = s.post(token_url, data=data) access_token_response.raise_for_status() print(access_token_response) tokens = access_token_response.json() print("access token: " + tokens['access_token']) #step B - with the returned access_token we can make as many calls as we want api_call_headers = {'Authorization': 'Bearer ' + tokens['access_token']} api_call_response = s.get(test_api_url, headers=api_call_headers) api_call_response.raise_for_status() print(api_call_response.text)
Verify the Access Token
If you have questions of the access token or need to inspect it, you can copy the value to https://jwt.io to decode it.