Using ZIS to obtain Zendesk OAuth token

In this tutorial you’ll learn how to obtain a Zendesk OAuth token using ZIS. You’ll also add the name zendesk to the OAuth token so it can be referenced in a ZIS Flow to make authenticated HTTP requests to various Zendesk APIs via ZIS Actions.

See also Obtaining an OAuth token in Developing a private ZIS integration.

Kick off a Zendesk OAuth flow

ZIS is used to kick off an OAuth flow to obtain and store the Zendesk access token which can be used later such as in ZIS Flows.

Use OAuth enabled Postman request and enter the below details:

  • Method: POST
  • URL: https://{{subdomain}}{{integration_key}}
  • Body:
    {  "allow_offline_access": true,  "oauth_client_name": "zendesk",  "oauth_url_subdomain": "{{subdomain}}",  "origin_oauth_redirect_url": "http://example.local",  "permission_scopes": "read write",  "name": "zendesk"}

Note: The origin_oauth_redirect_url property is used to redirect the user back to the original requester after ZIS has completed the OAuth flow with the provider. You can ignore this URL for this tutorial.

name is a human-readable identifier to refer to the access token in ZIS Flow. For example: "$.connections.zendesk.access_token".

For more details about this endpoint, see ZIS Connections API.

After making the request, ZIS returns a redirect_url in the response payload. Enter the URL in your web browser to take you through the process of completing an OAuth flow.

Note: The final redirection to the non-existent example URL (http://example.local) fails in this scenario. You’ll see an error in the browser something like this:

This is expected. You can close your browser window.

At this point, ZIS has obtained the Zendesk OAuth access token and stored it with the name value of "zendesk" you used during the kickoff. In a flow, this access token can be easily referenced as $.connections.zendesk.access_token.

In a real-world app, the process of kicking off an OAuth flow is commonly initiated from a frontend UI during the onboarding phase. The next tutorial explains the implementation details.

Next: Using ZIS Action to make authenticated requests