# Postman Guide
This guide describes the OAuth 2.0 Authorization Code Flow with the “DocCheck Access – OAuth2” Postman collection to obtain an access token and call protected user data.
# Purpose
- Obtain an authorization code → exchange it for an access token → call the user data endpoint.
# Prerequisites
- DocCheck client credentials (
client_id,client_secret) - Registered
redirect_uri(must exactly match the URL registered with DocCheck) - Postman installed
# License differences
# Basic
- You can fetch an access token (Authorization Code → Token Exchange).
- Passing
stateorscopesis not allowed. - Important:
scopeandstatemust be disabled in all requests (do not send them), not just left empty. - Access to the user data endpoint is not included in the Basic license.
# Economy & Business
- You can pass and validate the
stateparameter. - You can set/request
scopes. - The access token can additionally be used to retrieve user data from the
user_data_urlendpoint.
# Preparation: Set collection variables
Open the collection in Postman and fill in the following values under “Variables”:
client_id: your client IDclient_secret: your client secretredirect_uri: your registered redirect URLscopes: desired scopes (Economy/Business only; do not use in Basic and disable in requests)state: random string for CSRF protection (Economy/Business only; do not use in Basic and disable in requests)auth_code: leave empty; it will be set after step 1auth_url:https://auth.doccheck.com/en/authorize?token_url:https://auth.doccheck.com/tokenuser_data_url:https://auth.doccheck.com/api/users/data
Basic license
Even if scopes/state variables are empty, Postman may still send empty query parameters. Disable these parameters in the respective request (in the “Params” tab, uncheck the box or remove the row) so that they are not transmitted.
# Flow
# 1. Request authorization code (request “Auth”)
- Open the “Auth” request.
- Review the query parameters. They reference the variables above.
- Basic: Disable/remove the
scopeandstateparameters in the “Params” tab so they are not present in the URL. - Open the full URL in the browser (in Postman via “Open in browser” or by copying the URL).
- Log in to DocCheck and grant consent.
- After the redirect to your
redirect_uri, copy thecodeparameter from the target URL. For Economy/Business, also verifystate. - Paste the value into the
auth_codecollection variable.
# 2. Fetch access token (request “Token”)
- Open “Token” (
POST https://auth.doccheck.com/token). - Body:
x-www-form-urlencodedwith:client_id=client_secret=grant_type=authorization_codecode=redirect_uri=
- Send the request. The expected response includes
access_token,token_type,expires_inand possiblyrefresh_token.
Optional: Automatically store the token as a collection variable in the “Tests” tab of the “Token” request:
pm.collectionVariables.set('access_token', pm.response.json().access_token);
# 3. Call protected resource (request “Userdata”)
License requirement
This step is available for Economy/Business only. In the Basic license, access to the user data endpoint is not provided.
- Open “Userdata” (
GET https://auth.doccheck.com/api/users/data). - Set authentication:
- Simple: “Authorization” tab → Type “Bearer Token” → paste the
access_tokenmanually from step 2 or useif stored via test. - Alternatively via header:
Authorization: Bearer <access_token>.
- Simple: “Authorization” tab → Type “Bearer Token” → paste the
- Send the request. Expected response:
200 OKwith user data, depending on scopes and grants.
# Scopes
- Applies to Economy/Business. In Basic,
scopesare not available and must be disabled (do not send the parameter). - Choose scopes according to the license model. Empty
scopesmean no scopes are requested during login and, consequently, no additional data is available at the user data endpoint. Refer to DocCheck’s documentation for exact scope names.
# Optional: Use Postman’s built-in OAuth 2.0 flow
In a request’s “Authorization” tab, select Type “OAuth 2.0” → “Get New Access Token”:
- Auth URL:
- Access Token URL:
- Client ID:
- Client Secret:
- Scope:
- State:
- Redirect URI: your registered
redirect_uri - Enable “Authorize using browser” → log in → “Use Token”.
Note:
- Economy/Business: Fill
Scope/Stateas needed. - Basic: Leave
ScopeandStatecompletely empty and ensure they do not appear in the generated authorization URL (no&scope=/&state=). If necessary, verify/remove them in the request’s auth helper before authorizing.