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).
Tasks / Components used in this article.
Prerequisites
Before we look into Step-By-Step section to extract and load data from Zoom to SQL Server let’s make sure you met the following requirements.
- 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.
- ZappySys SSIS PowerPack installed. Click on the link to download a FREE trial.
- You have the basic familiarity with REST API concepts and Zoom API.
Zoom API Authentication
Now let’s look at step by step how to read data from Zoom API or POST data to Zoom using SSIS.
Zoom Provides 3 ways to authenticate API calls. In this article we will cover only JWT and OAuth 2.0 connection approach.
- Use JWT Token
- Use OAuth 2.0 Token (3-legged OAuth)
- Use API Key / Secret directly in API call (Mostly used by older API like this one)
Method-1 : Call Zoom API in SSIS using JWT Token (RFC 7519)
In this section we will learn how to use JWT Token method to call Zoom API (i.e. JWT as per RFC 7519 and here ).
JWT method is simple compared to OAuth 2.0 (next section) so many people prefer it compared to OAuth.
Now let’s look at how to use JWT token approach to authenticate your Zoom API calls.
Obtain Zoom API Key / Secret for JWT Auth
- First Visit your Zoom Developer account here
- Click on API Tab and copy your API Key and Secret (We will use it later)
- Whitelist the Redirect URL
Once we have API key / Secret we can move on to SSIS part.
Configure SSIS HTTP Connection with JWT
Now lets get started with SSIS part. We will first create HTTP Connection for Zoom API access using JWT method.
- Open SSIS Package and drag ZS REST API Task from SSIS Control Flow Toolbox
- Change URL Access Mode to Url From Connection
- Enter URL as https://api.zoom.us/v2/users/me/settings
- Select New ZS-HTTP connection type from the connection dropdown
- Configure HTTP Connection as below. Select Credentials Type as JWT Token. Enter API Key and Secret.
- Once HTTP connection is configured you can click OK to save connection.
- On the REST API Task click Test to confirm see its working.
Debug Web API call using Fiddler
To test how things looking behind the scene we strongly suggest to use tool like fiddler. You can double click the URL entry (Right side) to see Request and Response Panels. Top panel is Request (URL, Headers, Body) and Bottom Panel is Response.Loading data from REST API to SQL Server
Once you setup HTTP / OAUTH connection we can use JSON Source or XML Source to extract data from API and load into SQL Server. If you are API is XML based API then use XML Source in below examples else use JSON Source. For example purpose we will load data into SQL Server but you can load into any Target (e.g. Flat file, Oracle, Excel) using Microsoft or ZappySys Destination connectors To load REST API data into SQL Server perform the following steps (Screenshots are generic and used for demonstration for purpose, your values can be different than below)- Go to SSIS Data Flow tab
- Drag ZS JSON Source from the SSIS Toolbox (Use ZS XML Source if your API is XML based API)
- Double click to edit Source
- Set API URL you like to call, Check Use Credentials if you need to use HTTP or OAuth connection
- Set Method / Body if its other than GET. For method other than GET make sure you select correct Content-Type from Dropdown (e.g. application/json). This indicate input data format in Body.
- Set HTTP Headers if needed (in Most cases you won't need to set this)
- Select Filter (many times this is not needed). If your API response has array node then select it here. For example if your response looks like this { rows: [ {...}, {...}, {...} ] } then filter would be $.rows[*]. Select Array node you like to extract in the Filter selection UI.
- Configure Pagination if needed on the pagination tab. Check your API documentation see it supports pagination.
- Click OK to Save component settings and generate desired metadata / columns for the output.
- Now drag OLEDB destination from the SSIS toolbox and drop on the Data Flow surface (technically you can use any valid Destination but for demo we will use OLEDB Destination)
- Connect Source to Destination Component
- On OLEDB destination select / create new SQL Connection and then Click "New Table"
- Click on Mappings tab to map columns by names and click OK to save
- Execute the Package
POST / Write Data to API (Insert, Update or Delete)
There will be a time you like to automate POST actions (e.g. create new incident via API call). Check this article to learn more on how to POST , DELETE, PUT data using API callsCommon Errors
There are many error can occur during runtime. Here are most common errors you may face at runtime.The most common error you may face when you run a SSIS package is truncation error. During the design time only 300 rows are scanned from a source (a file or a REST API call response) to detect datatypes but at runtime it is likely you will retrieve far more records. So it is possible that you will get longer strings than initially expected. For detailed instructions how to fix common metadata related errors read an article "How to handle SSIS errors (truncation, metadata issues)".
Another frequent error you may get is authentication error, which happens when you deploy/copy a package to another machine and run it there. Check Deployment to Production below to see why it happens and how to solve this problem.
Deployment to Production
Reading Zoom API data using JSON Source (with Pagination)
Now let’s look at how to use ZappySys JSON Source to read API data and parse into rows/column
- Drag and drop data flow task from SSIS Toolbox
- Double click task to go to data flow designer
- Drag SSIS ZS JSON Source from toolbox
- Edit JSON Source like below
- Enter URL like below (Use different URL if needed.)
https://api.zoom.us/v2/users/me/meetings?type=upcoming&page_size=100&page_number=1 - Select connection
- Goto pagination tab and enter information as below screenshot.
- Click on Select Filter
- Click Preview to test
Method-2 : Call Zoom API in SSIS using OAuth 2.0
Now let’s look at OAuth 2.0 approach to authenticate with Zoom API.
Register OAuth App
Very first step to authenticate your Zoom API call using OAuth method is to register App. Go through steps listed here to register your App. Below are high level steps.
- Visit http://marketplace.zoom.us/
- Click Build menu item at the top
- Select App Type (i.e. Account Level or User Level) and Click Begin
- Once App credentials displayed enter Redirect URL (use https://zappysys.com/oauth2 if you are not sure what to enter here). This URL never receives data from API but its only used to get authentication code during OAuth Process so don’t worry.
- Click on Scopes tab and select one or more permissions you like to assign to your App.
Configure SSIS OAuth Connection
Now lets get started with SSIS part. We will first create OAuth Connection for Zoom API access.
- Open SSIS Package and drag ZS REST API Task from SSIS Control Flow Toolbox
- Change URL Access Mode to Url From Connection
- Enter URL as https://api.zoom.us/v2/users/me/settings
- Select New ZS-OAUTH connection type from the connection dropdown
- Configure OAuth connection as below. Enter Token file path, enter Redirect URL, ClientID, Client Secret and then click Generate Token (You may have to login and then click Accept button to grant permission).
- Once you get token is generated you can click OK to save connection.
- On the REST API Task click Test to confirm its working.
Debug Web API call using Fiddler
To test how things looking behind the scene we strongly suggest to use tool like fiddler. You can double click the URL entry (Right side) to see Request and Response Panels. Top panel is Request (URL, Headers, Body) and Bottom Panel is Response.Loading data from REST API to SQL Server
Once you setup HTTP / OAUTH connection we can use JSON Source or XML Source to extract data from API and load into SQL Server. If you are API is XML based API then use XML Source in below examples else use JSON Source. For example purpose we will load data into SQL Server but you can load into any Target (e.g. Flat file, Oracle, Excel) using Microsoft or ZappySys Destination connectors To load REST API data into SQL Server perform the following steps (Screenshots are generic and used for demonstration for purpose, your values can be different than below)- Go to SSIS Data Flow tab
- Drag ZS JSON Source from the SSIS Toolbox (Use ZS XML Source if your API is XML based API)
- Double click to edit Source
- Set API URL you like to call, Check Use Credentials if you need to use HTTP or OAuth connection
- Set Method / Body if its other than GET. For method other than GET make sure you select correct Content-Type from Dropdown (e.g. application/json). This indicate input data format in Body.
- Set HTTP Headers if needed (in Most cases you won't need to set this)
- Select Filter (many times this is not needed). If your API response has array node then select it here. For example if your response looks like this { rows: [ {...}, {...}, {...} ] } then filter would be $.rows[*]. Select Array node you like to extract in the Filter selection UI.
- Configure Pagination if needed on the pagination tab. Check your API documentation see it supports pagination.
- Click OK to Save component settings and generate desired metadata / columns for the output.
- Now drag OLEDB destination from the SSIS toolbox and drop on the Data Flow surface (technically you can use any valid Destination but for demo we will use OLEDB Destination)
- Connect Source to Destination Component
- On OLEDB destination select / create new SQL Connection and then Click "New Table"
- Click on Mappings tab to map columns by names and click OK to save
- Execute the Package
POST / Write Data to API (Insert, Update or Delete)
There will be a time you like to automate POST actions (e.g. create new incident via API call). Check this article to learn more on how to POST , DELETE, PUT data using API callsCommon Errors
There are many error can occur during runtime. Here are most common errors you may face at runtime.The most common error you may face when you run a SSIS package is truncation error. During the design time only 300 rows are scanned from a source (a file or a REST API call response) to detect datatypes but at runtime it is likely you will retrieve far more records. So it is possible that you will get longer strings than initially expected. For detailed instructions how to fix common metadata related errors read an article "How to handle SSIS errors (truncation, metadata issues)".
Another frequent error you may get is authentication error, which happens when you deploy/copy a package to another machine and run it there. Check Deployment to Production below to see why it happens and how to solve this problem.
Deployment to Production
Conclusion
In this post you have seen how easy it is to call Zoom API in SSIS. Just register OAuth App and start calling your API. Download SSIS PowerPack and explore many other API integration uses.