Get an authorization code

Use this flow to get an authorization code from your app and exchange it for an access token you can use in all Zelt API requests.

Before you create an auth code, please make sure you set the proper permission to your app. Then, follow the steps below:

  1. In Zelt, go to *SettingsSecurityDeveloper HubBuild Apps, open your app and navigate to the App credentials page.
  2. Click Code flow. A new browser tab opens and asks for the app's permission.
  3. Click the Allow access, and a new browser tab opens the redirectURI.
  4. From the browser address bar, copy the value of the code query parameter. Make sure you copy the entire value.
  5. Send a POST request to https://go.zelt.app/apiv2/oauth/authorize/token with:
    1. Auth type: Basic Auth
      1. Username: your Client ID
      2. Password: your Client secret
    2. Body (form encoded):
      1. grant_type = authorization_code
      2. code = the code you copied in step 3
      3. redirect_uri = the same URI you configured on the app credentials page (for example https://google.com/)
  6. On success, the response contains an access_token and refresh_token . Use this value as the Bearer token in all Zelt API requests:Authorization: Bearer <access_token>
curl -X POST https://go.zelt.app/apiv2/oauth/authorize/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -u CLIENT_ID:CLIENT_SECRET \
  -d "grant_type=authorization_code" \
  -d "code=AUTHORIZATION_CODE_FROM_STEP_3" \
  -d "redirect_uri=https://google.com/"