In order to consume Zendesk data using REST API you can use different methods. Now lets see how to create OAuth Application so you don’t have to rely on static Token or use UserID / Password to access data.
OAuth method is more secure and recommended over other methods so whenever possible you should use that method.
Create Zendesk OAuth Application
To create OAuth App for Zendesk perform following steps.
- Login to your Zendesk Portal. And go to following URL (This step assume you have admin rights to create OAuth App)
- After click on plus sign and enter app information (e.g. Display name, Unique ID also known as ClientId or AppId )
- All the way bottom of that page you will see Secret (i.e. Client Secret). Save that along with unique identifier for later use.
- That’s it. Now you can start using Zendesk OAuth App to access REST API
In the next section you will learn how to configure OAuth connection. During that you will need to specify scopes (Token Permissions you want to grant).
Syntax to define scope is as below. Scope can be read, write or read and write. Resource is optional part. If you omit scope will be applied for all.
You can use following resource use scope to the following resources:
- auditlogs (read only)
Examples of scopes for Zendesk Tickets APIs
users:read users:write organizations:write
Examples of scopes for Zendesk Chat APIs
Calling Zendesk REST API using SSIS PowerPack OAuth Connection
Here is how you can use Zerndesk OAuth to access API using SSIS PowerPack JSON / REST Source
- First drag ZS JSON Source from SSIS Toolbox inside Data Flow designer
- Configure JSON Source as below. Make sure you change URL as per your domain.
URL for Zendesk Tickets API
- Configure OAuth Connection As below for Zendesk Ticket API. Scopes are different for Ticket and Chat APIs, please enter appropriately.
- Configure OAuth Connection As below for Zendesk Chat API. Scopes are different for Ticket and Chat APIs, please enter appropriately.
- After you set necessary parameters click Generate Token (Login using your account with necessary permission needed to access data) OAuth 2.0 Flow (Google API Example)
- Configure Pagination parameters as below
- Select Filter
- Click Preview to test
Adding Retry Settings for HTTP or OAuth connection
Zendesk enforces API rate limit which means you cannot issue too many API calls in a given time frame. Check this document for exact information.
ZappySys provides API retry settings on both OAuth Connection and HTTP Connection. For Zendesk you can retry on a specific status code 429
- Open connection manager UI
- Go to Retry-Settings page
- Select Retry web error on matching response status code.
- Enter 429 for status code
- Check multiply wait time
- In the wait time enter 5000 (wait 5 seconds or multiple of 5 seconds)
- Set Max retry count as 6
See below example (Its not for Zendesk but will give you an idea)