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:
- In Zelt, go to *Settings → Security → Developer Hub → Build Apps, open your app and navigate to the App credentials page.
- Click Code flow. A new browser tab opens and asks for the app's permission.
- Click the Allow access, and a new browser tab opens the redirectURI.
- From the browser address bar, copy the value of the
codequery parameter. Make sure you copy the entire value. - Send a
POSTrequest tohttps://go.zelt.app/apiv2/oauth/authorize/tokenwith:- Auth type: Basic Auth
- Username: your Client ID
- Password: your Client secret
- Body (form encoded):
grant_type=authorization_codecode= the code you copied in step 3redirect_uri= the same URI you configured on the app credentials page (for examplehttps://google.com/)
- Auth type: Basic Auth
- On success, the response contains an
access_tokenandrefresh_token. Use this value as theBearer tokenin 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/"