In this post we will learn how to read Freshdesk data in SSIS using ZappySys JSON / REST API Source. We will see how to authenticate, paginate / parse and load Freshdesk data into SQL Server Table in just few clicks. If you don’t use Freshdesk and considering using Zendesk instead then check our previous post on how to Read Zendesk data in SSIS.
Freshdesk is a cloud based / managed service like Zendesk to for Support / Customer service.
PrerequisitesBefore we perform steps listed in this article, you will need to make sure following prerequisites are met:
- SSIS designer installed. Sometimes it is referred as BIDS or SSDT (download it from Microsoft site).
- Basic knowledge of SSIS package development using Microsoft SQL Server Integration Services.
- Make sure ZappySys SSIS PowerPack is installed (download it).
- Optional (If you want to Deploy and Schedule ) - Deploy and Schedule SSIS Packages
So let’s get started. We will see step by step instructions to configure Freshdesk API connection, setup JSON Source to read data from Freshdesk and finally load data into SQL Server table. We will use List Tickets API in this article for demo purpose but read other useful information on that page if you are new to REST API.
Setup Freshdesk REST API Connection
Very first step to call any Freshdesk API in SSIS is to configure HTTP connection (Basic Authentication – Using UserID/ Password).
- Open Visual Studio (i.e. SSDT) to create new SSIS Package
- From Control Flow SSIS Toolbox drag REST API task
- Select URL From HTTP Connection Option from Drop down
- Click New HTTP Connection
- Configure HTTP connection like below.
- Enter any Valid URL (This will be ignored if you Override URL on REST API Task)
- Select Basic Authentication (Use User ID and Password)
- Click OK to close HTTP Connection
- On Main UI of REST API Task, check Use Direct URL and enter below URL (Change YourDomain Part)
- Click Test Request / Response. If you see OK status then you have successfully called Freshdesk API. That’s all.
In the section we will see how to Parse REST API response and load data into SQL Table.
Read Freshdesk data in SSIS
Now let’s look at steps to configure SSIS JSON Source to read from Freshdesk REST API.
- Drag Data Flow task from toolbox. Double click to go to Data Flow designer
- Drag ZS JSON Source (For File / REST API)
- Configure JSON Source like below.
- Check Use Connection option and select HTTP connection created in the previous section.
- Enter API URL from which you like to read data. In out example we want to read tickets created after 2019-01-01 so we will call API like below. You can skip ?updated_since=2019-01-01 if you like to read all tickets.
- You can also Use Variable Placeholder in URL to make things dynamic like below
- Click Preview to see sample data.
- Configure Pagination like below. Basically you have to select Pagination Mode = URL Parameter Mode. Enter Page num indicator as page
- Thats it. Now click OK to save UI.
Load Freshdesk data into SQL Server Table
- Inside Data Flow, Drag OLEDB Destination from SSIS Toolbox
- Connect our Source component to OLEDB Destination
- Double click OLEDB Destination to configure it
- Select Target Connection or click NEW to create new connection
- Select Target Table or click NEW to create new table based on source columns
- Click on Mappings Tab to Auto map columns by name. You can change mappings as you need
- Click OK to Save OLEDB Destination Settings
- That's it, You are now ready to run data flow. NOTE: If you wish to debug data flow and see records when you run, add data viewer by right click on blue arrow > Click Enable Data Viewer
- To execute data flow, Right click anywhere inside Data Flow Surface and click Execute Task
In this article we saw how easy it is to read data from any REST API service like Freshdesk REST API and load into Relational DB like SQL Server. Try SSIS PowerPack for FREE and explore many other 70+ Tasks /Components not discussed in this article.