Introduction
Please visit this page to see all Pre-Configured ready to use API connectors which you can use in SSIS API Source / SSIS API Destination OR API ODBC Driver (for non-SSIS Apps such as Excel, Power BI, Informatica).
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)
1https://zappysys.zendesk.com/agent/admin/api/oauth_clients - 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
Understanding Scopes
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.
1 |
resource:scope |
You can use following resource use scope to the following resources:
- tickets
- users
- auditlogs (read only)
- organizations
- hc
- apps
- triggers
- automations
- targets
Examples of scopes for Zendesk Tickets APIs
1 2 3 4 5 6 |
read write read write users:read users:read users:write users:read users:write organizations:write |
Examples of scopes for Zendesk Chat APIs
1 2 |
read chat |
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
1https://{YOUR-DOMAIN}.zendesk.com/api/v2/tickets
1https://{YOUR-DOMAIN}.zopim.com/api/v2/chats - 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)As of of now Zendesk doesnt support Refresh Token. So once you Click Generate Token it will only create Access Token (doesn’t expire until you revoke explicitly ). Refresh Token will be blank which is expected.
- 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)