<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SSIS WEB API Destination Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/category/ssis/components/ssis-web-api-destination/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/category/ssis/components/ssis-web-api-destination/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Thu, 19 Mar 2026 23:07:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.4</generator>

<image>
	<url>https://zappysys.com/blog/wp-content/uploads/2023/01/cropped-zappysys-symbol-large-32x32.png</url>
	<title>SSIS WEB API Destination Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/category/ssis/components/ssis-web-api-destination/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to download Outlook (Office 365) Emails as .EML or .MSG Files</title>
		<link>https://zappysys.com/blog/how-to-download-outlook-office-365-emails-as-eml-or-msg-files/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Thu, 19 Jun 2025 13:19:00 +0000</pubDate>
				<category><![CDATA[SSIS API Source]]></category>
		<category><![CDATA[SSIS OAuth Connection]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[SSIS WEB API Destination]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=11380</guid>

					<description><![CDATA[<p>Introduction In this article, you will learn how to download Outlook (Office 365) emails as .EML or .MSG files using ZappySys SSIS PowerPack without writing any code. We’ll leverage the power of Microsoft Graph API, which provides unified access to Microsoft 365 services like Outlook Mail, and integrate it seamlessly using the API Connector for [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/how-to-download-outlook-office-365-emails-as-eml-or-msg-files/">How to download Outlook (Office 365) Emails as .EML or .MSG Files</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><img loading="lazy" decoding="async" class="alignleft" title="Outlook Mail (Office 365)" src="https://zappysys.com/blog/wp-content/uploads/2025/06/Outlook-28x281-1.png" alt="Outlook Mail (Office 365)" width="100" height="100" /> In this article, you will learn how to download Outlook (Office 365) emails as .EML or .MSG files using ZappySys SSIS PowerPack without writing any code. We’ll leverage the power of Microsoft Graph API, which provides unified access to Microsoft 365 services like Outlook Mail, and integrate it seamlessly using the <a href="https://zappysys.com/api/integration-hub/outlook-mail-connector/ssis">API Connector for SSIS Outlook Mail (Office 365)</a>, Web API Destination and other components. By the end, you’ll be able to automate the process of extracting emails and saving them to disk in standard email formats directly from your SSIS package.</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>Step 1: Register an Application in Azure Portal</h2>
<p>To access Outlook emails via Microsoft Graph API, the first step is to register an application in the Azure Portal. This allows your SSIS package to authenticate securely and retrieve mail data from Office 365.<br />
Step by step info is available here Outlook Mail (Office 365) Connector Authentication section.</p>
<h3>User Credentials</h3>
<p>Use delegated access (User Credentials) whenever you want to let a signed-in user work with their own resources or resources they can access. Whether it&#8217;s an admin setting up policies for their entire organization or a user deleting an email in their inbox, all scenarios involving user actions should use delegated access.<br />
<b>Refer to this links for the detailed steps:</b> <a href="https://zappysys.com/api/integration-hub/outlook-mail-connector/help/authentication/usercreds/" target="_blank" rel="noopener">User Credentials [OAuth]</a></p>
<h3>Application Credentials</h3>
<p>Application-only access is broader and more powerful than delegated access (User Credentials), so you should only use app-only access where needed. Use it when:</p>
<ol>
<li>The application needs to run in an automated way, without user input (for example, a daily script that checks emails from certain contacts and sends automated responses).</li>
<li>The application needs to access resources belonging to multiple different users (for example, a backup or data loss prevention app might need to retrieve messages from many different chat channels, each with different participants).</li>
<li>You find yourself tempted to store credentials locally and allow the app to sign in &#8216;as&#8217; the user or admin.</li>
</ol>
<p><b>Refer to this links for the detailed steps:</b> <a href="https://zappysys.com/api/integration-hub/outlook-mail-connector/help/authentication/appcreds/ target=">Application Credentials [OAuth]</a></p>
<h2>Step 2: Download Outlook (Office 365) Emails as .EML Files using SSIS</h2>
<p>Now let’s look at some examples of how to access your Outlook emails using our easy-to-use Outlook Mail Connector in ZappySys SSIS PowerPack. This connector simplifies calling the Microsoft Graph API, so you can retrieve emails with just a few clicks.<br />
In this section we will learn how to configure and use Outlook Mail (Office 365) Connector in <a title="SSIS API Source" href="https://zappysys.com/products/ssis-powerpack/ssis-api-source/">API Source</a> to extract data from Outlook Mail (Office 365).</p>
<ol>
<li>Begin with opening Visual Studio and Create a New Project.</li>
<li>Select Integration Service Project and in new project window set the appropriate name and location for project.<br />
And click OK.</li>
<li>In the new SSIS project screen you will find the following:
<ol type="i">
<li>SSIS ToolBox on left side bar</li>
<li>Solution Explorer and Property Window on right bar</li>
<li>Control flow, data flow, event Handlers, Package Explorer in tab windows</li>
<li>Connection Manager Window in the bottom</li>
</ol>
<p><img loading="lazy" decoding="async" class="img-thumbnail" title="SSIS Project Screen" src="https://cdn.zappysys.com/api/images/zappysys-ssis-project-with-toolbox.png" alt="SSIS Project Screen" width="1059" height="675" /></p>
<div class="alert alert-warning">Note: If you don&#8217;t see ZappySys SSIS PowerPack Task or Components in SSIS Toolbox, please refer to <a href="https://zappysys.zendesk.com/hc/en-us/articles/115004935754-I-don-t-see-PowerPack-components-in-SSIS-Toolbox">this help link</a>.</div>
</li>
<li>Now, Drag and Drop <b>SSIS Data Flow Task</b> from SSIS Toolbox. Double click on the <em>Data Flow Task</em> to see <em>Data Flow</em> designer.<img loading="lazy" decoding="async" class="img-thumbnail" title="SSIS Data Flow Task - Drag and Drop" src="https://cdn.zappysys.com/onlinehelp/ssis-powerpack/scr/images/drag-and-drop-data-flow-task.png" alt="SSIS Data Flow Task - Drag and Drop" width="460" height="155" /></li>
<li>From the SSIS toolbox drag and <a title="SSIS API Source" href="https://zappysys.com/products/ssis-powerpack/ssis-api-source/">API Source</a> (Predefined Templates) on the data flow designer surface, and double click on it to edit it:<br />
<img loading="lazy" decoding="async" class="img-thumbnail" title="SSIS API Source (Predefined Templates) - Drag and Drop" src="https://cdn.zappysys.com/api/images/ssis-api-source-drag-and-drop.jpg" alt="SSIS API Source (Predefined Templates) - Drag and Drop" width="659" height="292" /></li>
<li>Select <strong>New Connection</strong> to create a new connection:<br />
<img loading="lazy" decoding="async" class="img-thumbnail img-thumbnail" title="API Source - New Connection" src="https://cdn.zappysys.com/api/images/ssis-api-source-new-connection.png" alt="API Source - New Connection" width="684" height="643" /></li>
<li>Use a preinstalled Outlook Mail (Office 365) Connector from <em>Popular Connector List</em> or press <em>Search Online</em> radio button to download Outlook Mail (Office 365) Connector. Once downloaded simply use it in the configuration:
<div id="attachment_11392" style="width: 722px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-select-outlook-mail-connector.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11392" class="size-full wp-image-11392" src="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-select-outlook-mail-connector.png" alt="Outlook Mail (Office 365) Connector Selection" width="712" height="654" srcset="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-select-outlook-mail-connector.png 712w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-select-outlook-mail-connector-300x276.png 300w" sizes="(max-width: 712px) 100vw, 712px" /></a><p id="caption-attachment-11392" class="wp-caption-text">Outlook Mail (Office 365) Connector Selection</p></div></li>
<li>Proceed with selecting the desired Authentication Type. Then select <em>API Base URL</em> (in most cases default one is the right one). Finally, fill in all the required parameters and set optional parameters if needed. You may press a link <strong>Steps to Configure</strong> which will help set certain parameters. More info is available in <a href="https://zappysys.com/api/integration-hub/outlook-mail-connector/help/authentication/UserCreds">Authentication section</a>.
<ol>
<li>User Credentials [OAuth]
<div id="attachment_11394" style="width: 806px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-outlook-mail-user-cred-authentication.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11394" class="size-full wp-image-11394" src="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-outlook-mail-user-cred-authentication.png" alt="User Credentials [OAuth]" width="796" height="732" srcset="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-outlook-mail-user-cred-authentication.png 796w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-outlook-mail-user-cred-authentication-300x276.png 300w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-outlook-mail-user-cred-authentication-768x706.png 768w" sizes="(max-width: 796px) 100vw, 796px" /></a><p id="caption-attachment-11394" class="wp-caption-text">User Credentials [OAuth]</p></div><b>OR</b></li>
<li>Application Credentials [OAuth]
<div id="attachment_11395" style="width: 809px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-outlook-mail-app-cred-authentication.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11395" class="size-full wp-image-11395" src="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-outlook-mail-app-cred-authentication.png" alt="Application Credentials [OAuth]" width="799" height="735" srcset="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-outlook-mail-app-cred-authentication.png 799w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-outlook-mail-app-cred-authentication-300x276.png 300w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-outlook-mail-app-cred-authentication-768x706.png 768w" sizes="(max-width: 799px) 100vw, 799px" /></a><p id="caption-attachment-11395" class="wp-caption-text">Application Credentials [OAuth]</p></div></li>
</ol>
</li>
<li>Select the <b>Get Messsages</b> endpoint, change/pass the properties values, and click on <strong>Preview Data</strong> button to make the API call.
<div id="attachment_11397" style="width: 756px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-select-outlook-mail-get-messages.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11397" class="size-full wp-image-11397" src="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-select-outlook-mail-get-messages.png" alt="API Source - Get Messages Endpoint" width="746" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-select-outlook-mail-get-messages.png 746w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-select-outlook-mail-get-messages-300x242.png 300w" sizes="(max-width: 746px) 100vw, 746px" /></a><p id="caption-attachment-11397" class="wp-caption-text">API Source &#8211; Get Messages Endpoint</p></div></li>
<li>That’s it — click <b>OK</b> and you&#8217;re done! In just a few clicks, you’ve successfully configured a connection to <b>Outlook Mail (Office 365)</b> using the <b>Outlook Mail Connector</b>.</li>
<li>Now let&#8217;s move to the next step — retrieving the full email content.<br />
You’ll use the <strong>Web API Destination</strong> component to make the <strong>Get MIME content</strong> API call. Within this task, you can dynamically pass the <strong>Message ID</strong> to fetch each email’s raw <code>.EML</code> content from Outlook (Office 365).<br />
For more details, refer to the official Microsoft documentation: <a href="https://learn.microsoft.com/en-us/graph/api/message-get?view=graph-rest-1.0&amp;tabs=http#example-4-get-mime-content" target="_blank" rel="noopener">Get Outlook Mail MIME content</a></li>
<li>Drag and drop the <b>Web API Destination</b> component from the SSIS Toolbox onto your Data Flow.<br />
Double-click to open it, then configure as follows and create a new OAuth Connection if needed:<strong>URL:</strong></p>
<blockquote><p>https://graph.microsoft.com/v1.0/me/messages/&lt;%Id%&gt;/$value</p></blockquote>
<p>The &lt;%Id%&gt; placeholder is dynamically replaced by SSIS at runtime with the actual Message ID, allowing the Web API Destination to download each email’s .EML content individually.</p>
<div id="attachment_11407" style="width: 730px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-web-api-destination-mail-get-mime-message.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11407" class="size-large wp-image-11407" src="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-web-api-destination-mail-get-mime-message-1024x748.png" alt="Get MIME content’ API call using the Web API Destination" width="720" height="526" srcset="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-web-api-destination-mail-get-mime-message-1024x748.png 1024w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-web-api-destination-mail-get-mime-message-300x219.png 300w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-web-api-destination-mail-get-mime-message-768x561.png 768w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-web-api-destination-mail-get-mime-message.png 1074w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-11407" class="wp-caption-text">Get MIME content’ API call using the Web API Destination</p></div></li>
<li>You’ll also need to create the OAuth connection using the same credentials.<br />
On the Advanced tab, make sure to set the Redirect URL correctly.For detailed steps, refer to this guide:<br />
<a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">How to set up OAuth 2.0 in SSIS</a></p>
<div id="attachment_11408" style="width: 711px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-outlook-mail-oauth-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11408" class="size-full wp-image-11408" src="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-outlook-mail-oauth-connection.png" alt="Outlook Mail OAuth 2.0 Connection" width="701" height="763" srcset="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-outlook-mail-oauth-connection.png 701w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-outlook-mail-oauth-connection-276x300.png 276w" sizes="(max-width: 701px) 100vw, 701px" /></a><p id="caption-attachment-11408" class="wp-caption-text">Outlook Mail OAuth 2.0 Connection</p></div></li>
<li>Next, add a Derived Column transformation to create a new column that defines the file path for saving the <strong>.EML</strong> file.<br />
In this example, we’ll use the Message ID to generate a unique file name for each email:Expression:</p>
<blockquote><p>(DT_WSTR,1000)&#8221;E:\\zsTemp\\&#8221; + [Id] + &#8220;.eml&#8221;</p></blockquote>
<div id="attachment_11409" style="width: 730px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-derived-column-add-filename.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11409" class="size-large wp-image-11409" src="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-derived-column-add-filename-1024x626.png" alt="Derived Column - Dynamic File Path" width="720" height="440" srcset="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-derived-column-add-filename-1024x626.png 1024w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-derived-column-add-filename-300x184.png 300w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-derived-column-add-filename-768x470.png 768w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-derived-column-add-filename.png 1154w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-11409" class="wp-caption-text">Derived Column &#8211; Dynamic File Path</p></div></li>
<li>Now, add an <strong>Export Column</strong> transformation to save the email content to a file.
<ul>
<li><strong>Extract Column:</strong> set to <code>ResponseText</code> (this holds the email content from Web API Destination)</li>
<li><strong>File Path Column:</strong> set to the column you created in the <strong>Derived Column</strong> step (e.g., <code>FilePath</code>)</li>
<li>Enable <strong>Force Truncate</strong> and <strong>Write Byte-Order Mark</strong> options</li>
</ul>
<div id="attachment_11411" style="width: 730px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-export-column-save-to-file.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11411" class="size-large wp-image-11411" src="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-export-column-save-to-file-1024x574.png" alt="Export Column - write the email content to a file on disk." width="720" height="404" srcset="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-export-column-save-to-file-1024x574.png 1024w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-export-column-save-to-file-300x168.png 300w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-export-column-save-to-file-768x431.png 768w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-export-column-save-to-file.png 1216w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-11411" class="wp-caption-text">Export Column &#8211; write the email content to a file on disk.</p></div></li>
<li><b>Set File Encoding to UTF-8 (Optional)</b><br />
Next, go to the <strong>Control Flow</strong> and use the <strong>Advanced File System Task</strong> to convert the downloaded <code>.eml</code> file’s encoding to <strong>UTF-8</strong>.<br />
This step is optional — I had to apply it on my system because the files weren’t opening correctly due to a non-UTF-8 encoding.<br />
If you encounter a similar issue, follow this step to ensure proper compatibility with email clients.</p>
<div id="attachment_11413" style="width: 889px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-advanced-file-system-task-change-encoding.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11413" class="size-full wp-image-11413" src="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-advanced-file-system-task-change-encoding.png" alt="Advanced File System Task - Change Encoding" width="879" height="663" srcset="https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-advanced-file-system-task-change-encoding.png 879w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-advanced-file-system-task-change-encoding-300x226.png 300w, https://zappysys.com/blog/wp-content/uploads/2025/06/ssis-advanced-file-system-task-change-encoding-768x579.png 768w" sizes="(max-width: 879px) 100vw, 879px" /></a><p id="caption-attachment-11413" class="wp-caption-text">Advanced File System Task &#8211; Change Encoding</p></div></li>
<li><strong>That’s it!</strong> The process will now automatically download your Outlook messages to your local system as <code>.EML</code> files.
<div id="attachment_11414" style="width: 730px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2025/06/outlook-mail-files.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11414" class="size-large wp-image-11414" src="https://zappysys.com/blog/wp-content/uploads/2025/06/outlook-mail-files-1024x450.png" alt="Outlook .eml file’s" width="720" height="316" srcset="https://zappysys.com/blog/wp-content/uploads/2025/06/outlook-mail-files-1024x450.png 1024w, https://zappysys.com/blog/wp-content/uploads/2025/06/outlook-mail-files-300x132.png 300w, https://zappysys.com/blog/wp-content/uploads/2025/06/outlook-mail-files-768x338.png 768w, https://zappysys.com/blog/wp-content/uploads/2025/06/outlook-mail-files.png 1044w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-11414" class="wp-caption-text">Outlook .eml file’s</p></div></li>
</ol>
<h2>Conclusion</h2>
<p>Using <strong>ZappySys SSIS PowerPack</strong> and Microsoft Graph API, you can easily automate the download of Outlook (Office 365) emails in <code>.EML</code> format — all within SSIS and without writing any code.<br />
This approach is ideal for archiving, compliance, or integrating email content into downstream systems.<br />
With a few simple components and steps, your email extraction workflow can be up and running in minutes.</p>
<p>The post <a href="https://zappysys.com/blog/how-to-download-outlook-office-365-emails-as-eml-or-msg-files/">How to download Outlook (Office 365) Emails as .EML or .MSG Files</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to make Web API Destination dynamic (URL, Body, Headers)</title>
		<link>https://zappysys.com/blog/make-web-api-destination-dynamic-url-body-headers/</link>
		
		<dc:creator><![CDATA[ZappySys Team]]></dc:creator>
		<pubDate>Fri, 06 Mar 2020 03:51:19 +0000</pubDate>
				<category><![CDATA[SSIS WEB API Destination]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[Web]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=8806</guid>

					<description><![CDATA[<p>Introduction In this article, we will show how to work with the Web API Destination and create a dynamic URL, Body or header. For this purpose, we will use the following components: ZappySys SSIS PowerPack component to make things work: &#160; In these examples, we are going to show different examples of how to send a dynamic URL, dynamic [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/make-web-api-destination-dynamic-url-body-headers/">How to make Web API Destination dynamic (URL, Body, Headers)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In this article, we will show how to work with the Web API Destination and create a dynamic URL, Body or header. For this purpose, we will use the following components:</p>
<p><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a> component to make things work:<br />
<div class="su-table su-table-alternate">
<table width="300">
<tbody>
<tr style="line-height: 0px">
<td width="50px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener"><br />
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-3074" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/web-api-destination/ssis-web-api-destination.png" alt="SSIS Web destination" width="50" height="50" /></a></td>
<td style="vertical-align: middle"><a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">SSIS Web API Destination (POST data to URL)</a></td>
</tr>
<tr style="line-height: 0px">
<td width="50px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/" target="_blank" rel="noopener"><br />
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-3074" src="https://zappysys.com/images/SSIS-PowerPack/ssis-json-generator-transform.png" alt="JSON Generator Transform" width="50" height="50" /></a></td>
<td style="vertical-align: middle"><a href="https://zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/" target="_blank" rel="noopener">SSIS JSON Generator Transform</a></td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<p>In these examples, we are going to show different examples of how to send a dynamic URL, dynamic body and dynamic headers.</p>
<h2>How to make Web API Destination dynamic URL with the OLEDB Source</h2>
<ol>
<li>First of all, in this example, we are going to create a dynamic URL, we will use need the following URLs: <a href="https://jsonplaceholder.typicode.com/posts"><br />
https://jsonplaceholder.typicode.com/posts</a>, <a href="https://jsonplaceholder.typicode.com/comments">https://jsonplaceholder.typicode.com/comments</a>,<br />
<a href="https://jsonplaceholder.typicode.com/todos">https://jsonplaceholder.typicode.com/todos</a>, <a href="https://jsonplaceholder.typicode.com/users">https://jsonplaceholder.typicode.com/users</a>, and other similar URLs.</li>
<li>So, we will set the last part of the URL as a variable.</li>
<li>Also, will have a table with the values of the variable (posts, users, comments, etc):<br />
<pre class="crayon-plain-tag">CREATE TABLE [dbo].[webApiDest](
	[id] [smallint] NOT NULL,
	[type] [nchar](10) NULL,
 CONSTRAINT [PK_webApiDest] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
INSERT [dbo].[webApiDest] ([id], [type]) VALUES (1, N'posts     ')
INSERT [dbo].[webApiDest] ([id], [type]) VALUES (2, N'comments  ')
INSERT [dbo].[webApiDest] ([id], [type]) VALUES (3, N'todos     ')
INSERT [dbo].[webApiDest] ([id], [type]) VALUES (4, N'albums    ')
INSERT [dbo].[webApiDest] ([id], [type]) VALUES (5, N'photos    ')
INSERT [dbo].[webApiDest] ([id], [type]) VALUES (6, N'users     ')</pre>
&nbsp;</li>
<li>In addition, we are going to create a Data Flow with the following components as follows:<a href="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-json-generator-rest-api-web-destination.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-8828" src="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-json-generator-rest-api-web-destination.png" alt="" width="302" height="249" srcset="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-json-generator-rest-api-web-destination.png 302w, https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-json-generator-rest-api-web-destination-300x247.png 300w" sizes="(max-width: 302px) 100vw, 302px" /></a></li>
<li>Secondly, we will connect to the table created in the previous section<br />
using the OLEDB Source component:</p>
<div id="attachment_8829" style="width: 829px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-oledb-table.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8829" class="size-full wp-image-8829" src="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-oledb-table.png" alt="OLEDB-list-links" width="819" height="416" srcset="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-oledb-table.png 819w, https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-oledb-table-300x152.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-oledb-table-768x390.png 768w" sizes="(max-width: 819px) 100vw, 819px" /></a><p id="caption-attachment-8829" class="wp-caption-text">OLEDB-Source-Data</p></div></li>
</ol>
<h2>How to make Web API Destination dynamic URL in SSIS with the ZS JSON Generator Transform</h2>
<ol>
<li>Also, in the JSON Generator transform, right-click on Mapping and select add elements:
<div id="attachment_8831" style="width: 746px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-json-generator-transform-add-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8831" class="size-full wp-image-8831" src="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-json-generator-transform-add-1.png" alt="convert-tsql-json" width="736" height="623" srcset="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-json-generator-transform-add-1.png 736w, https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-json-generator-transform-add-1-300x254.png 300w" sizes="(max-width: 736px) 100vw, 736px" /></a><p id="caption-attachment-8831" class="wp-caption-text">add-elements-JSON</p></div></li>
<li>Check the add multiple bound options and check the two columns:
<div id="attachment_8832" style="width: 405px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-json-add-multiple-bound.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8832" class="size-full wp-image-8832" src="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-json-add-multiple-bound.png" alt="SSIS Multiple bound" width="395" height="482" srcset="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-json-add-multiple-bound.png 395w, https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-json-add-multiple-bound-246x300.png 246w" sizes="(max-width: 395px) 100vw, 395px" /></a><p id="caption-attachment-8832" class="wp-caption-text">Add JSON elements</p></div></li>
<li>Pay attention to this step because this and the next one are the most important steps. Right-click the type element and select edit.
<div id="attachment_8833" style="width: 743px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-edit-type.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8833" class="size-full wp-image-8833" src="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-edit-type.png" alt="Edit-ssis-outstream" width="733" height="612" srcset="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-edit-type.png 733w, https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-edit-type-300x250.png 300w" sizes="(max-width: 733px) 100vw, 733px" /></a><p id="caption-attachment-8833" class="wp-caption-text">Edit JSON element</p></div></li>
<li>The hide from output will hide the type from the output but will be present as a variable. Also, when we want to hide in the JSON created that element.
<div id="attachment_8834" style="width: 405px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-hide-output-include-downstream.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8834" class="size-full wp-image-8834" src="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-hide-output-include-downstream.png" alt="column-downstream" width="395" height="482" srcset="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-hide-output-include-downstream.png 395w, https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-hide-output-include-downstream-246x300.png 246w" sizes="(max-width: 395px) 100vw, 395px" /></a><p id="caption-attachment-8834" class="wp-caption-text">Column downstream</p></div></li>
<li>In addition, the include columns in the downstream option are the option that will allow sending the type as a variable from the JSON Generator Transform to the Web API destination.</li>
</ol>
<h2>How to make Web API Destination dynamic URL in SSIS with the ZS JSON Generator Transform</h2>
<ol>
<li>First of all, we will add the input column for the body. This will send the ZSON generator into the body.
<div id="attachment_8835" style="width: 708px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-web-api-destination-input-column-body.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8835" class="size-full wp-image-8835" src="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-web-api-destination-input-column-body.png" alt="Body-ssis-JSON" width="698" height="307" srcset="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-web-api-destination-input-column-body.png 698w, https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-web-api-destination-input-column-body-300x132.png 300w" sizes="(max-width: 698px) 100vw, 698px" /></a><p id="caption-attachment-8835" class="wp-caption-text">Body input</p></div></li>
<li>In connections, we will create a ZS-HTTP connection to the <a href="https://jsonplaceholder.typicode.com/">https://jsonplaceholder.typicode.com/</a> site:
<div id="attachment_8837" style="width: 736px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-http-zs-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8837" class="size-full wp-image-8837" src="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-http-zs-connection.png" alt="http connection" width="726" height="653" srcset="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-http-zs-connection.png 726w, https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-http-zs-connection-300x270.png 300w" sizes="(max-width: 726px) 100vw, 726px" /></a><p id="caption-attachment-8837" class="wp-caption-text">SSIS HTTP Connection</p></div></li>
<li>In the URL we will create a dynamic part with the type as a variable that gets the values from the SQL Server table and the type column.</li>
<li>You can write &lt;%type%&gt; manually, or edit the URL to use placeholders and get the type variable from the columns folder:
<div id="attachment_8839" style="width: 706px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-url-type-dynamic.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8839" class="size-full wp-image-8839" src="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-url-type-dynamic.png" alt="ssis dynamic link" width="696" height="380" srcset="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-url-type-dynamic.png 696w, https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-url-type-dynamic-300x164.png 300w" sizes="(max-width: 696px) 100vw, 696px" /></a><p id="caption-attachment-8839" class="wp-caption-text">SSIS web api dynamic link</p></div></li>
<li>The Web API configuration will be something like this:
<div id="attachment_8840" style="width: 711px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-web-api-destination-final.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8840" class="size-full wp-image-8840" src="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-web-api-destination-final.png" alt="SSIS-configuration-web-api" width="701" height="673" srcset="https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-web-api-destination-final.png 701w, https://zappysys.com/blog/wp-content/uploads/2020/03/ssis-web-api-destination-final-300x288.png 300w" sizes="(max-width: 701px) 100vw, 701px" /></a><p id="caption-attachment-8840" class="wp-caption-text">Final SSIS configuration</p></div></li>
<li>Finally, run the package.</li>
</ol>
<h2>Conclusion</h2>
<p>In this article, we learned how to send a dynamic URL to REST API. If you want to test the tool, you can download it here:</p>
<ul>
<li><a href="https://zappysys.com/products/odbc-powerpack/download/">ZappySys PowerPack</a></li>
</ul>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/make-web-api-destination-dynamic-url-body-headers/">How to make Web API Destination dynamic (URL, Body, Headers)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Get Office 365 Mail Attachments using SSIS</title>
		<link>https://zappysys.com/blog/get-office-365-mail-attachments-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 22 Feb 2020 08:27:34 +0000</pubDate>
				<category><![CDATA[REST API]]></category>
		<category><![CDATA[SSIS JSON Parser Transform]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS OAuth Connection]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[SSIS Template Transform]]></category>
		<category><![CDATA[SSIS Trash Destination]]></category>
		<category><![CDATA[SSIS WEB API Destination]]></category>
		<category><![CDATA[attachments]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[office 365]]></category>
		<category><![CDATA[outlook]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=8791</guid>

					<description><![CDATA[<p>Introduction In our previous article, we saw how to get Office 365 data in Power BI. Now, let’s look at how to get Office 365 Mail Attachments using SSIS without any coding. Microsoft Graph API is a unified way to access many Microsoft services, including the Office 365 API. In this post, we will use the SSIS [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/get-office-365-mail-attachments-using-ssis/">How to Get Office 365 Mail Attachments using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff7b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>UPDATE:</strong> ZappySys has released a brand new <a href="https://zappysys.com/api/integration-hub/outlook-mail-connector/ssis">Outlook Mail (Office 365) connector</a>, which makes it much simpler to <strong>download attachments, read/search emails, users, mail folders, send email, and more in SSIS</strong> compared to the steps listed in this article. You can still use the steps from this article, but if you are new to APIs or want to avoid the learning curve, use a newer approach.</div></div>
<p><a href="//zappysys.com/blog/wp-content/uploads/2017/08/microsoft-office-365-api-integration.png"><img loading="lazy" decoding="async" class="alignleft wp-image-1694" src="//zappysys.com/blog/wp-content/uploads/2017/08/microsoft-office-365-api-integration.png" alt="" width="100" height="100" srcset="https://zappysys.com/blog/wp-content/uploads/2017/08/microsoft-office-365-api-integration.png 241w, https://zappysys.com/blog/wp-content/uploads/2017/08/microsoft-office-365-api-integration-150x150.png 150w" sizes="(max-width: 100px) 100vw, 100px" /></a><span style="box-sizing: border-box; margin: 0px; padding: 0px;">In our previous article, we saw <a href="https://zappysys.com/blog/get-office-365-data-in-power-bi-using-microsoft-graph-api-and-odbc/" target="_blank" rel="noopener">how to get Office 365 data in Power BI</a>.</span> Now, let’s look at how to get Office 365 Mail Attachments using SSIS without any coding. <a href="https://developer.microsoft.com/en-us/graph/docs/concepts/overview" target="_blank" rel="noopener">Microsoft Graph API</a> is a unified way to access many Microsoft services, including the <strong>Office 365 API</strong>. In this post, we will use the <a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">SSIS JSON</a><span style="box-sizing: border-box; margin: 0px; padding: 0px;"><a target="_blank" rel="noopener">/REST API Source Connector</a> to retrieve the Outlook Messages list and its attachments</span>.</p>
<h2></h2>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>Use Case of Microsoft Graph API</h2>
<p>Here are some use cases for why you want to use the Microsoft Graph API</p>
<ul>
<li>Read/Write events from <strong>Outlook Calendar</strong></li>
<li>Send <strong>email</strong>  / Read <strong>emails</strong></li>
<li>Get the list of files from <strong>OneDrive</strong></li>
<li>Upload/ Download files to <strong>OneDrive</strong></li>
<li>Read/Write <strong>Excel Sheet</strong> (Use range or a specific range of a specific sheet)</li>
<li>Read <b>the SharePoint</b> Document library</li>
<li>Search content from <b>the SharePoint</b> document library</li>
<li>Get AD users for your Organization (AD Accounts)</li>
<li>Update OneNote</li>
<li>Track changes to Users, Events, Calendar Items using the <a href="https://developer.microsoft.com/en-us/graph/docs/concepts/delta_query_overview" target="_blank" rel="noopener">delta API</a></li>
</ul>
<div class="content_block" id="custom_post_widget-5670"><h2 style="text-align: left;">Register Application (OAuth2 App for Graph API)</h2>
<p style="text-align: left;">The first step to access any Office 365 API / Graph API is to register an OAuth App in the Azure Portal. After
following these steps, you will get the following two items to use in the next section:</p>

<ul style="text-align: left;">
 	<li>Application Id</li>
 	<li>Application Secret</li>
</ul>
<p style="text-align: left;">In this section, you will learn how to register a custom app in Microsoft Azure portal that will allow access to the
OneDrive. So, let's get started -</p>

<ol>
 	<li style="text-align: left;">Log into <a href="https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps">Microsoft
Azure portal</a> to register a custom app.</li>
 	<li style="text-align: left;">Register a new application by clicking New Registration link.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/NewRegistration.png"><img loading="lazy" decoding="async" class="size-full wp-image-9034" src="https://zappysys.com/blog/wp-content/uploads/2020/07/NewRegistration.png" alt="New App Registration in Azure portal" width="748" height="221" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/NewRegistration.png 748w, https://zappysys.com/blog/wp-content/uploads/2020/07/NewRegistration-300x89.png 300w" sizes="(max-width: 748px) 100vw, 748px" /></a></li>
 	<li style="text-align: left;">Provide the name of the custom app and who can access the app in the organization.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/RegisterOneDriveApp-1.jpg"><img loading="lazy" decoding="async" class="wp-image-9005 size-full" src="https://zappysys.com/blog/wp-content/uploads/2020/07/RegisterOneDriveApp-1.jpg" alt="Register an OneDrive App" width="610" height="518" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/RegisterOneDriveApp-1.jpg 610w, https://zappysys.com/blog/wp-content/uploads/2020/07/RegisterOneDriveApp-1-300x255.jpg 300w" sizes="(max-width: 610px) 100vw, 610px" /></a></li>
 	<li style="text-align: left;">Go to the App overview and add a Redirect URL.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI-1.jpg"><img loading="lazy" decoding="async" class="wp-image-9044 size-full" src="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI-1.jpg" alt="Add a Redirect URL" width="937" height="122" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI-1.jpg 937w, https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI-1-300x39.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI-1-768x100.jpg 768w" sizes="(max-width: 937px) 100vw, 937px" /></a></li>
 	<li style="text-align: left;">Click on "Add a Platform" under Platform Configuration section and then select "Web" under Web applications
section to enter a Redirect URL.
<pre class="lang:default decode:true">https://zappysys.com/oauth</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI2.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9007" src="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI2.jpg" alt="Redirect URL" width="466" height="564" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI2.jpg 466w, https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI2-248x300.jpg 248w" sizes="(max-width: 466px) 100vw, 466px" /></a></li>
 	<li style="text-align: left;">Create a Client Secret key which will be used to Authenticate the custom Azure app.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9010" src="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret.jpg" alt="Add a Client Secret" width="576" height="403" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret.jpg 576w, https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret-300x210.jpg 300w" sizes="(max-width: 576px) 100vw, 576px" /></a><a href="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret2.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9011" src="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret2.jpg" alt="Secret Key Expiration Period" width="208" height="259" /></a><a href="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret3.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9012" src="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret3.jpg" alt="Specify Secret Key" width="1024" height="176" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret3.jpg 1024w, https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret3-300x52.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret3-768x132.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></a>
<div><strong>Note</strong> - Take a note of <strong>Client Secret</strong>, it will be required while
configuring OAuth connection in the SSIS later</div></li>
 	<li style="text-align: left;">Add API Permissions.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9008" src="https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions.jpg" alt="OneDrive API Permissions" width="1291" height="415" /></a></li>
 	<li style="text-align: left;">Select following permissions from the Delegated Permissions section.
<pre class="lang:default decode:true">User.ReadBasic.All
Files.Read
offline_access</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions2.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9009" src="https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions2.jpg" alt="Select Delegated Permissions" width="512" height="571" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions2.jpg 512w, https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions2-269x300.jpg 269w" sizes="(max-width: 512px) 100vw, 512px" /></a></li>
 	<li>Take a note of Client ID, it will be required while configuring OAuth connection in the SSIS later.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret4.jpg"><img loading="lazy" decoding="async" class="wp-image-9013 size-full alignleft" src="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret4.jpg" alt="App Client ID" width="810" height="274" /></a></li>
</ol></div>
<h2>Step-By-Step to call the Microsoft Graph Rest API Using SSIS</h2>
<p>Now, let&#8217;s look at examples to access your Outlook.com emails using SSIS. You can use the same techniques to call pretty much any Office 365 API.</p>
<h3>Configure SSIS OAuth Connection for Graph REST API</h3>
<p>The first step to access any Graph API is to configure an OAuth connection</p>
<ol>
<li>Open Visual Studio</li>
<li>Open an existing SSIS Project or create a new one using File &gt; New &gt; Project &gt; Choose “Integration Services Project” Type under Business Intelligence template category.</li>
<li>Create Package</li>
<li>Right-click inside the Connection Managers area and click <strong>New Connection…</strong></li>
<li>From the connection type list, select the <strong>ZS-OAUTH</strong> connection type.
<div id="attachment_11825" style="width: 959px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/Create-a-new-SSIS-OAuth-API-Connection-Manager.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11825" class="size-full wp-image-11825" src="https://zappysys.com/blog/wp-content/uploads/2020/02/Create-a-new-SSIS-OAuth-API-Connection-Manager.png" alt="" width="949" height="447" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/Create-a-new-SSIS-OAuth-API-Connection-Manager.png 949w, https://zappysys.com/blog/wp-content/uploads/2020/02/Create-a-new-SSIS-OAuth-API-Connection-Manager-300x141.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/02/Create-a-new-SSIS-OAuth-API-Connection-Manager-768x362.png 768w" sizes="(max-width: 949px) 100vw, 949px" /></a><p id="caption-attachment-11825" class="wp-caption-text">Create a new SSIS OAuth API Connection Manager</p></div></li>
<li>On the OAuth Connection Manager, configure the following options
<ol style="list-style-type: lower-alpha;">
<li>Select &#8220;Custom&#8221; from the Provider dropdown</li>
<li>Select OAuth2 from the OAuth version</li>
<li>Enter your Application Id and Secret Key (i.e., App Password) obtained in the previous section <a href="https://apps.dev.microsoft.com/#/appList" target="_blank" rel="noopener">from here</a>.</li>
<li>Enter the following URL in the Authorization URL<br />
<pre class="crayon-plain-tag">https://login.microsoftonline.com/common/oauth2/v2.0/authorize</pre>
</li>
<li>Use the following URL in the token URL field<br />
<pre class="crayon-plain-tag">https://login.microsoftonline.com/common/oauth2/v2.0/token</pre>
</li>
<li>Enter the following <a href="https://developer.microsoft.com/en-us/graph/docs/authorization/permission_scopes" target="_blank" rel="noopener">Graph API Scopes</a> (each scope must be entered on a new line).<br />
<pre class="crayon-plain-tag">user.read
mail.read
offline_access</pre>
<div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff7b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">NOTE: Always include <strong>the offline_access</strong> scope, which returns a refresh_token, which allows you to renew the token without going through the login process again. <span style="box-sizing: border-box; margin: 0px; padding: 0px;">For more information about which scopes are needed, always refer to the API help page (e.g., if you want to read mail using <a href="https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_list_messages" target="_blank" rel="noopener">this API,</a> then you will see it says you can use <strong>Mail.Read</strong> or <strong>Mail.ReadWrite</strong> scope).</span></div></div></li>
<li>Go to the <strong>Advanced tab</strong> and enter the following URL in the Callback/Return URL (assuming the same URL used when you registered the App in the previous section)<br />
<pre class="crayon-plain-tag">https://zappysys.com/oauth</pre>
</li>
<li>Now go back to the first tab and click Generate Token. When prompted, log in using your Personal Microsoft Account or Work Account (Office 365 or AD login)</li>
<li>After logging in, you will see the Accept option. Just click it. If things go right, then you will see the Access Token and Refresh Token fields populated.</li>
</ol>
</li>
<li>Once everything is configured, you can click <strong>Test Connection</strong> to verify the connection works.
<div class="mceTemp"></div>
<div id="attachment_11832" style="width: 713px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-OAuth-Connection-Manager-for-Office-365-REST-API-Microsoft-Graph-API.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11832" class="size-full wp-image-11832" src="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-OAuth-Connection-Manager-for-Office-365-REST-API-Microsoft-Graph-API.png" alt="" width="703" height="754" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-OAuth-Connection-Manager-for-Office-365-REST-API-Microsoft-Graph-API.png 703w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-OAuth-Connection-Manager-for-Office-365-REST-API-Microsoft-Graph-API-280x300.png 280w" sizes="(max-width: 703px) 100vw, 703px" /></a><p id="caption-attachment-11832" class="wp-caption-text">SSIS OAuth Connection Manager for Office 365 REST API Microsoft Graph API</p></div></li>
</ol>
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff8b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">NOTE: Typically, RefreshToken is long-lived, but in some cases, they may expire soon too. If that’s the case, then you can configure the above OAuth connection to change the refresh token pattern. Simply enter the token file path and re-authenticate by clicking Generate Token. After that, each time you make an API call, it will save a new refresh token in the file.</div></div>
<h3>Download the Messages Attachment Files from Outlook</h3>
<p>Let’s start with an example. We use the SSIS JSON Source and Web API Destination components to make a call to the Microsoft Graph REST API.</p>
<ol>
<li>First of all, drag and drop the <strong>Data Flow Task</strong> from the SSIS Toolbox and double-click it to edit.
<div id="attachment_11784" style="width: 485px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2026/02/Drag-and-drop-Data-flow.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11784" class="size-full wp-image-11784" src="https://zappysys.com/blog/wp-content/uploads/2026/02/Drag-and-drop-Data-flow.png" alt="" width="475" height="178" srcset="https://zappysys.com/blog/wp-content/uploads/2026/02/Drag-and-drop-Data-flow.png 475w, https://zappysys.com/blog/wp-content/uploads/2026/02/Drag-and-drop-Data-flow-300x112.png 300w" sizes="(max-width: 475px) 100vw, 475px" /></a><p id="caption-attachment-11784" class="wp-caption-text">Drag and drop Data flow</p></div></li>
<li>From the SSIS toolbox, drag and drop the<strong> JSON Source</strong> onto the Data Flow Designer surface.
<div class="mceTemp"></div>
<div id="attachment_11533" style="width: 553px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2015/09/ssis-json-source-adapter-drag.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11533" class="size-full wp-image-11533" src="https://zappysys.com/blog/wp-content/uploads/2015/09/ssis-json-source-adapter-drag.png" alt="" width="543" height="146" srcset="https://zappysys.com/blog/wp-content/uploads/2015/09/ssis-json-source-adapter-drag.png 543w, https://zappysys.com/blog/wp-content/uploads/2015/09/ssis-json-source-adapter-drag-300x81.png 300w" sizes="(max-width: 543px) 100vw, 543px" /></a><p id="caption-attachment-11533" class="wp-caption-text">SSIS JSON Source &#8211; Drag and Drop</p></div></li>
<li>Double-click the <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/?"><strong>JSON Source</strong></a>, then enter the following URL to invoke the Messages API call with search options to retrieve emails with attachments.<br />
<pre class="crayon-plain-tag">https://graph.microsoft.com/v1.0/me/messages?$select=sentDateTime,from,subject,hasAttachments&amp;$search="hasAttachments:True"</pre>
Set the filter to <code>$.value[*]</code> and click the preview.</p>
<div id="attachment_11831" style="width: 837px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-JSON-Source-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Read-Mail-Example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11831" class="size-full wp-image-11831" src="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-JSON-Source-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Read-Mail-Example.png" alt="" width="827" height="887" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-JSON-Source-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Read-Mail-Example.png 827w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-JSON-Source-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Read-Mail-Example-280x300.png 280w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-JSON-Source-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Read-Mail-Example-768x824.png 768w" sizes="(max-width: 827px) 100vw, 827px" /></a><p id="caption-attachment-11831" class="wp-caption-text">SSIS JSON Source – Get data from Microsoft Graph API (Office 365 API – Read Mail Example)</p></div>
<p>To customize the URL with additional parameters, check <a href="https://developer.microsoft.com/en-us/graph/docs/overview/query_parameters" target="_blank" rel="noopener">this help link</a>. It’s a standard OData Protocol, so you can leverage many common OData features (e.g., use $top parameters to set pageSize. Default is 10 for List Mail, but you can include more records per response by changing it, such as <strong>…/messages?$top=50</strong>).</li>
<li> Now, let&#8217;s use Template Transform to set the URL using the message ID to make the <a href="https://docs.microsoft.com/en-us/graph/api/attachment-get?view=graph-rest-1.0&amp;tabs=http" target="_blank" rel="noopener">Get attachment API</a> call.</p><pre class="crayon-plain-tag">https://graph.microsoft.com/v1.0/me/messages/&lt;%id%&gt;/attachments</pre><p>
<div id="attachment_11833" style="width: 848px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Template-Transform-sending-attachment-id.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11833" class="size-full wp-image-11833" src="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Template-Transform-sending-attachment-id.png" alt="" width="838" height="560" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Template-Transform-sending-attachment-id.png 838w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Template-Transform-sending-attachment-id-300x200.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Template-Transform-sending-attachment-id-768x513.png 768w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Template-Transform-sending-attachment-id-272x182.png 272w" sizes="(max-width: 838px) 100vw, 838px" /></a><p id="caption-attachment-11833" class="wp-caption-text">SSIS Template Transform sending attachment id</p></div>
<div class="mceTemp"></div>
</li>
<li>Now we need to use the <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/?_gl=1*1fgshu4*_up*MQ..*_gs*MQ..&amp;gclid=CjwKCAiAzZ_NBhAEEiwAMtqKy8lyVraD40LVoEOcaJPgdN6RaL8j21-KaDKKbrh3VFlYirORdiQ3MxoCtO8QAvD_BwE&amp;gbraid=0AAAAADhWWLJ5j927a8ePIZceRs447LN9W"><strong>Web API Destination</strong></a> to make the Get Attachment API call by message ID. Select the Input column for URL as that TemplateOutput.
<div id="attachment_11834" style="width: 733px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Web-API-Destination-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Get-Attachment-Example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11834" class="size-full wp-image-11834" src="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Web-API-Destination-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Get-Attachment-Example.png" alt="" width="723" height="775" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Web-API-Destination-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Get-Attachment-Example.png 723w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Web-API-Destination-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Get-Attachment-Example-280x300.png 280w" sizes="(max-width: 723px) 100vw, 723px" /></a><p id="caption-attachment-11834" class="wp-caption-text">SSIS Web API Destination – Get data from Microsoft Graph API (Office 365 API – Get Attachment Example)</p></div></li>
<li>Now, the next step is to parse the JSON Response String of the get attachment api call. For that, we need to use a <strong><a href="https://zappysys.com/products/ssis-powerpack/ssis-json-parser-transform/?utm_source=google&amp;utm_medium=cpc&amp;utm_campaign=22259122063&amp;utm_content=&amp;utm_term=&amp;gad_source=1&amp;gad_campaignid=22582753584&amp;gbraid=0AAAAADhWWLJ5j927a8ePIZceRs447LN9W&amp;gclid=CjwKCAiAzZ_NBhAEEiwAMtqKy1ZTPt9tVn9Xy9xU7z27q__H4RRoMa_SfgZg5L8maavtcr5HfzCl0RoC6_sQAvD_BwE">JSON Parser</a></strong>. Select the input as Web PAI Destination ResponseText and use the below sample JSON string to configure the metadata(Columns).<br />
<pre class="crayon-plain-tag">{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users('support%40zappysys.com')/messages('AQMkADAwATMwMAItMDkyMC0zZTg4AC0wMAItMDAKAEYAAAP_JUy')/attachments"
,"value":[{"@odata.type":"#microsoft.graph.fileAttachment","@odata.mediaContentType":"text/plain"
,"id":"AQMkADAwATMwMAItMDkyMC0zZTg4AC0wMAItMDAKAEYAAAP_JUy_27M"
,"lastModifiedDateTime":"2020-02-21T07:36:16Z"
,"name":"Test.txt","contentType":"text/plain","size":870,"isInline":false
,"contentId":null,"contentLocation":null,"contentBytes":"VGVzdCBNZXNzYWdl"}]}</pre>
<div id="attachment_11828" style="width: 1043px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-using-JSON-example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11828" class="size-full wp-image-11828" src="https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-using-JSON-example.png" alt="" width="1033" height="713" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-using-JSON-example.png 1033w, https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-using-JSON-example-300x207.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-using-JSON-example-1024x707.png 1024w, https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-using-JSON-example-768x530.png 768w" sizes="(max-width: 1033px) 100vw, 1033px" /></a><p id="caption-attachment-11828" class="wp-caption-text">JSON Parser Transform &#8211; using JSON example</p></div>
<div class="mceTemp"></div>
</li>
<li> Now, in the JSON Parser, go to the Go-to columns Tab and set the <strong>contentBytes</strong> DataType to <strong>DT_IMAGE,</strong> and increase the other columns&#8217; <strong>DT_WSTR</strong> lengths by 1000 and 1500. We set contentBytes to the <strong>DT_IMAGE</strong>  datatype, which is like varbinary(MAX).
<div id="attachment_11829" style="width: 838px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-Columns-Tab-fix-the-datatype.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11829" class="size-full wp-image-11829" src="https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-Columns-Tab-fix-the-datatype.png" alt="" width="828" height="611" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-Columns-Tab-fix-the-datatype.png 828w, https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-Columns-Tab-fix-the-datatype-300x221.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-Columns-Tab-fix-the-datatype-768x567.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-11829" class="wp-caption-text">JSON Parser Transform Columns Tab fix the datatype</p></div></li>
<li>Furthermore, in the next step, we need to use an SSIS Derived Column to set the FilePath where we want to save the attachments, and then concatenate the local file path with the attachment name column.
<div id="attachment_11830" style="width: 798px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Derived-Column-Add-New-Column-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11830" class="size-full wp-image-11830" src="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Derived-Column-Add-New-Column-1.png" alt="" width="788" height="624" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Derived-Column-Add-New-Column-1.png 788w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Derived-Column-Add-New-Column-1-300x238.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Derived-Column-Add-New-Column-1-768x608.png 768w" sizes="(max-width: 788px) 100vw, 788px" /></a><p id="caption-attachment-11830" class="wp-caption-text">SSIS Derived Column: Add New Column</p></div></li>
<li>Finally, we need to use the <a href="https://docs.microsoft.com/en-us/sql/integration-services/data-flow/transformations/export-column-transformation?view=sql-server-ver15" target="_blank" rel="noopener">Export Column</a> Transform (Native) to export attachment bytes to a local file. It needs to know 2 upstream info Bytes and the target file path.
<div id="attachment_11827" style="width: 763px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/Export-Column-configuration.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11827" class="size-full wp-image-11827" src="https://zappysys.com/blog/wp-content/uploads/2020/02/Export-Column-configuration.png" alt="" width="753" height="637" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/Export-Column-configuration.png 753w, https://zappysys.com/blog/wp-content/uploads/2020/02/Export-Column-configuration-300x254.png 300w" sizes="(max-width: 753px) 100vw, 753px" /></a><p id="caption-attachment-11827" class="wp-caption-text">Export Column configuration</p></div></li>
<li>Make sure to attach the export column to some destination (e.g., our ZS Trash Destination); the engine might remove it. At the same time, it optimizes the runtime. It may remove all transformations that don&#8217;t have a destination, such as deploying the package to SQL Server, or when you set optimize in Visual Studio.</li>
<li>That&#8217;s it, execute the package, and it will download all the email attachments.
<div id="attachment_11826" style="width: 1050px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/Downloaded-Mail-Attachments.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11826" class="size-full wp-image-11826" src="https://zappysys.com/blog/wp-content/uploads/2020/02/Downloaded-Mail-Attachments.png" alt="" width="1040" height="559" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/Downloaded-Mail-Attachments.png 1040w, https://zappysys.com/blog/wp-content/uploads/2020/02/Downloaded-Mail-Attachments-300x161.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/02/Downloaded-Mail-Attachments-1024x550.png 1024w, https://zappysys.com/blog/wp-content/uploads/2020/02/Downloaded-Mail-Attachments-768x413.png 768w" sizes="(max-width: 1040px) 100vw, 1040px" /></a><p id="caption-attachment-11826" class="wp-caption-text">Downloaded Mail Attachments</p></div></li>
</ol>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>After all, in this article, we learned how to make a Microsoft Graph API REST API call. We used the <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS JSON / REST API Connector</a> to extract data from Outlook Mail using OAuth. Made the Get attachment API call using the <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">Web API Destination</a> and parsed the JSON response using the <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-parser-transform/" target="_blank" rel="noopener">JSON Parser</a>. And using the Native SSIS Export Column, we saved the export attachment&#8217;s bytes to a local file. To explore many other scenarios not discussed in this article, download <a href="https://zappysys.com/products/ssis-powerpack/">SSIS PowerPack from here (includes 70+ Components)</a>.</p>
<h2><span id="References">References</span></h2>
<p>Finally, you can use the following links for more information:</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>Help File: <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/json-source.htm" target="_blank" rel="noopener">JSON Source(REST API or File)</a></li>
<li>Help File: <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=ssis-web-api-destination.htm" target="_blank" rel="noopener">Web API Destination</a></li>
<li>Help File: <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=ssis-json-parser-transform.htm" target="_blank" rel="noopener">JSON Parser Transform</a></li>
<li><a href="https://docs.microsoft.com/en-us/graph/overview" target="_blank" rel="noopener">Overview of the Microsoft Graph API</a></li>
</ul>
</li>
</ul>
<p>The post <a href="https://zappysys.com/blog/get-office-365-mail-attachments-using-ssis/">How to Get Office 365 Mail Attachments using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to read YouTube API data in SSIS (Videos, Channels, Playlists)</title>
		<link>https://zappysys.com/blog/read-youtube-api-data-ssis-videos-channels-playlists/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 06 May 2019 18:06:07 +0000</pubDate>
				<category><![CDATA[Google API]]></category>
		<category><![CDATA[REST API]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS CSV Generator Transform]]></category>
		<category><![CDATA[SSIS JSON Parser Transform]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS OAuth Connection]]></category>
		<category><![CDATA[SSIS REST API Task]]></category>
		<category><![CDATA[SSIS WEB API Destination]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[youtube]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=6894</guid>

					<description><![CDATA[<p>Introduction In last few articles we saw how to read data from various Google Services. In this article we will see how to read YouTube API data in SSIS. This blog mainly focus on SSIS approach but steps mentioned to call Google APIs can be useful for any developer regardless which programming language or toolset [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-youtube-api-data-ssis-videos-channels-playlists/">How to read YouTube API data in SSIS (Videos, Channels, Playlists)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF8B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>UPDATE:</strong> ZappySys has released a brand new <a href="https://zappysys.com/api/integration-hub/youtube-connector/">API Connector for YouTube</a> which makes it much simpler to <strong>Read/Write YouTube Data in SSIS</strong> compared to the steps listed in this article. You can still use steps from this article but if you are new to API or want to avoid learning curve with API then use newer approach.</p>
<p>Please visit <a href="https://zappysys.com/api/integration-hub/">this page to see all</a> Pre-Configured ready to use API connectors which you can use in <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-source/">SSIS API Source</a> / <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-destination/">SSIS API Destination</a> OR <a href="https://zappysys.com/products/odbc-powerpack/odbc-api-driver/">API ODBC Driver</a> (for non-SSIS Apps such as Excel, Power BI, Informatica).</p>
</div></div>
<a href="https://zappysys.com/blog/wp-content/uploads/2019/05/youtube-logo.png"><img loading="lazy" decoding="async" class=" wp-image-6904 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/05/youtube-logo.png" alt="" width="100" height="100" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/youtube-logo.png 400w, https://zappysys.com/blog/wp-content/uploads/2019/05/youtube-logo-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2019/05/youtube-logo-300x300.png 300w" sizes="(max-width: 100px) 100vw, 100px" /></a>In last <a href="https://zappysys.com/blog/category/google-api/">few articles</a> we saw how to read data from various Google Services. In this article we will see how to read YouTube API data in SSIS. This blog mainly focus on SSIS approach but steps mentioned to call Google APIs can be useful for any developer regardless which programming language or toolset you use.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>Connect to YouTube API in SSIS (OAuth Connection)</h2>
<p>Very first step to call any Google API is to create an API project for Google Service and then enable APIs you like to call in Console. In our case we need to enable YouTube API.</p>
<p><a href="https://zappysys.com/blog/register-google-oauth-application-get-clientid-clientsecret/" target="_blank" rel="noopener">Check this article</a> to learn how to create API Project and obtain Client ID and Client Secret to connect to YouTube API. For ease of use use Default Application provided by ZappySys but we still recommend using your own Custom Application  on OAuth Connection.</p>
<p>Before we try our first YouTube API example, we recommend you to get familiar with <a href="https://developers.google.com/youtube/v3/docs/" target="_blank" rel="noopener">YouTube API here</a>. Once you done with above steps you can perform the following steps to call YouTube API in SSIS.</p>
<ol>
<li>Open existing SSIS Project or Create new One in Visual Studio (i.e. SSDT)</li>
<li>Create a new SSIS Package. Right click in the Connection Manager Panel and click <strong>&#8220;New Connection&#8230;&#8221;</strong>.<br />
<img decoding="async" class="figureimage" title="SSIS Create New Connection" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/ssis-new-connection.png" alt="SSIS Create New Connection" /></li>
<li>When Dialog box opens select <strong>ZS-OAUTH</strong> connection type.
<div id="attachment_4724" style="width: 681px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/08/ssis-connection-managers-list-select-zs-oauth-connection-manager.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4724" class="size-full wp-image-4724" src="https://zappysys.com/blog/wp-content/uploads/2018/08/ssis-connection-managers-list-select-zs-oauth-connection-manager.png" alt="SSIS Connection Maangers List: Select O-AUTH Connection Manager" width="671" height="549" srcset="https://zappysys.com/blog/wp-content/uploads/2018/08/ssis-connection-managers-list-select-zs-oauth-connection-manager.png 671w, https://zappysys.com/blog/wp-content/uploads/2018/08/ssis-connection-managers-list-select-zs-oauth-connection-manager-300x245.png 300w" sizes="(max-width: 671px) 100vw, 671px" /></a><p id="caption-attachment-4724" class="wp-caption-text">SSIS Connection Managers List: Select O-AUTH Connection Manager</p></div></li>
<li>Once OAuth UI opens, Configure Google connection like below.
<ol>
<li>Select Service Type as <strong>Google</strong></li>
<li>You can select Default App for ease of use or Select Custom Application (Enter Client Id and Secret Obtained using <a href="https://zappysys.com/blog/register-google-oauth-application-get-clientid-clientsecret/" target="_blank" rel="noopener">these steps</a> )</li>
<li>In the Scope Enter below &#8211; One scope per line for calling correct YouTube API. Refer to <a href="https://developers.google.com/youtube/v3/docs/" target="_blank" rel="noopener">YouTube API documentation</a> incase you need extra permissions. For read only operation we just need below scopes. Last scope is only needed if you need to use <a href="https://developers.google.com/youtube/analytics/reference/reports/query" target="_blank" rel="noopener">YouTube Analytics Reports</a><br />
<pre class="crayon-plain-tag">https://www.googleapis.com/auth/youtube
https://www.googleapis.com/auth/youtube.readonly
https://www.googleapis.com/auth/yt-analytics.readonly</pre>
</li>
</ol>
</li>
<li>Click Generate Token to obtain Refresh Token (You may see Login Prompt, and then Grant Permission Confirmation Screen)
<div id="attachment_6855" style="width: 930px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/ssis-oauth-connection-manager-generate-access-token.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6855" class="size-full wp-image-6855" src="https://zappysys.com/blog/wp-content/uploads/2016/04/ssis-oauth-connection-manager-generate-access-token.png" alt="Connect to Google API using OAuth 2.0 (Youtube API Example)" width="920" height="1032" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/ssis-oauth-connection-manager-generate-access-token.png 920w, https://zappysys.com/blog/wp-content/uploads/2016/04/ssis-oauth-connection-manager-generate-access-token-267x300.png 267w, https://zappysys.com/blog/wp-content/uploads/2016/04/ssis-oauth-connection-manager-generate-access-token-768x861.png 768w, https://zappysys.com/blog/wp-content/uploads/2016/04/ssis-oauth-connection-manager-generate-access-token-913x1024.png 913w" sizes="(max-width: 920px) 100vw, 920px" /></a><p id="caption-attachment-6855" class="wp-caption-text">Connect to Google API using OAuth 2.0 (YouTube API Example)</p></div></li>
<li>Click OK to save UI.</li>
</ol>
<h2>Call YouTube REST API Example</h2>
<p>Now lets look at how to call YouTube API <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">REST API Task</a> this task is more suitable to call GET, POST, DELETE, PUT requests without parsing data in Rows and Columns. If you need to parse data and load into Database table then see next section (Use JSON Source)</p>
<ol>
<li>From SSIS Toolbox look for items starting with “ZS”. Drag and Drop <b>[ZS Rest API Task]</b> to Designer Surface.<br />
<img decoding="async" class="figureimage" title="SSIS REST Api Web Service Task - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/rest-api-task/ssis-rest-api-web-service-task-drag.png" alt="SSIS REST Api Task - Drag and Drop" /></li>
<li>Double click it to configure like below.
<ol>
<li>Select URL From Connection option</li>
<li>Select OAuth connection created in previous section.</li>
<li>Enter URL like below (For example <a href="https://developers.google.com/youtube/v3/docs/playlists/list" target="_blank" rel="noopener">get all playlists</a>). Replace xxxxxxxxxxx with your own channel ID (Its usually found in URL when you visit Youtube Channel Homepage)<br />
<pre class="crayon-plain-tag">https://www.googleapis.com/youtube/v3/playlists?part=snippet,id&amp;channelId=xxxxxxxxxxxxx</pre>
</li>
<li>Click Test Request Button</li>
</ol>
</li>
<li>Here is how it looks like
<div id="attachment_6896" style="width: 854px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-call-youtube-api-with-dynamic-url.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6896" class="size-full wp-image-6896" src="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-call-youtube-api-with-dynamic-url.png" alt="Call Youtube API in SSIS Example (Dynamic URL)" width="844" height="640" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-call-youtube-api-with-dynamic-url.png 844w, https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-call-youtube-api-with-dynamic-url-300x227.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-call-youtube-api-with-dynamic-url-768x582.png 768w" sizes="(max-width: 844px) 100vw, 844px" /></a><p id="caption-attachment-6896" class="wp-caption-text">Call Youtube API in SSIS Example (Dynamic URL)</p></div></li>
</ol>
<p>That&#8217;s it we have successfully configured Connection for YouTube API in SSIS. In the next section we will see how to use this connection and read various data from YouTube API.</p>
<h2>Read YouTube Playlists in SSIS</h2>
<p>Once we done creating OAuth Connection Manager we can move forward to read YouTube data inside Data Flow.</p>
<p>Configure SSIS JSON / REST API Source</p>
<ol>
<li>Now, Drag and Drop SSIS <b>Data Flow Task</b> from SSIS Toolbox.<br />
<img decoding="async" class="figureimage" title="SSIS Data Flow Task - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/drag-and-drop-data-flow-task.png" alt="SSIS Data Flow Task - Drag and Drop" /></li>
<li>Double click on the Data Flow task to see Data Flow designer surface.</li>
<li>From the SSIS toolbox drag and drop JSON Source on the dataflow designer surface.<br />
<img decoding="async" class="figureimage" title="SSIS JSON Source - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/json-source/ssis-json-source-adapter-drag.png" alt="SSIS JSON Source - Drag and Drop" /></li>
<li>Double click JSON Source and enter URL as below (Use variable or Hardcode Channel Id). maxResults controls how many rows you want to get in each response. Rep<br />
<pre class="crayon-plain-tag">https://www.googleapis.com/youtube/v3/playlists?part=snippet,id&amp;maxResults=50&amp;channelId={{User::varChannelId}}
--OR-- 
https://www.googleapis.com/youtube/v3/playlists?part=snippet,id&amp;maxResults=50&amp;channelId=xxxxxxxxxxxxxxxxxxxxxx</pre>
</li>
<li>Check Use Credentials and select existing OAuth connection or Create New one</li>
<li>Select Array Filter (Items node) or type <pre class="crayon-plain-tag">$.items[*]</pre>  as below.
<div id="attachment_6900" style="width: 857px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-youtube-get-playlists.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6900" class="size-full wp-image-6900" src="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-youtube-get-playlists.png" alt="Get Playlists for YouTube Channel" width="847" height="738" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-youtube-get-playlists.png 847w, https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-youtube-get-playlists-300x261.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-youtube-get-playlists-768x669.png 768w" sizes="(max-width: 847px) 100vw, 847px" /></a><p id="caption-attachment-6900" class="wp-caption-text">Get Playlists for YouTube Channel</p></div></li>
<li>That&#8217;s it you can now Click <strong>Preview</strong> to see sample data. In the next section we will configure Pagination to read all records if you have more than 100 rows.</li>
</ol>
<h3>Configure YouTube REST API Pagination</h3>
<p>Most REST APIs dont return data in one big response. So you have to make sure you implement looping / pagination to read more records. Luckily ZappySys supports <a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/">many different Pagination Settings</a>. Here is how to configure YouTube REST API Pagination.</p>
<ol>
<li>Go to Pagination Tab found on JSON Source and select following 3 settings</li>
<li>Select Pagination Mode as <pre class="crayon-plain-tag">Response Attribute Mode</pre></li>
<li>Enter Next Link as <pre class="crayon-plain-tag">$.nextPageToken</pre></li>
<li>Enter Suffix for Next URL as <pre class="crayon-plain-tag">&amp;pageToken=&lt;%nextlink%&gt;</pre></li>
</ol>
<div id="attachment_6899" style="width: 555px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/youtube-rest-api-pagination.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6899" class="size-full wp-image-6899" src="https://zappysys.com/blog/wp-content/uploads/2019/05/youtube-rest-api-pagination.png" alt="YouTube REST API Pagination Settings" width="545" height="246" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/youtube-rest-api-pagination.png 545w, https://zappysys.com/blog/wp-content/uploads/2019/05/youtube-rest-api-pagination-300x135.png 300w" sizes="(max-width: 545px) 100vw, 545px" /></a><p id="caption-attachment-6899" class="wp-caption-text">YouTube REST API Pagination Settings</p></div>
<h2>Read YouTube Playlist Videos in SSIS</h2>
<p>So in previous section we saw simple API call to read all playlists from YouTube. Now lets see how to get information about <a href="https://developers.google.com/youtube/v3/docs/playlistItems/list" target="_blank" rel="noopener">Playlist Videos</a>.</p>
<p>For that everything should remain same as previous section except change URL as below. Where xxxxxxxxxxxxxxxxxxxxx is your Playlist ID obtained from Previous Call.</p><pre class="crayon-plain-tag">https://www.googleapis.com/youtube/v3/playlistItems?part=snippet,id&amp;maxResults=50&amp;playlistId=xxxxxxxxxxxxxxxxxxxxx</pre><p>
<h2>Get all Videos for YouTube Channel</h2>
<p>If you want to get all video name and ID for specific channel then use below URL. Click here to <a href="https://developers.google.com/youtube/v3/docs/search/list" target="_blank" rel="noopener">read more</a>. Replace xxxxxxxxxxxxxxxxxxx with your Channel ID.</p><pre class="crayon-plain-tag">https://www.googleapis.com/youtube/v3/search?channelId=xxxxxxxxxxxxxxxxxxx&amp;part=snippet,id&amp;order=date&amp;maxResults=50</pre><p>
&nbsp;</p>
<h2>Read YouTube Video Views, Likes, Dislikes (Extended Videos)</h2>
<p>Another common request from YouTube API is get Video Information such as Views, Likes, Dislikes, Comment Count etc. For that you can <a href="https://developers.google.com/youtube/v3/docs/videos/list" target="_blank" rel="noopener">use this api</a> . However the issue is this endpoint requires you to pass Comma separated Ids of Video. You can only pass 25 Ids in one requests so if you have 200 videos for which you need to get information then you have to make 8 requests (25 Ids in each Request). In below screenshot you can see we used <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">Fiddler to debug web requests</a>.</p>
<p>So here is how high level process to fetch extended information for all Videos in your channel. Full <a href="https://zappysys.com/blog/wp-content/uploads/2019/05/Google_Youtube_API_Demo.zip">SSIS Package is attached here (SSIS 2012 Format)</a>.</p>
<ol>
<li>Get all videos for your channel by calling (Assuming you will paginate in below request.<br />
<pre class="crayon-plain-tag">https://www.googleapis.com/youtube/v3/search?channelId=xxxxxxxxxxxxxxxxxxx&amp;part=snippet,id&amp;order=date&amp;maxResults=50</pre>
</li>
<li>Build Video Id groups for 25 Ids from above result and submit requests. For example if above request returns 200 Videos then your request to fetch extended information may look like below.<br />
<pre class="crayon-plain-tag">https://www.googleapis.com/youtube/v3/videos?part=snippet,contentDetails,statistics&amp;id=ID1,ID2,ID3........ID25
https://www.googleapis.com/youtube/v3/videos?part=snippet,contentDetails,statistics&amp;id=ID26,ID27,ID28........ID50
........
........
https://www.googleapis.com/youtube/v3/videos?part=snippet,contentDetails,statistics&amp;id=ID176,ID177,ID178........ID200</pre>
</li>
<li>Parse response coming from each Request Above&#8230;. Each Response will give you details about 25 videos you requesting.</li>
</ol>
<p>Here is the flow of our complete data flow to read extended information for all videos. You can read extended information one by one too but it wont be good idea if you have many videos.</p>
<p>We have used Following Components to achieve Bulk Mode</p>
<ul>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">JSON Source (REST API Source)</a></li>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-parser-transform/" target="_blank" rel="noopener">CSV Parser Transform</a></li>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">Web API Destination</a></li>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-json-parser-transform/" target="_blank" rel="noopener">JSON Parser Transform</a></li>
</ul>
<div id="attachment_6901" style="width: 1306px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-get-youtube-video-view-count-likes-dislikes.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6901" class="size-full wp-image-6901" src="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-get-youtube-video-view-count-likes-dislikes.png" alt="Get YouTube Video View Clicks, Likes, Dislikes (Bulk Mode for all videos)" width="1296" height="823" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-get-youtube-video-view-count-likes-dislikes.png 1296w, https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-get-youtube-video-view-count-likes-dislikes-300x191.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-get-youtube-video-view-count-likes-dislikes-768x488.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-get-youtube-video-view-count-likes-dislikes-1024x650.png 1024w" sizes="(max-width: 1296px) 100vw, 1296px" /></a><p id="caption-attachment-6901" class="wp-caption-text">Get YouTube Video View Clicks, Likes, Dislikes (Bulk Mode for all videos)</p></div>
<h2>Read data from YouTube Analytics / Reporting API (Metrics, Dimensions Report)</h2>
<p>So far we have seen basic YouTube APIs to extract your Channel information. However there is another very powerful API endpoint to query custom reports from YouTube. Check <a href="https://developers.google.com/youtube/analytics/reference/reports/query" target="_blank" rel="noopener">this YouTube Analytics API endpoint</a>. In this section we will learn how to extract useful information from YouTube using Analytics API.</p>
<h3>Step-By-Step</h3>
<p>Let&#8217;s look at an example to read total views, estimated watch time, average view duration and some other metrics by date for channel you have access.</p>
<ol>
<li>Go to Data Flow, Drag ZS JSON Source from SSIS Toolbox</li>
<li>Double click to configure.</li>
<li>Check Use Credentials. Select OAuth connection we created in previous section.</li>
<li>In the URL field, Enter Below Sample URL. Change Parameters as per your need or leave it default.<br />
For example:<br />
<strong>ids=channel==MINE</strong>   (where MINE can be replaced by other channel id or keep it as MINE to get data for your own channel)<br />
<strong>metrics</strong> (can be changed from any <a href="https://developers.google.com/youtube/analytics/metrics" target="_blank" rel="noopener">valid list here</a>)<br />
<strong>dimensions</strong> (can be changed to any valid <a href="https://developers.google.com/youtube/analytics/dimensions" target="_blank" rel="noopener">list from here</a>)<br />
<strong>startDate</strong> (Must be YYYY-MM-DD format)<br />
<strong>endDate</strong> (Must be YYYY-MM-DD format)<br />
<pre class="crayon-plain-tag">https://youtubeanalytics.googleapis.com/v2/reports?ids=channel==MINE&amp;metrics=views,estimatedMinutesWatched,averageViewDuration,averageViewPercentage,subscribersGained&amp;dimensions=day&amp;startDate=2019-03-01&amp;endDate=2019-04-01</pre>
</li>
<li>Change Filter to <pre class="crayon-plain-tag">$.rows[*]</pre></li>
<li>Go to <strong>2D Array Transform</strong> tab.<br />
Select Method as <pre class="crayon-plain-tag">Simple 2-dimensional array</pre>
EnterColumn Filter as  <pre class="crayon-plain-tag">$.columnHeaders[*].name</pre>
<div id="attachment_6909" style="width: 906px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/advanced-transform-youtube-analytics-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6909" class="size-full wp-image-6909" src="https://zappysys.com/blog/wp-content/uploads/2019/05/advanced-transform-youtube-analytics-api.png" alt="YouTube Analytics API Advanced Transformation" width="896" height="270" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/advanced-transform-youtube-analytics-api.png 896w, https://zappysys.com/blog/wp-content/uploads/2019/05/advanced-transform-youtube-analytics-api-300x90.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/advanced-transform-youtube-analytics-api-768x231.png 768w" sizes="(max-width: 896px) 100vw, 896px" /></a><p id="caption-attachment-6909" class="wp-caption-text">YouTube Analytics API Advanced Transformation</p></div></li>
<li>That&#8217;s it now Preview your data. See below over all steps.
<div id="attachment_6910" style="width: 978px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-youtube-analytics-report-api-dimensions-metrics.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6910" class="size-full wp-image-6910" src="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-youtube-analytics-report-api-dimensions-metrics.png" alt="Read data from YouTube Analytics API (Custom Reports using Dimensions, Metrics Query)" width="968" height="741" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-youtube-analytics-report-api-dimensions-metrics.png 968w, https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-youtube-analytics-report-api-dimensions-metrics-300x230.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-youtube-analytics-report-api-dimensions-metrics-768x588.png 768w" sizes="(max-width: 968px) 100vw, 968px" /></a><p id="caption-attachment-6910" class="wp-caption-text">Read data from YouTube Analytics API (Custom Reports using Dimensions, Metrics Query)</p></div></li>
</ol>
<h3>Build YouTube Analytics / Reporting API Query (API Playground)</h3>
<p>With Analytics API You can extract many interesting data. You can use Test Tool found <a href="https://developers.google.com/youtube/analytics/reference/reports/query" target="_blank" rel="noopener">on this page to build</a> some interesting queries. Scroll to <strong>Common Use Cases</strong> section on that link. On the right side you can select Credentials Type as OAuth and click Execute.</p>
<p><a href="https://developers.google.com/youtube/analytics/reference/reports/query" target="_blank" rel="noopener">https://developers.google.com/youtube/analytics/reference/reports/query</a></p>
<div id="attachment_6911" style="width: 944px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/youtube-analytics-api-explorer-test-query-builder.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6911" class="size-full wp-image-6911" src="https://zappysys.com/blog/wp-content/uploads/2019/05/youtube-analytics-api-explorer-test-query-builder.jpg" alt="YouTube Analytics / Reporting API Explorer (Testing API Calls)" width="934" height="688" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/youtube-analytics-api-explorer-test-query-builder.jpg 934w, https://zappysys.com/blog/wp-content/uploads/2019/05/youtube-analytics-api-explorer-test-query-builder-300x221.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/youtube-analytics-api-explorer-test-query-builder-768x566.jpg 768w" sizes="(max-width: 934px) 100vw, 934px" /></a><p id="caption-attachment-6911" class="wp-caption-text">YouTube Analytics / Reporting API Explorer (Testing API Calls)</p></div>
<h2>Loading YouTube API Data into SQL Server</h2>
<div class="content_block" id="custom_post_widget-5617"><p>ZappySys SSIS PowerPack makes it easy to load data from various sources such as REST, SOAP, JSON, XML, CSV or from other source into SQL Server, or PostgreSQL, or Amazon Redshift, or other  targets. The <strong>Upsert Destination</strong> component allows you to automatically insert new records and update existing ones based on key columns. Below are the detailed steps to configure it.</p>
<h3>Step 1: Add Upsert Destination to Data Flow</h3>
<ol>
<li>Drag and drop the <strong>Upsert Destination</strong> component from the SSIS Toolbox.</li>
<li>Connect your source component (e.g., JSON / REST / Other Source) to the Upsert Destination.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png" /></a>
<p class="wp-caption-text">SSIS - Data Flow - Drang and Drop Upsert Destination Component</p>
</div>
<h3>Step 2: Configure Target Connection</h3>
<ol>
<li>Double-click the <strong>Upsert Destination</strong> component to open the configuration window.</li>
<li>Under <strong>Connection</strong>, select an existing target connection or click <strong>NEW</strong> to create a new connection.
<ul>
<li>Example: SQL Server, or PostgreSQL, or Amazon Redshift.</li>
</ul>
</li>
</ol>
<h3>Step 3: Select or Create Target Table</h3>
<ol>
<li>In the <strong>Target Table</strong> dropdown, select the table where you want to load data.</li>
<li>Optionally, click <strong>NEW</strong> to create a new table based on the source columns.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png" /></a>
<p class="wp-caption-text">Configure SSIS Upsert Destination Connection - Loading data (REST / SOAP / JSON / XML /CSV) into SQL Server or other target using SSIS</p>
</div>
<h3>Step 4: Map Columns</h3>
<ol>
<li>Go to the <strong>Mappings</strong> tab.</li>
<li>Click <strong>Auto Map</strong> to map source columns to target columns by name.</li>
<li>Ensure you <strong>check the Primary key column(s)</strong> that will determine whether a record is inserted or updated.</li>
<li>You can manually adjust the mappings if necessary.</li>
</ol>
 <div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination - Columns Mappings</p>
</div>
<h3>Step 5: Save Settings</h3>
<ul>
<li>Click <strong>OK</strong> to save the Upsert Destination configuration.</li>
</ul>
<h3>Step 6: Optional: Add Logging or Analysis</h3>
<ul>
<li>You may add extra destination components to log the number of inserted vs. updated records for monitoring or auditing purposes.</li>
</ul>
<h3>Step 7: Execute the Package</h3>
<ul>
<li>Run your SSIS package and verify that the data is correctly inserted and updated in the target table.</li>
</ul>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination Execution</p>
</div></div>
<h2>Download Sample SSIS Package</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/Google_Youtube_API_Demo.zip">SSIS Package is attached here (SSIS 2012 Format)</a>.</p>
<h2>Conclusion</h2>
<p>In this article we saw how to extract information from REST API such as YouTube REST API using OAuth 2.0. We also learned techniques like Pagination, JSON Parsing, Request Batching using multiple components to achieve full scale API integration. To explore many other scenarios not discussed in this article download <a href="https://zappysys.com/products/ssis-powerpack/">SSIS PowerPack from here (includes 70+ Components)</a>.</p>
<p>The post <a href="https://zappysys.com/blog/read-youtube-api-data-ssis-videos-channels-playlists/">How to read YouTube API data in SSIS (Videos, Channels, Playlists)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to batch REST API requests in SSIS (Bulk Operation)</title>
		<link>https://zappysys.com/blog/batch-rest-api-requests-ssis-bulk-operation/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 06 Feb 2019 21:32:43 +0000</pubDate>
				<category><![CDATA[SSIS CSV Generator Transform]]></category>
		<category><![CDATA[SSIS JSON Generator Transform]]></category>
		<category><![CDATA[SSIS Script Component]]></category>
		<category><![CDATA[SSIS WEB API Destination]]></category>
		<category><![CDATA[SSIS XML Generator Transform]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=6305</guid>

					<description><![CDATA[<p>Introduction In our previous article we saw how to POST data to REST API using few different ways. Now let&#8217;s go one step further and discuss another common scenario to batch REST API requests in SSIS. For efficient data transfer many API provides you to submit multiple records in a single request. In this article [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/batch-rest-api-requests-ssis-bulk-operation/">How to batch REST API requests in SSIS (Bulk Operation)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In our previous article we saw <a href="https://zappysys.com/blog/http-post-in-ssis-send-data-to-web-api-url-json-xml/" target="_blank" rel="noopener">how to POST data to REST API</a> using few different ways. Now let&#8217;s go one step further and discuss another common scenario to batch REST API requests in SSIS. For efficient data transfer many API provides you to submit multiple records in a single request. In this article we will look at few ways to batch our requests using <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/" target="_blank" rel="noopener">SSIS JSON Generator Transform</a> and  <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">SSIS Web API destination</a>.</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>Method 1 &#8211; Batch records using SSIS JSON / XML Generator Transform</h2>
<p>First let&#8217;s look at common way to group multiple records and generate single JSON or XML document for desired batch size. We will also see another technique where you can assign Unique BatchID to each document.</p>
<p>For example below screenshot shows how to product one JSON document for every 10 input rows. We have also use BatchID column on the root level. This will use use BatchID from first row of that batch. You can use <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-generator-transform/" target="_blank" rel="noopener">XML Generator Transform</a> if you like to produce XML Document rather than JSON.</p>
<p>To generate Unique BatchID you can use function like newid() in SQL Server.</p><pre class="crayon-plain-tag">SELECT newid() as BatchID,CustomerID,CompanyName FROM Customers</pre><p>
<div id="attachment_6306" style="width: 1115px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-json-with-batch-setting.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6306" class="size-full wp-image-6306" src="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-json-with-batch-setting.png" alt="Using SSIS JSON Generator Transform with Batch Option (Multiple Records in a single document)" width="1105" height="865" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-json-with-batch-setting.png 1105w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-json-with-batch-setting-300x235.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-json-with-batch-setting-768x601.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-json-with-batch-setting-1024x802.png 1024w" sizes="(max-width: 1105px) 100vw, 1105px" /></a><p id="caption-attachment-6306" class="wp-caption-text">Using SSIS JSON Generator Transform with Batch Option (Multiple Records in a single document)</p></div>
<p>&nbsp;</p>
<p>Here if full flow to batch your JSON Requests and Submit to REST API.</p>
<div id="attachment_6307" style="width: 671px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-post-data-rest-api-in-batch.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6307" class="size-full wp-image-6307" src="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-post-data-rest-api-in-batch.png" alt="POST data to REST API in Bulk Mode (Batch multiple rows)" width="661" height="785" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-post-data-rest-api-in-batch.png 661w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-post-data-rest-api-in-batch-253x300.png 253w" sizes="(max-width: 661px) 100vw, 661px" /></a><p id="caption-attachment-6307" class="wp-caption-text">POST data to REST API in Bulk Mode (Batch multiple rows)</p></div>
<p>&nbsp;</p>
<h2>Method 2 &#8211; Using SSIS Web API destination Batch Mode with Header / Footer</h2>
<p>Another method of batching is use Web API destination and turn on Batch mode.  You can <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">use Fiddler</a> to debug your web requests incase you are not sure how its generating and sending POST requests after this setting.</p>
<div id="attachment_2616" style="width: 919px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-smartsheet-rest-api-post-bulk-mode-web-api-destination.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2616" class="size-full wp-image-2616" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-smartsheet-rest-api-post-bulk-mode-web-api-destination.png" alt="Configure SSIS Web API Destination for Bulk API call (Smartsheet REST API - Insert multiple rows)" width="909" height="445" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-smartsheet-rest-api-post-bulk-mode-web-api-destination.png 909w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-smartsheet-rest-api-post-bulk-mode-web-api-destination-300x147.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-smartsheet-rest-api-post-bulk-mode-web-api-destination-768x376.png 768w" sizes="(max-width: 909px) 100vw, 909px" /></a><p id="caption-attachment-2616" class="wp-caption-text">Configure SSIS Web API Destination for Bulk API call (Insert multiple rows)</p></div>
<h2>Method 3 &#8211; Batch CSV records using CSV Generator Transform</h2>
<p>So far we looked at how to batch JSON and XML format. Now let&#8217;s look at scenario where you have to POST CSV formatted data to REST API endpoint.</p>
<p>Assume that you have an API endpoint where you can submit data in multiple batches. Also you have few additional requirements</p>
<ol>
<li>First row of First batch must have column names (any other batch must not contains CSV Header)</li>
<li>In each Batch we want to submit maximum 5 rows as per API call</li>
<li>Each batch must contain Unique Batch Number in URL</li>
</ol>
<p>Here is high level flow.</p>
<div id="attachment_6333" style="width: 1148px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-csv-using-output-in-batch-setting.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6333" class="size-full wp-image-6333" src="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-csv-using-output-in-batch-setting.png" alt="Generate CSV using Batch Setting , Send data to REST API in multiple batches, Debug REST API in Fiddler" width="1138" height="508" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-csv-using-output-in-batch-setting.png 1138w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-csv-using-output-in-batch-setting-300x134.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-csv-using-output-in-batch-setting-768x343.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-csv-using-output-in-batch-setting-1024x457.png 1024w" sizes="(max-width: 1138px) 100vw, 1138px" /></a><p id="caption-attachment-6333" class="wp-caption-text">Generate CSV using Batch Setting , Send data to REST API in multiple batches, Debug REST API in Fiddler</p></div>
<h3>Include CSV Header in First Batch Only</h3>
<p>Now let&#8217;s break down the problem and find out how to do. First problem is we need to include CSV Header only in First batch. To achieve this we use old school trick where we output column names as data row&#8230; and when we generate CSV in the next section we will turn off Column Headers option.</p>
<p>If you are consuming records from SQL Server or any other RDBMS you can write following style source query. If you don&#8217;t use relational source then use native UNION Transform in SSIS.</p><pre class="crayon-plain-tag">select 'CustomerID' as Column1, 'OrderID' as Column2
UNION ALL
select top 12 cast(CustomerID as varchar(1000)), cast(OrderID as varchar(1000)) from Invoices</pre><p>
<h3>Batch records and output CSV data</h3>
<p>Now next step would be to generate CSV data but in batches&#8230; so in our example we have to output size of 5 rows per batch. For this perform the following steps</p>
<ol>
<li>Drag ZS CSV Generator Transform (Included in <strong>v2.8</strong> and Higher)</li>
<li>Connect source to CSV Generator Transform</li>
<li>Now before we edit in UI mode, <strong>right click</strong> and select <strong>Properties</strong>. Change following 3 properties  (You can also change QuoteAroundValue and Dimiliter if needed). In future version batch setting will be visible in UI mode too.
<ol>
<li>ArrayBatchSize  = yourbatchsize (in our case it was just 5 rows per batch)</li>
<li>OutputMode = SingleFileFormat</li>
<li>FirstRowsHasColumnNames  =False</li>
</ol>
</li>
<li>Now double click to configure ZS Generator Output</li>
<li>Right click on Mappings folder node and Add Elements &gt; Select Multiple Columns  &gt; Check columns you like to output</li>
<li>Click OK to Save UI</li>
</ol>
<div id="attachment_6336" style="width: 611px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-csv-generator-output-data-in-batch.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6336" class="size-full wp-image-6336" src="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-csv-generator-output-data-in-batch.png" alt="Generate CSV data in SSIS (Batch Output Setting)" width="601" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-csv-generator-output-data-in-batch.png 601w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-csv-generator-output-data-in-batch-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-csv-generator-output-data-in-batch-300x300.png 300w" sizes="(max-width: 601px) 100vw, 601px" /></a><p id="caption-attachment-6336" class="wp-caption-text">Generate CSV data in SSIS (Batch Output Setting)</p></div>
<h3>Generate unique URL with Batch using Script Component</h3>
<p>Now next task we have to achieve is generate Unique Batch Number. Put that Batch ID in URL like below&#8230;</p><pre class="crayon-plain-tag">http://httpbin.org/post?batch=0
http://httpbin.org/post?batch=1
http://httpbin.org/post?batch=2
.....</pre><p>
<ol>
<li>For this drag SSIS Script Component and select Transformation Mode</li>
<li>Now go to <strong>Inputs and Outputs</strong> tab &gt; Select <strong>Output Columns</strong> &gt; Click <strong>Add Column</strong> &gt; Name it as <strong>URL</strong> &gt; Configure <strong>DataType</strong> as <strong>DT_WSTR</strong> , <strong>Length</strong> = 500</li>
<li>Now got Script Tab and Click Edit. Remove old code and enter following code (Assuming You selected C#). This code will generate new URL with Unique batch ID each time. You can use this same technique to generate Unique row number too (in that case rather than DT_WSTR type you can use DT_I4 type)</p><pre class="crayon-plain-tag">[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
{
    private static int _batch;
    public override void Input0_ProcessInputRow(Input0Buffer Row)
    {
        Row.Url = string.Format("http://httpbin.org/post?batch={0}",_batch);
        //If you have to send GUID rather than Integer for Batch ID then use below code
        //Row.Url = string.Format("http://httpbin.org/post?batch={0}",System.Guid.NewGuid());

        _batch = _batch+1;
    }
}</pre><p>
</li>
<li>Click OK to Save script.</li>
</ol>
<div id="attachment_6334" style="width: 681px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-script-component-unique-row-number-output-new-column.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6334" class="size-full wp-image-6334" src="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-script-component-unique-row-number-output-new-column.png" alt="Output Unique URL or Number using SSIS Script Transform" width="671" height="768" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-script-component-unique-row-number-output-new-column.png 671w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-script-component-unique-row-number-output-new-column-262x300.png 262w" sizes="(max-width: 671px) 100vw, 671px" /></a><p id="caption-attachment-6334" class="wp-caption-text">Output Unique URL or Number using SSIS Script Transform</p></div>
<h3>Configure Web API Destination to POST CSV Data</h3>
<p>Now final step is to configure SSIS Web API Destination to POST CSV data to API.</p>
<ol>
<li>Drag ZS Web API Destination and connect Source Transform to Web API destination.</li>
<li>Double click to configure</li>
<li>Select Connection Manager</li>
<li>Once connection setup, select Input Column for URL ( This will be same column from Script Transform)</li>
<li>Select column for Body (e.g. ZS_CSV_OUT)</li>
<li>Click OK to save</li>
</ol>
<div id="attachment_6335" style="width: 739px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-configure-web-api-destination-post-csv-data-in-batch.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6335" class="size-full wp-image-6335" src="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-configure-web-api-destination-post-csv-data-in-batch.png" alt="POST data to REST API in multiple batches using SSIS Web API destination" width="729" height="764" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-configure-web-api-destination-post-csv-data-in-batch.png 729w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-configure-web-api-destination-post-csv-data-in-batch-286x300.png 286w" sizes="(max-width: 729px) 100vw, 729px" /></a><p id="caption-attachment-6335" class="wp-caption-text">POST data to REST API in multiple batches using SSIS Web API destination</p></div>
<h2>Debug Web API Requests using Fiddler</h2>
<p>Now we ready to run entire flow. Once you execute data flow, observe Input rows before CSV Generator Transform and after. CSV Generator transform must produce less rows before we now grouping multiple rows in a single batch.</p>
<p>Another important aspect to play with API request is to debug it, We recommend you to to look at <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">this article about using Fiddler to debug web requests</a>.</p>
<h2>Download Sample Package</h2>
<p>Here is the <a href="https://zappysys.com/blog/wp-content/uploads/2019/02/RestAPI_Batch.zip">Sample SSIS Package (2012 format) &#8211; Rest API_Batching</a></p>
<h2>Conclusion</h2>
<p>In this post, we saw how easy it is to handle complex REST API  / CSV /JSON / XML operations in SSIS. We configured REST API POST Operation using Batching Method. Hope this post helps you to achieve your API integration without coding.  Feel free to <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">download SSIS PowerPack</a> and try many other components not discussed in this article.</p>
<p>The post <a href="https://zappysys.com/blog/batch-rest-api-requests-ssis-bulk-operation/">How to batch REST API requests in SSIS (Bulk Operation)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Read / Write Shopify data in SSIS (REST API)</title>
		<link>https://zappysys.com/blog/read-write-shopify-data-ssis-rest-api/</link>
		
		<dc:creator><![CDATA[ZappySys Team]]></dc:creator>
		<pubDate>Fri, 18 Jan 2019 18:03:12 +0000</pubDate>
				<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS REST API Task]]></category>
		<category><![CDATA[SSIS WEB API Destination]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[Shopify]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=6116</guid>

					<description><![CDATA[<p>Introduction In our previous article, we saw how to call REST API in SSIS. Now in let&#8217;s use that knowledge and learn how to read/write Shopify data in SSIS. If you are not aware of Shopify then its one of the most popular eCommerce platforms out there for small shops who sell online. Shopify provides [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-write-shopify-data-ssis-rest-api/">Read / Write Shopify data in SSIS (REST API)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-logo.jpg"><img loading="lazy" decoding="async" class="wp-image-6239 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-logo.jpg" alt="" width="169" height="148" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-logo.jpg 388w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-logo-300x263.jpg 300w" sizes="(max-width: 169px) 100vw, 169px" /></a>In our previous article, we saw how to <a href="https://zappysys.com/blog/call-rest-api-using-ssis-web-service-task/" target="_blank" rel="noopener">call REST API in SSIS</a>. Now in let&#8217;s use that knowledge and learn how to read/write Shopify data in SSIS. If you are not aware of <a href="https://www.shopify.com/" target="_blank" rel="noopener">Shopify</a> then its one of the most popular eCommerce platforms out there for small shops who sell online. Shopify provides a total framework to sell/fulfill orders online including tools to build/customize your own web store.</p>
<p>In this article we will see few examples on how to call basic REST API calls to read shopify data, delete shopify data and write shopify data using various SSIS Components.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>Create Shopify Custom App for Shopify Admin API</h2>
<p>Before accessing Shopify API you must create Custom App (and then obtain Access Token)</p>
<h3>New approach (Custom App) to generate App Credentials for Rest API Call</h3>
<p>Before you call Shopify REST API, your first step is to obtain credentials. We will need Access Token or Storefront Access Token. We will use it in later section to call Shopify REST API.</p>
<ol>
<li>First, in Shopify, go to sore Settings (Click Gear Icon) &gt;  <strong>Apps and sales channels</strong> &gt; click <strong><strong><strong>Develop apps for your Store</strong><br />
</strong></strong> OR just navigate to URL<br />
<pre class="crayon-plain-tag">https://{your-store}.myshopify.com/admin/settings/apps/development</pre>
<div id="attachment_9873" style="width: 1043px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_apps_dev.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9873" class="wp-image-9873 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_apps_dev.png" alt="Shopify App and Sales Channel" width="1033" height="519" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_apps_dev.png 1033w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_apps_dev-300x151.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_apps_dev-768x386.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_apps_dev-1024x514.png 1024w" sizes="(max-width: 1033px) 100vw, 1033px" /></a><p id="caption-attachment-9873" class="wp-caption-text">Shopify App and Sales Channel</p></div>
<p><strong> </strong></li>
<li>In <strong>App development</strong>, click on <strong><strong><strong><strong>Create an app<br />
</strong></strong></strong></strong></p>
<div id="attachment_9875" style="width: 986px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_create_app-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9875" class="size-full wp-image-9875" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_create_app-1.png" alt="" width="976" height="461" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_create_app-1.png 976w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_create_app-1-300x142.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_create_app-1-768x363.png 768w" sizes="(max-width: 976px) 100vw, 976px" /></a><p id="caption-attachment-9875" class="wp-caption-text">Shopify Create an App</p></div>
<p><strong><strong> </strong></strong></li>
<li>Provide the appropriate name for your custom app.
<div id="attachment_9876" style="width: 632px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_app_name.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9876" class="wp-image-9876 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_app_name.png" alt="" width="622" height="386" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_app_name.png 622w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_app_name-300x186.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_app_name-436x272.png 436w" sizes="(max-width: 622px) 100vw, 622px" /></a><p id="caption-attachment-9876" class="wp-caption-text">Shopify Custom App Name</p></div>
<p>&nbsp;</li>
<li>Once we created the app name, we have 2 options to create <strong>Admin API</strong> or <strong>Storefront API</strong> in the Overview tab.<a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_app_scope_configuration.png"><img loading="lazy" decoding="async" class="wp-image-9877 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_app_scope_configuration.png" alt="" width="976" height="593" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_app_scope_configuration.png 976w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_app_scope_configuration-300x182.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_app_scope_configuration-768x467.png 768w" sizes="(max-width: 976px) 100vw, 976px" /></a>                                                                               Shopify App Scopes and Configuration</li>
<li>Click on Configure Admin API scopes or Configure Storefront API scopes based on your need as shown in the above screenshot.</li>
<li>If click on Configure Admin API scopes, then select the appropriate scopes for your Admin API.</li>
<li>Also, change orders, transactions, and fulfilments permissions to read and write if you need to create, update and delete products.</li>
<li>In addition, change the products, variants, and collections to read and write if you need to create, update and delete products.
<div id="attachment_9878" style="width: 941px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_admin_api_scope.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9878" class="wp-image-9878 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_admin_api_scope.png" alt="" width="931" height="582" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_admin_api_scope.png 931w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_admin_api_scope-300x188.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_admin_api_scope-768x480.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_admin_api_scope-436x272.png 436w" sizes="(max-width: 931px) 100vw, 931px" /></a><p id="caption-attachment-9878" class="wp-caption-text">Shopify Admin Api Scope</p></div>
<p>&nbsp;</li>
<li>After saving it, it asks to install app and generate Shopify Access Token for your Admin API.
<div id="attachment_9879" style="width: 988px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_admin_install_app.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9879" class="size-full wp-image-9879" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_admin_install_app.png" alt="" width="978" height="845" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_admin_install_app.png 978w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_admin_install_app-300x259.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_admin_install_app-768x664.png 768w" sizes="(max-width: 978px) 100vw, 978px" /></a><p id="caption-attachment-9879" class="wp-caption-text">Shopify Admin Install App</p></div>
<p>&nbsp;</p>
<div id="attachment_9880" style="width: 586px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_admin_api_access_token.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9880" class="size-full wp-image-9880" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_admin_api_access_token.png" alt="" width="576" height="286" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_admin_api_access_token.png 576w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_admin_api_access_token-300x149.png 300w" sizes="(max-width: 576px) 100vw, 576px" /></a><p id="caption-attachment-9880" class="wp-caption-text">Shopify Admin Access Token</p></div></li>
<li>If click at Configure Storefront API scopes, then select the appropriate scopes for your Storefront API.</li>
<li>Also, change orders, transactions, and fulfilments permissions to read and write if you need to create, update and delete products.</li>
<li>In addition, change the products, variants, and collections to read and write if you need to create, update and delete products.
<div id="attachment_9887" style="width: 929px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shpoify-storefront-api-scope.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9887" class="size-full wp-image-9887" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shpoify-storefront-api-scope.png" alt="" width="919" height="786" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shpoify-storefront-api-scope.png 919w, https://zappysys.com/blog/wp-content/uploads/2019/01/shpoify-storefront-api-scope-300x257.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/shpoify-storefront-api-scope-768x657.png 768w" sizes="(max-width: 919px) 100vw, 919px" /></a><p id="caption-attachment-9887" class="wp-caption-text">Shopify Storefront API Scope</p></div>
<p>&nbsp;</li>
<li>After saving it, it asks to install app and generate Shopify Storefront Access Token for your Admin API shown above screenshot.
<div id="attachment_9881" style="width: 948px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_storefront_install_app.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9881" class="size-full wp-image-9881" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_storefront_install_app.png" alt="" width="938" height="479" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_storefront_install_app.png 938w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_storefront_install_app-300x153.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify_storefront_install_app-768x392.png 768w" sizes="(max-width: 938px) 100vw, 938px" /></a><p id="caption-attachment-9881" class="wp-caption-text">Shopify Storefront Install App</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_9882" style="width: 941px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-storefront-access-token.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9882" class="size-full wp-image-9882" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-storefront-access-token.png" alt="" width="931" height="533" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-storefront-access-token.png 931w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-storefront-access-token-300x172.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-storefront-access-token-768x440.png 768w" sizes="(max-width: 931px) 100vw, 931px" /></a><p id="caption-attachment-9882" class="wp-caption-text">Shopify Storefront Access Token</p></div>
<p>&nbsp;</li>
<li> We have created Admin API Access Token and Storefront API Access Token to access the Shopify APIs.
<div id="attachment_9885" style="width: 908px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-api-credentials.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9885" class="size-full wp-image-9885" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-api-credentials.png" alt="" width="898" height="832" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-api-credentials.png 898w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-api-credentials-300x278.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-api-credentials-768x712.png 768w" sizes="(max-width: 898px) 100vw, 898px" /></a><p id="caption-attachment-9885" class="wp-caption-text">Shopify API Credentials</p></div></li>
</ol>
<h3>Old approach (Private App) to generate App Credentials for Rest API Call</h3>
<p>Before you call Shopify REST API, your first step is to obtain credentials. We will need API Key and Password. We will use it in later section to call shopify REST API.</p>
<ol>
<li>First, in Shopify, go to<strong> Apps</strong> and click <strong>Manage private apps</strong>.
<div id="attachment_6122" style="width: 798px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-create-private-app-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6122" class="wp-image-6122 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-create-private-app-1.png" alt="Manager private apps in Shopify" width="788" height="322" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-create-private-app-1.png 788w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-create-private-app-1-300x123.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-create-private-app-1-768x314.png 768w" sizes="(max-width: 788px) 100vw, 788px" /></a><p id="caption-attachment-6122" class="wp-caption-text">Shopify App &#8211; Manager private apps</p></div></li>
<li> Secondly, In Private apps, click the <strong><strong><strong>Create a new private app:</strong></strong></strong>
<div id="attachment_6123" style="width: 790px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-create-private-app-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6123" class="wp-image-6123 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-create-private-app-2.png" alt="Create a new Shopify private app" width="780" height="498" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-create-private-app-2.png 780w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-create-private-app-2-300x192.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-create-private-app-2-768x490.png 768w" sizes="(max-width: 780px) 100vw, 780px" /></a><p id="caption-attachment-6123" class="wp-caption-text">Shopify Private apps</p></div></li>
<li>Also, change orders, transactions, and fulfilments permissions to read and write if you need to create, update and delete products.</li>
<li>In addition, change the products, variants, and collections to read and write if you need to create, update and delete products.
<div id="attachment_6121" style="width: 946px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-private-oauth-app-edit-permissions.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6121" class="wp-image-6121 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-private-oauth-app-edit-permissions.png" alt="Also change to read and write permissions" width="936" height="818" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-private-oauth-app-edit-permissions.png 936w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-private-oauth-app-edit-permissions-300x262.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-private-oauth-app-edit-permissions-768x671.png 768w" sizes="(max-width: 936px) 100vw, 936px" /></a><p id="caption-attachment-6121" class="wp-caption-text">Permission for private apps.</p></div></li>
<li>Finally, you will have an API key, a password, an URL and a shared  secret that you will use in the next section:</li>
</ol>
<div id="attachment_6120" style="width: 628px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-view-oauth-app-api-key-secret-credentials.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6120" class="wp-image-6120 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-view-oauth-app-api-key-secret-credentials.png" alt="Shopify password" width="618" height="830" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-view-oauth-app-api-key-secret-credentials.png 618w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-view-oauth-app-api-key-secret-credentials-223x300.png 223w" sizes="(max-width: 618px) 100vw, 618px" /></a><p id="caption-attachment-6120" class="wp-caption-text">Shopify API key</p></div>
<p>&nbsp;</p>
<h2>Read Shopify data in SSIS (Get Orders Example)</h2>
<p>So in this section we will learn how to call Shopify REST API.  For example purpose we will call <a href="https://help.shopify.com/en/api/reference/orders/order" target="_blank" rel="noopener">Shopify Orders Endpoint</a>. For all other REST API endpoints <a href="https://help.shopify.com/en/api/reference" target="_blank" rel="noopener">check this link</a>. Read carefully which parameters you can pass for each API call. So let&#8217;s read shopify orders using sample API call.</p>
<h3>Configure SSIS JSON Source to read from Shopify</h3>
<p>Now, that we created an App in Shopify, the rest is easy.</p>
<ol>
<li>First, in an SSIS project, drag and drop the Data Flow and double click it.
<div style="width: 470px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/drag-and-drop-data-flow-task.png" alt="Drag the Data flow task" width="460" height="155" /><p class="wp-caption-text">Use the Data Flow</p></div></li>
<li>Secondly, in the Data Flow, drag and drop the ZS JSON Source.
<div style="width: 551px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="figureimage" title="SSIS JSON Source - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/json-source/ssis-json-source-adapter-drag.png" alt="SSIS JSON Source - Drag and Drop" width="541" height="144" /><p class="wp-caption-text">SSIS JSON Source &#8211; Drag and Drop</p></div></li>
<li>Double-click on JSON Source to configure it.If you are not familiar with ZS JSON Source, check <a href="https://www.youtube.com/watch?time_continue=4&amp;v=t4fSghbSZLo">this link.</a><br />
<strong>New approach to establish the HTTP Connection Manager</strong></p>
<p><strong>Using Admin API Access token</strong></p>
<ol>
<li>Enter URL for the API you like to call. For Example, you can enter<br />
<pre class="crayon-plain-tag">https://{your-store}.myshopify.com/admin/api/2022-10/products.json</pre>
</li>
<li>Check Use Credentials and click on NEW-HTTP connection as shown below,</li>
<li>On HTTP Connection Manager you can enter some URL (it will be ignored and use JSON Source URL above)</li>
<li>Choose Credentials Type as <strong>Static Token / API Key</strong></li>
<li>In the Token / Key text box enter your <strong>Admin API Key</strong> (obtained from the previous section)</li>
<li>In the Auth Header Name enter <pre class="crayon-plain-tag">X-Shopify-Access-Token</pre></li>
<li>In the <strong>Auth Scheme</strong> select <strong><strong>{none}</strong></strong>&nbsp;
<div id="attachment_9889" style="width: 841px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-admin-access-token-http-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9889" class="size-full wp-image-9889" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-admin-access-token-http-connection.png" alt="" width="831" height="692" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-admin-access-token-http-connection.png 831w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-admin-access-token-http-connection-300x250.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-admin-access-token-http-connection-768x640.png 768w" sizes="(max-width: 831px) 100vw, 831px" /></a><p id="caption-attachment-9889" class="wp-caption-text">SSIS JSON Source Admin API HTTP Connection Manager</p></div>
<p><strong>  </strong></li>
</ol>
</li>
<li>Also, press the <strong>Select Filter</strong> button and press the orders node:
<div id="attachment_6127" style="width: 592px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-select-filter.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6127" class="wp-image-6127 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-select-filter.png" alt="filter in ssis to get shopify data" width="582" height="288" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-select-filter.png 582w, https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-select-filter-300x148.png 300w" sizes="(max-width: 582px) 100vw, 582px" /></a><p id="caption-attachment-6127" class="wp-caption-text">SSIS Shopify filter</p></div></li>
<li>Now go to Pagination Tab and select <strong>RFC5988 Pagination mode</strong> as below. <a href="https://help.shopify.com/en/api/guides/paginated-rest-results" target="_blank" rel="noopener">Check this link for more info on Shopify Paginated API calls</a>.
<div id="attachment_3917" style="width: 690px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/ssis-link-header-pagination-rfc5988-options.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3917" class="size-full wp-image-3917" src="https://zappysys.com/blog/wp-content/uploads/2016/04/ssis-link-header-pagination-rfc5988-options.png" alt="Link Header Pagination Method (RFC 5988)" width="680" height="106" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/ssis-link-header-pagination-rfc5988-options.png 680w, https://zappysys.com/blog/wp-content/uploads/2016/04/ssis-link-header-pagination-rfc5988-options-300x47.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></a><p id="caption-attachment-3917" class="wp-caption-text">Link Header Pagination Method (RFC 5988)</p></div>
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff8b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">NOTE:  For Older API use Cursor-based pagination as below (version 2019-07 or older). </div></div>
<div id="attachment_6126" style="width: 680px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-rest-api-pagination.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6126" class="wp-image-6126 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-rest-api-pagination.png" alt="SSIS JSON API pagination" width="670" height="629" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-rest-api-pagination.png 670w, https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-rest-api-pagination-300x282.png 300w" sizes="(max-width: 670px) 100vw, 670px" /></a><p id="caption-attachment-6126" class="wp-caption-text">SSIS pagination for Shopify</p></div></li>
<li>Finally, make sure to the Use Credentials option and select the http connection of the step 2 and press the Preview button to see the data:</li>
</ol>
<div id="attachment_6125" style="width: 926px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-read-rest-api-orders-example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6125" class="wp-image-6125 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-read-rest-api-orders-example.png" alt="Get Shopify data in SSIS" width="916" height="719" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-read-rest-api-orders-example.png 916w, https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-read-rest-api-orders-example-300x235.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-read-rest-api-orders-example-768x603.png 768w" sizes="(max-width: 916px) 100vw, 916px" /></a><p id="caption-attachment-6125" class="wp-caption-text">SSIS preview Shopify data</p></div>
<p>&nbsp;</p>
<h3>Load Shopify data into SQL Server / Other Target</h3>
<div class="content_block" id="custom_post_widget-5617"><p>ZappySys SSIS PowerPack makes it easy to load data from various sources such as REST, SOAP, JSON, XML, CSV or from other source into SQL Server, or PostgreSQL, or Amazon Redshift, or other  targets. The <strong>Upsert Destination</strong> component allows you to automatically insert new records and update existing ones based on key columns. Below are the detailed steps to configure it.</p>
<h3>Step 1: Add Upsert Destination to Data Flow</h3>
<ol>
<li>Drag and drop the <strong>Upsert Destination</strong> component from the SSIS Toolbox.</li>
<li>Connect your source component (e.g., JSON / REST / Other Source) to the Upsert Destination.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png" /></a>
<p class="wp-caption-text">SSIS - Data Flow - Drang and Drop Upsert Destination Component</p>
</div>
<h3>Step 2: Configure Target Connection</h3>
<ol>
<li>Double-click the <strong>Upsert Destination</strong> component to open the configuration window.</li>
<li>Under <strong>Connection</strong>, select an existing target connection or click <strong>NEW</strong> to create a new connection.
<ul>
<li>Example: SQL Server, or PostgreSQL, or Amazon Redshift.</li>
</ul>
</li>
</ol>
<h3>Step 3: Select or Create Target Table</h3>
<ol>
<li>In the <strong>Target Table</strong> dropdown, select the table where you want to load data.</li>
<li>Optionally, click <strong>NEW</strong> to create a new table based on the source columns.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png" /></a>
<p class="wp-caption-text">Configure SSIS Upsert Destination Connection - Loading data (REST / SOAP / JSON / XML /CSV) into SQL Server or other target using SSIS</p>
</div>
<h3>Step 4: Map Columns</h3>
<ol>
<li>Go to the <strong>Mappings</strong> tab.</li>
<li>Click <strong>Auto Map</strong> to map source columns to target columns by name.</li>
<li>Ensure you <strong>check the Primary key column(s)</strong> that will determine whether a record is inserted or updated.</li>
<li>You can manually adjust the mappings if necessary.</li>
</ol>
 <div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination - Columns Mappings</p>
</div>
<h3>Step 5: Save Settings</h3>
<ul>
<li>Click <strong>OK</strong> to save the Upsert Destination configuration.</li>
</ul>
<h3>Step 6: Optional: Add Logging or Analysis</h3>
<ul>
<li>You may add extra destination components to log the number of inserted vs. updated records for monitoring or auditing purposes.</li>
</ul>
<h3>Step 7: Execute the Package</h3>
<ul>
<li>Run your SSIS package and verify that the data is correctly inserted and updated in the target table.</li>
</ul>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination Execution</p>
</div></div>
<h2>Write Shopify data in SSIS REST API Task</h2>
<p>In this new example, we will write Shopify data in SSIS. In addition, we will create a new order using REST API to write Shopify data in SSIS.</p>
<ol>
<li>First, use the <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/">REST API task</a> in SSDT.</li>
<li>Secondly, in the REST API use the http connection created on step 2 of the read Shopify data in SSIS.  Also, in HTTP Request Method, select <strong>POST</strong>, in Body (Request Data) write the following:<br />
<pre class="crayon-plain-tag">{
  "order": {
    "line_items": [
      {
        "title": "Big Brown Bear Boots",
        "price": 74.99,
        "grams": "1300",
        "quantity": 3,
        "tax_lines": [
          {
            "price": 13.5,
            "rate": 0.06,
            "title": "State tax"
          }
        ]
      }
    ],
    "transactions": [
      {
        "kind": "sale",
        "status": "success",
        "amount": 238.47
      }
    ],
    "total_tax": 13.5,
    "currency": "EUR"
  }
}</pre>
<div id="attachment_6217" style="width: 810px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-post.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6217" class="size-full wp-image-6217" src="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-post.png" alt="write shopify data in ssis" width="800" height="654" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-post.png 800w, https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-post-300x245.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-post-768x628.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></a><p id="caption-attachment-6217" class="wp-caption-text">Post JSON order Shopify</p></div>
<p>&nbsp;</li>
<li>If you dont like to use URL supplied in HTTP Connection manager then just check override URL option and enter URL like below. For this example we used correct URL in HTTP connection manager so we will not override URL.<br />
<pre class="crayon-plain-tag">https://{{your-store}}.myshopify.com/admin/orders.json</pre></li>
<li>Now you can click on Test Request / Response and you will see one sample order created in your admin portal.</li>
<li>You can supply variables in Body by clicking on Insert Variable dropdown when you edit Body.</li>
</ol>
<h2>Calling Storefront API</h2>
<p>In our previous section, we saw how to call ADMIN API which is the most common API you will use in most cases to read / write store data. However if you have a need to call <a href="https://shopify.dev/api/storefront" target="_blank" rel="noopener">Storefront API</a>  instead then configure HTTP Connection as below</p>
<ol>
<li>For Store Front API call you can follow the same steps as the previous section except for few things on HTTP Connection Manager UI</li>
<li>In API Key enter <strong>Storefront API Access Token</strong> (rather than Admin Token)</li>
<li>In the Auth Header Name enter <pre class="crayon-plain-tag">X-Shopify-Storefront-Access-Token</pre>
<div id="attachment_9890" style="width: 1081px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-storefront-access-token-http-connection-manager.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9890" class="size-full wp-image-9890" src="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-storefront-access-token-http-connection-manager.png" alt="" width="1071" height="661" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-storefront-access-token-http-connection-manager.png 1071w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-storefront-access-token-http-connection-manager-300x185.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-storefront-access-token-http-connection-manager-768x474.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/01/shopify-storefront-access-token-http-connection-manager-1024x632.png 1024w" sizes="(max-width: 1071px) 100vw, 1071px" /></a><p id="caption-attachment-9890" class="wp-caption-text">SSIS JSON Source Storefront HTTP Connection Manager</p></div></li>
</ol>
<h2>Legacy Approach &#8211; Using Basic Auth</h2>
<p>If you created Shopify PrivateApp (before they introduced the new CustomApp approach) then your HTTP Connection needs to be like below. Use Basic Auth for Credentials Type</p>
<ol>
<li><strong><strong>Using approaches to establish the HTTP Connection Manager</strong></strong>&nbsp;
<div id="attachment_6124" style="width: 791px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-api-connection-basic-authentication.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6124" class="wp-image-6124 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-api-connection-basic-authentication.png" alt="ssis shopify connection" width="781" height="588" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-api-connection-basic-authentication.png 781w, https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-api-connection-basic-authentication-300x226.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-api-connection-basic-authentication-768x578.png 768w" sizes="(max-width: 781px) 100vw, 781px" /></a><p id="caption-attachment-6124" class="wp-caption-text">SSIS JSON Source HTTP connection</p></div></li>
</ol>
<h2>Create Multiple Shopify records using Web API Destination</h2>
<p>With our ZS Web API destination, it is possible to create multiple records at the same time.  The following link shows the ZS Web API Destination information:</p>
<ul>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/">SSIS Web API destination</a></li>
</ul>
<p>Here are few useful articles to explain Web API destination use case.</p>
<p><a href="https://zappysys.com/blog/http-post-in-ssis-send-data-to-web-api-url-json-xml/" target="_blank" rel="noopener">How to POST data to URL</a></p>
<p><a href="https://zappysys.com/blog/category/ssis/components/ssis-web-api-destination/" target="_blank" rel="noopener">Few other articles</a></p>
<h2>Delete Shopify records using REST API in SSIS</h2>
<ol>
<li>First, in SSDT, drag and drop the ZS REST API task.</li>
<li>Secondly, add the HTTP Url Connection.  Use the <strong>DELETE </strong>HTTP Request Method and the URL including the order id as below:<br />
<pre class="crayon-plain-tag">https://{{your-store}}.myshopify.com/admin/orders/{{orderid}}</pre>
<div id="attachment_6222" style="width: 810px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-delete.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6222" class="size-full wp-image-6222" src="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-delete.png" alt="Shopify API in SSIS" width="800" height="654" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-delete.png 800w, https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-delete-300x245.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-shopify-delete-768x628.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></a><p id="caption-attachment-6222" class="wp-caption-text">SSIS delete data in Shopify using REST API call</p></div>
<p>&nbsp;</li>
<li>Now click Test Request / Response to test delete API call.</li>
</ol>
<h2>Conclusion</h2>
<p>In this article, we learned how to create a Shopify app. In addition, we learned how to connect to Shopify using SSIS with the ZappySys tools. Also, we learned to use ZappySys tools in SSIS to get, write and delete information.</p>
<h2>References</h2>
<p>Finally, for more information, refer to these links:</p>
<ul>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/">ZappySys SSIS JSON Source</a></li>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/">ZappySys SSIS REST API task</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/read-write-shopify-data-ssis-rest-api/">Read / Write Shopify data in SSIS (REST API)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SSIS Magento data Read / Write using REST API Call</title>
		<link>https://zappysys.com/blog/ssis-magento-data-read-write-using-rest-api-call/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Thu, 01 Nov 2018 16:43:04 +0000</pubDate>
				<category><![CDATA[HTTP Connection]]></category>
		<category><![CDATA[REST API]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS Connection Manager]]></category>
		<category><![CDATA[SSIS CSV Source]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS REST API Task]]></category>
		<category><![CDATA[SSIS Template Transform]]></category>
		<category><![CDATA[SSIS WEB API Destination]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=5267</guid>

					<description><![CDATA[<p>Introduction In this post we will lean SSIS Magento data read / write operations. Magento is a very popular eCommerce platform and they offer JSON based REST API and XML based SOAP API. You can use either API based on your need to automate common integration needs. We recommend using REST API (JSON API) if possible [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-magento-data-read-write-using-rest-api-call/">SSIS Magento data Read / Write using REST API Call</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/magento-logo.png"><img loading="lazy" decoding="async" class="wp-image-6392 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/11/magento-logo.png" alt="" width="124" height="112" /></a>In this post we will lean SSIS Magento data read / write operations. Magento is a very popular eCommerce platform and they offer <strong>JSON based REST API</strong> and <strong>XML based SOAP API</strong>. You can use either API based on your need to automate common integration needs.</p>
<p>We recommend using REST API (JSON API) if possible because they are simpler and faster. We will focus only on JSON API in this article but we do have blog post on <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/" target="_blank" rel="noopener">how to call SOAP API</a>.</p>
<p>&nbsp;</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>About Calling Magento REST API</h2>
<p>If you are new to Magento API we highly recommend to get familiar with <a href="https://devdocs.magento.com/guides/v2.3/rest/tutorials/index.html" target="_blank" rel="noopener">Magento REST API here</a>. Magento REST API  offers two ways to authenticate.</p>
<ol>
<li><a href="https://devdocs.magento.com/guides/v2.1/get-started/authentication/gs-authentication-token.html" target="_blank" rel="noopener">Token based Authentication</a></li>
<li><a href="https://devdocs.magento.com/guides/v2.1/get-started/authentication/gs-authentication-oauth.html" target="_blank" rel="noopener">OAuth Based Authentication (OAuth 1.0a)</a></li>
</ol>
<p>In this article we will look at only Token based approach. In token based approach we have to get new token using admin / customer account information.</p>
<p>We will cover later how to access admin or customer level API later in this article (See HTTP connection configuration).</p>
<h2>Configure Connection / Call Magento REST API in SSIS</h2>
<p>Now lets look at very simple example how to use Token based method to call Magento REST API in SSIS. We will first configure HTTP connection and then call REST API.</p>
<p>Let&#8217;s get started.</p>
<ol>
<li>First, open SSIS Package after installing <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a></li>
<li>Drag <a href="https://zappysys.com/blog/category/ssis/tasks/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">ZS REST API Task</a> from SSIS Toolbox on Control Flow Designer. Let&#8217;s rename task to <strong>Get Magento Categories</strong></li>
<li>Enter REST API URL you like to call. For example we can use below URL. Replace **<strong>your-magento-host**</strong> with your own name.<br />
<pre class="crayon-plain-tag">http://**your-magento-host**/index.php/rest/V1/categories</pre>
</li>
<li>Select <strong>Url from Connection</strong> mode</li>
<li>From Connection Dropdown select <strong>new ZS-HTTP</strong> connection
<div id="attachment_5269" style="width: 477px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-connection-rest-api-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5269" class="size-full wp-image-5269" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-connection-rest-api-task.png" alt="Create new connection for SSIS REST API Task" width="467" height="267" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-connection-rest-api-task.png 467w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-connection-rest-api-task-300x172.png 300w" sizes="(max-width: 467px) 100vw, 467px" /></a><p id="caption-attachment-5269" class="wp-caption-text">Create new connection for SSIS REST API Task</p></div></li>
<li>Configure General Tab of HTTP Connection like below<br />
URL can be anything for now because we will use override option in next step (On REST API Task).</li>
<li>Select Credentials Type as <a href="https://zappysys.com/blog/call-soap-rest-api-using-dynamic-token-ssis/">Dynamic Token</a>.</li>
<li>Enter Userid / password
<div id="attachment_5268" style="width: 730px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-rest-api-call-token-method.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5268" class="size-full wp-image-5268" src="https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-rest-api-call-token-method.png" alt="Configure Magento REST API Connect for Token based Authentication" width="720" height="483" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-rest-api-call-token-method.png 720w, https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-rest-api-call-token-method-300x201.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-rest-api-call-token-method-272x182.png 272w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-5268" class="wp-caption-text">Configure Magento REST API Connect for Token based Authentication</p></div></li>
<li>Now goto Dynamic Token Tab (Or click <strong>Configure</strong> Link) and configure like below.</li>
<li>Enter Token URL for API Login URL field.<br />
<strong>NOTE</strong>: If you are a customer and want to access your own account (e.g. view your orders) then replace <strong>/admin</strong> with <strong>/customer</strong>  in URL)<br />
Replace <strong>**my-host**</strong> with your host name.<br />
<pre class="crayon-plain-tag">http://***my-host***/index.php/rest/V1/integration/admin/token</pre>
</li>
<li>Change Method to POST.</li>
<li>Enter Body as below (Placeholders are automatically replaced when /token endpoint is called.<br />
<pre class="crayon-plain-tag">{&quot;username&quot;:&quot;[$userid$]&quot;, &quot;password&quot;:&quot;[$password$]&quot;}</pre>
</li>
<li>Select Content Type as Application/Json
<div id="attachment_5270" style="width: 849px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-dynamic-token-extract.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5270" class="size-full wp-image-5270" src="https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-dynamic-token-extract.png" alt="Configure Magento Token Request" width="839" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-dynamic-token-extract.png 839w, https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-dynamic-token-extract-300x216.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-dynamic-token-extract-768x552.png 768w" sizes="(max-width: 839px) 100vw, 839px" /></a><p id="caption-attachment-5270" class="wp-caption-text">Configure Magento Token Request</p></div></li>
<li>Now click Dynamic Token &#8211; Response Tab and configure like below.<br />
Select <strong>Regex</strong> and enter Expression as below. This will remove double quotes around token in response.<br />
<pre class="crayon-plain-tag">&quot;(.*)&quot;{{0,1}}</pre>
<div id="attachment_5272" style="width: 541px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/regex-remove-double-quotes-around-value.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5272" class="size-full wp-image-5272" src="https://zappysys.com/blog/wp-content/uploads/2018/11/regex-remove-double-quotes-around-value.png" alt="Extract Token from response - Remove double quotes around value using Regular Expression" width="531" height="385" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/regex-remove-double-quotes-around-value.png 531w, https://zappysys.com/blog/wp-content/uploads/2018/11/regex-remove-double-quotes-around-value-300x218.png 300w" sizes="(max-width: 531px) 100vw, 531px" /></a><p id="caption-attachment-5272" class="wp-caption-text">Extract Token from response &#8211; Remove double quotes around value using Regular Expression</p></div></li>
<li>Click OK to save connection</li>
<li>Now on REST API Task check <strong>Use Direct URL</strong> Option</li>
<li>Click Test Request to confirm its working
<div id="attachment_5273" style="width: 752px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-call-magento-rest-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5273" class="size-full wp-image-5273" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-call-magento-rest-api.png" alt="Call Magento REST API using SSIS REST API Task" width="742" height="701" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-call-magento-rest-api.png 742w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-call-magento-rest-api-300x283.png 300w" sizes="(max-width: 742px) 100vw, 742px" /></a><p id="caption-attachment-5273" class="wp-caption-text">Call Magento REST API using SSIS REST API Task</p></div></li>
</ol>
<p>&nbsp;</p>
<h2>Read data from Magento and Load into SQL Server</h2>
<p>Now lets look at how to read Magento data and load into SQL Server. Assume that you like to read all products.</p>
<h3>Configure JSON Source (Read Magento REST API)</h3>
<ol>
<li>Drag Data flow and double click to edit:
<div id="attachment_8028" style="width: 470px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8028" class="size-full wp-image-8028" src="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png" alt="" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /><p id="caption-attachment-8028" class="wp-caption-text">Dragging and dropping Data Flow Task into Control Flow</p></div></li>
<li>Drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">ZS JSON Source</a> on data flow and double click to edit</li>
<li>Configure JSON Source like below if you like to get product list for example
<ol>
<li>Enter URL as below (change http to https if your host support secure channel).<br />
<pre class="crayon-plain-tag">http://***yourhost***/index.php/rest/V1/products?searchCriteria[pageSize]=1000
--- to extract only specific fields do below way --
http://***yourhost***/index.php/rest/V1/products?searchCriteria[pageSize]=1000&amp;fields=items[sku,name]</pre>
</li>
<li>Check Use Credentials. Use same HTTP connection we created in previous section</li>
<li>In the Filter enter <strong>$.items[*]</strong> or click Select Filter to Browse and select items node.</li>
<li>Click Preview to confirm</li>
</ol>
</li>
<li>Here is how your setup will look like after configuration.
<div id="attachment_6525" style="width: 871px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-read-data-rest-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6525" class="size-full wp-image-6525" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-read-data-rest-api.png" alt="SSIS JSON Source Configuration - Read data from Magento REST API" width="861" height="517" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-read-data-rest-api.png 861w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-read-data-rest-api-300x180.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-read-data-rest-api-768x461.png 768w" sizes="(max-width: 861px) 100vw, 861px" /></a><p id="caption-attachment-6525" class="wp-caption-text">SSIS JSON Source Configuration &#8211; Read data from Magento REST API</p></div></li>
<li>If you expecting more than 1000 rows then you have to set up pagination. Now go to <strong>pagination tab</strong> and configure as below (Below options are only available <a href="https://zappysys.com/blog/ssis-powerpack-v2-9-1/" target="_blank" rel="noopener">in v2.9.1 or higher</a>). If you have older version then check next section for workaround.
<ol>
<li>Pagination Mode =<strong>URL Parameter Mode</strong></li>
<li>Page Num Indicator = <strong>searchCriteria[currentPage]</strong></li>
<li>Max Rows Expression = <strong>$.total_count</strong></li>
<li>Page Data Expression = <strong>$.items[*]</strong></li>
</ol>
</li>
<li>Here is how your Magento REST API Pagination Setup will look like.
<div id="attachment_6526" style="width: 578px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/rest-api-pagination-by-max-row-count.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6526" class="size-full wp-image-6526" src="https://zappysys.com/blog/wp-content/uploads/2018/11/rest-api-pagination-by-max-row-count.png" alt="REST API Pagination using Max Row count Mode" width="568" height="376" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/rest-api-pagination-by-max-row-count.png 568w, https://zappysys.com/blog/wp-content/uploads/2018/11/rest-api-pagination-by-max-row-count-300x199.png 300w" sizes="(max-width: 568px) 100vw, 568px" /></a><p id="caption-attachment-6526" class="wp-caption-text">REST API Pagination using Max Row count Mode</p></div></li>
<li>Click OK to save JSON Source. In next section we will see how to load data into Target like SQL Server.</li>
</ol>
<h3>Configure OLEDB Destination (Load into SQL Server)</h3>
<ol>
<li>Drag OLEDB Destination.</li>
<li>Select / Create Connection</li>
<li>Select or create NEW target Table (Click NEW button)</li>
<li>Click Mapping Tab to map source columns to target table</li>
<li>Click OK to save</li>
<li>Execute Package</li>
</ol>
<div class="content_block" id="custom_post_widget-5617"><p>ZappySys SSIS PowerPack makes it easy to load data from various sources such as REST, SOAP, JSON, XML, CSV or from other source into SQL Server, or PostgreSQL, or Amazon Redshift, or other  targets. The <strong>Upsert Destination</strong> component allows you to automatically insert new records and update existing ones based on key columns. Below are the detailed steps to configure it.</p>
<h3>Step 1: Add Upsert Destination to Data Flow</h3>
<ol>
<li>Drag and drop the <strong>Upsert Destination</strong> component from the SSIS Toolbox.</li>
<li>Connect your source component (e.g., JSON / REST / Other Source) to the Upsert Destination.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png" /></a>
<p class="wp-caption-text">SSIS - Data Flow - Drang and Drop Upsert Destination Component</p>
</div>
<h3>Step 2: Configure Target Connection</h3>
<ol>
<li>Double-click the <strong>Upsert Destination</strong> component to open the configuration window.</li>
<li>Under <strong>Connection</strong>, select an existing target connection or click <strong>NEW</strong> to create a new connection.
<ul>
<li>Example: SQL Server, or PostgreSQL, or Amazon Redshift.</li>
</ul>
</li>
</ol>
<h3>Step 3: Select or Create Target Table</h3>
<ol>
<li>In the <strong>Target Table</strong> dropdown, select the table where you want to load data.</li>
<li>Optionally, click <strong>NEW</strong> to create a new table based on the source columns.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png" /></a>
<p class="wp-caption-text">Configure SSIS Upsert Destination Connection - Loading data (REST / SOAP / JSON / XML /CSV) into SQL Server or other target using SSIS</p>
</div>
<h3>Step 4: Map Columns</h3>
<ol>
<li>Go to the <strong>Mappings</strong> tab.</li>
<li>Click <strong>Auto Map</strong> to map source columns to target columns by name.</li>
<li>Ensure you <strong>check the Primary key column(s)</strong> that will determine whether a record is inserted or updated.</li>
<li>You can manually adjust the mappings if necessary.</li>
</ol>
 <div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination - Columns Mappings</p>
</div>
<h3>Step 5: Save Settings</h3>
<ul>
<li>Click <strong>OK</strong> to save the Upsert Destination configuration.</li>
</ul>
<h3>Step 6: Optional: Add Logging or Analysis</h3>
<ul>
<li>You may add extra destination components to log the number of inserted vs. updated records for monitoring or auditing purposes.</li>
</ul>
<h3>Step 7: Execute the Package</h3>
<ul>
<li>Run your SSIS package and verify that the data is correctly inserted and updated in the target table.</li>
</ul>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination Execution</p>
</div></div>
<h2>Configure Magento Pagination (For Old Version)</h2>
<p>In previous section we configured pagination using newer version (v2.9.1 or higher). But what if you have older version and you dont see that feature. Use below steps for workaround.</p>
<p>Now let&#8217;s look at another common scenario when you real lots of data. Let&#8217;s say you have 5000 products but API call we saw earlier returns max 1000 rows. In that case we have to keep reading next page until all rows are returned. ZappySys provides many settings to configure various REST APIs out there, unfortunately there is no standard around pagination methods. Since Magento API has <a href="https://github.com/magento/magento2/issues/8099" target="_blank" rel="noopener">some bug in API pagination</a> we have to do following hack. Magento keep sending same data of last page if you try to access page which doesn&#8217;t exists. Here is how to overcome that bug.</p>
<h3>Configure REST API task to get total row count</h3>
<p>First step to configure magento pagination is get total rows returned in our request which you like to paginate (in our case <strong>/products</strong>).</p>
<ol>
<li>Go to Control Flow designer</li>
<li>Drag <a href="https://zappysys.com/blog/category/ssis/tasks/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">ZS REST API Task</a> from SSIS Toolbox</li>
<li>Let&#8217;s rename task to <strong>Get Magento Product Count</strong></li>
<li>Double click it and configure like below (Change HTTP to HTTPS if needed)<br />
<pre class="crayon-plain-tag">http://***yourhost***/index.php/rest/V1/products?searchCriteria[pageSize]=10</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-get-magento-result-count-for-pagination.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-6387" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-get-magento-result-count-for-pagination.png" alt="" width="734" height="497" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-get-magento-result-count-for-pagination.png 734w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-get-magento-result-count-for-pagination-300x203.png 300w" sizes="(max-width: 734px) 100vw, 734px" /></a></li>
<li>Go to Response Tab and configure like below. Enter expression as $.total_count<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-rest-api-task-save-variable.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-6388" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-rest-api-task-save-variable.png" alt="" width="672" height="297" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-rest-api-task-save-variable.png 672w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-rest-api-task-save-variable-300x133.png 300w" sizes="(max-width: 672px) 100vw, 672px" /></a></li>
<li>Click OK to save</li>
</ol>
<p>&nbsp;</p>
<h3>Define Expression for JSON Source &#8211; MaxRows Property</h3>
<p>Now next step is to define expression on MaxRows property of JSON Rows so we stop once all rows consumed from Paginated response. If you don&#8217;t do this it will keep paginating forever 🙁</p>
<ol>
<li>On Control Flow designer <strong>select Data Flow</strong> which contains JSON Source for Magento</li>
<li>Right click and go to Properties of that data flow</li>
<li>Find Expression and click Button to add new expression</li>
<li>On Expression dialogbox select [Your JSON Source].[MaxRows] and for expression enter variable name which holds total count (e.g. <strong>@[User::MaxRows]</strong> )<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-dataflow-expression-json-source-maxrows.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-6391" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-dataflow-expression-json-source-maxrows.png" alt="" width="666" height="328" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-dataflow-expression-json-source-maxrows.png 666w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-dataflow-expression-json-source-maxrows-300x148.png 300w" sizes="(max-width: 666px) 100vw, 666px" /></a></li>
<li>Click OK to Save</li>
</ol>
<h3>Configure JSON Source for Magento Pagination</h3>
<p>Now last thing we have to do is go to JSON Source and configure few things for pagination.</p>
<ol>
<li>Go to data flow and double click JSON Source</li>
<li>Click on <strong>Pagination tab</strong> and select Pagination by <strong>URL Parameter Mode</strong></li>
<li>Enter Page name as below<br />
<pre class="crayon-plain-tag">searchCriteria[currentPage]</pre>
</li>
<li>Click OK to save UI</li>
<li>Now <strong>run entire page to test</strong> (NOTE: Do not execute just data flow because if you do that way, it will not extract total row count)<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-read-magento-data-rest-api-pagination.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-6394" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-read-magento-data-rest-api-pagination.png" alt="" width="784" height="548" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-read-magento-data-rest-api-pagination.png 784w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-read-magento-data-rest-api-pagination-300x210.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-read-magento-data-rest-api-pagination-768x537.png 768w" sizes="(max-width: 784px) 100vw, 784px" /></a></li>
</ol>
<h2>Write data to Magento using SSIS Web API destination</h2>
<p>Now let&#8217;s look at example to load data into Magento. In below example we will create few sample products.</p>
<ol>
<li>Create new data flow and go to data flow designer</li>
<li>Drag and drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-file-source-flat-file-web-api/" target="_blank" rel="noopener">ZS CSV Source</a> from SSIS toolbox. You can use any Data source but for simple demo we will use it.</li>
<li>Double click CSV source and select Direct Value mode from dropdown. Enter following sample data (Lets create 12 sample products.)<br />
<pre class="crayon-plain-tag">SKU,ProductName
PROD-1,Product 1
PROD-2,Product 2
PROD-3,Product 3
PROD-4,Product 4
PROD-5,Product 5
PROD-6,Product 6
PROD-7,Product 7
PROD-8,Product 8
PROD-9,Product 9
PROD-10,Product 10
PROD-11,Product 11
PROD-12,Product 12</pre>
</li>
<li>Now click OK to save UI</li>
<li>Now drag <strong>ZS Template Transform</strong> from toolbox.</li>
<li>Connect CSV Source to Template Transform</li>
<li>Enter following sample text to build request for new product. Refer to <a href="https://devdocs.magento.com/guides/v2.3/rest/tutorials/configurable-product/create-simple-products.html">Magento API help file / tutorial</a> to learn more.<br />
<pre class="crayon-plain-tag">{
  "product": {
    "sku": "&lt;%SKU%&gt;",
    "name": "&lt;%ProductName%&gt;",
    "attribute_set_id": 4,
    "price": 25,
    "status": 1,
    "visibility": 1
   }
}</pre>
</li>
<li>Notice that when you click <strong>Insert Variable</strong> &gt; <strong>Columns</strong> &gt; select desired upstream column placeholder. You can also encode special characters in your data (e.g. new lines) using function like &lt;%MyColumn,JSONENCODE%&gt;<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-create-new-product-api-request-template-transform.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-6389" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-create-new-product-api-request-template-transform.png" alt="" width="729" height="493" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-create-new-product-api-request-template-transform.png 729w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-create-new-product-api-request-template-transform-300x203.png 300w" sizes="(max-width: 729px) 100vw, 729px" /></a></li>
<li>Click OK and save UI</li>
<li>Now drag ZS Web API Destination from SSIS Toolbox. Configure like below.Enter URL same as before (used to read product), change Method to <strong>POST</strong>, change content type to Application/JSON.<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-product-records-magento-call-rest-api.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-6390" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-product-records-magento-call-rest-api.png" alt="" width="778" height="660" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-product-records-magento-call-rest-api.png 778w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-product-records-magento-call-rest-api-300x254.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-product-records-magento-call-rest-api-768x652.png 768w" sizes="(max-width: 778px) 100vw, 778px" /></a></li>
<li>Now run entire flow (You can watch your API <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">requests in Fiddler</a> for debugging)</li>
</ol>
<h2>Debug Magento Web Requests using Fiddler</h2>
<p>Click on below article to learn how to debug web requests</p>
<blockquote class="wp-embedded-content" data-secret="dKZ26bWM7i"><p><a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/">How to use Fiddler to analyze HTTP Web Requests</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" src="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/embed/#?secret=dKZ26bWM7i" data-secret="dKZ26bWM7i" width="600" height="338" title="&#8220;How to use Fiddler to analyze HTTP Web Requests&#8221; &#8212; ZappySys Blog" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>&nbsp;</p>
<h2>Magento Integration in Other Apps (e.g. Power BI / Informatica / SQL Server)</h2>
<p>You can use techniques listed on this page with <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ODBC Drivers</a> too for integration in other tools like Power BI, SQL Server code, Informatica etc.</p>
<h2>Conclusion</h2>
<p>In this post we saw how easy it is to perform Magento Integration in SSIS without doing any programming. In few steps you can read or write data in Magento using <a href="https://zappysys.com/products/ssis-powerpack/">SSIS PowerPack</a> REST API components. Download FREE Trial and explore many other scenarios.</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/ssis-magento-data-read-write-using-rest-api-call/">SSIS Magento data Read / Write using REST API Call</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SSIS Geocoding with Google Maps API</title>
		<link>https://zappysys.com/blog/ssis-geocoding-with-google-maps-api/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 14 Sep 2018 14:02:23 +0000</pubDate>
				<category><![CDATA[Google API]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS Components]]></category>
		<category><![CDATA[SSIS JSON Parser Transform]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[SSIS WEB API Destination]]></category>
		<category><![CDATA[geocoding]]></category>
		<category><![CDATA[geocoding api]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google maps api]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[reverse geocoding]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=4821</guid>

					<description><![CDATA[<p>Introduction In this tutorial, we will cover the topics of how to perform geocoding on the addresses and reverse geocoding on the location coordinates using SSIS and Google Maps API. So what is geocoding, exactly? Geocoding is the process of translating an address (e.g. a street address) or a place to coordinates on the Earth&#8217;s surface. Simply [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-geocoding-with-google-maps-api/">SSIS Geocoding with Google Maps API</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><img loading="lazy" decoding="async" class="wp-image-4852 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/09/icons8-google-maps-180-e1537353957364.png" alt="" width="100" height="100" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/icons8-google-maps-180-e1537353957364.png 155w, https://zappysys.com/blog/wp-content/uploads/2018/09/icons8-google-maps-180-e1537353957364-150x150.png 150w" sizes="(max-width: 100px) 100vw, 100px" /></p>
<p style="text-align: justify;">In this tutorial, we will cover the topics of how to perform <em>geocoding</em> on the addresses and <em>reverse geocoding</em> on the location coordinates using SSIS and <a href="https://developers.google.com/maps/documentation/" rel="noopener">Google Maps API</a>. So what is <em>geocoding,</em> exactly? <em>Geocoding</em> is the process of translating an address (e.g. a street address) or a place to coordinates on the Earth&#8217;s surface. Simply put, <em>geocoding</em> takes a description of a location and gives back latitude and longitude values as a result. For example, <pre class="crayon-plain-tag">1600 Amphitheatre Parkway, Mountain View, CA 94043, USA</pre>  gets translated to <pre class="crayon-plain-tag">(37.4224764, -122.0842499)</pre>. <em>Reverse geocoding</em>, on the other hand, is the exact opposite process. In it, latitude and longitude values pair gets translated into a human-readable form. To take the same example above,  <pre class="crayon-plain-tag">(37.4224764, -122.0842499)</pre> would translate back to <pre class="crayon-plain-tag">1600 Amphitheatre Parkway, Mountain View, CA 94043, USA</pre>. So, if you need to perform any of the lookups, you can use <a href="https://developers.google.com/maps/documentation/geocoding/start" rel="noopener">Google Maps Geocoding API</a>. Actually, Google Maps Geocoding API offers a bit more <span id="Step-by-Step_Export_data_from_Salesforce_to_SQL_Server_using_SSIS"><span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">– you can use it for <em>address validation</em>, <em>cleansing</em>, and <em>formatting</em>.</span></span></span></span></p>
<div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF7B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>NOTE:</strong> If it happens that you need to use other geocoding provider and perform the lookups in SSIS, you may still benefit from this article (the examples of usage of Google Maps Geocoding API can be replaced by another provider). </div></div>
<p style="text-align: justify;">To accomplish our goal we will use an add-on for SSIS <span id="Step-by-Step_Export_data_from_Salesforce_to_SQL_Server_using_SSIS"><span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">– <a href="https://zappysys.com/products/ssis-powerpack/" rel="noopener">ZappySys SSIS PowerPack</a></span></span></span></span><span id="Step-by-Step_Export_data_from_Salesforce_to_SQL_Server_using_SSIS"><span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">.</span></span></span></span> It contains many additional SSIS Tasks and Data Flow Components that lets you accomplish what you cannot do with standard SSIS connectors. We will use these <a href="https://zappysys.com/products/ssis-powerpack/" rel="noopener">ZappySys SSIS PowerPack</a> connectors:</p>
<div class="content_block" id="custom_post_widget-5067"><div style="display: table-row; background: #f7f7f7;">
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc;"><img loading="lazy" decoding="async" style="vertical-align: middle; width: 50px; height: 50px; max-width: 50px;" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/web-api-destination/ssis-web-api-destination.png" alt="Web API Destination" width="50" height="50" /></div>
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc; border-left: none; width: 100%;"><a href="//zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">Web API Destination</a></div>
</div></div>
<div class="content_block" id="custom_post_widget-5078"><div style="display: table-row; background: #f7f7f7;">
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc;"><img loading="lazy" decoding="async" style="vertical-align: middle; width: 50px; height: 50px; max-width: 50px;" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/json-parser-transform/ssis-json-parser-transform.png" alt="JSON Parser Transform" width="50" height="50" /></div>
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc; border-left: none; width: 100%;"><a href="//zappysys.com/products/ssis-powerpack/ssis-json-parser-transform/" target="_blank" rel="noopener">JSON Parser Transform</a></div>
</div></div>
<p>Let&#8217;s start!</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2><span id="Step-by-Step_Export_data_from_Salesforce_to_SQL_Server_using_SSIS">Step-by-Step <span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">– </span></span></span></span>SSIS Geocoding with Google Maps API</h2>
<p style="text-align: justify;">Before we start, let&#8217;s consider the use-case for our tutorial. Suppose, you have a CRM system filled with user-entered addresses of your leads. Since they are user-entered, it means that they can be incomplete, malformed, or just plain rubbish. Also, you have a marketing campaign and you want to send letters with offers to your leads so that they become your clients. Before sending them any letters, you have to make sure the addresses are valid and well-formed. You are also interested in the geographical location of your leads that you could do some business intelligence analysis on the coordinates of your leads and maybe future clientele. Here is where Geocoding API kicks in.</p>
<p style="text-align: justify;">Thus in this example, we will take various street addresses <span id="Step-by-Step_Export_data_from_Salesforce_to_SQL_Server_using_SSIS"><span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">– sometimes invalid, </span></span></span></span>incomplete or unformatted <span id="Step-by-Step_Export_data_from_Salesforce_to_SQL_Server_using_SSIS"><span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">– and submit them to Google Geocoding API for processing. </span></span></span></span><span id="Step-by-Step_Export_data_from_Salesforce_to_SQL_Server_using_SSIS"><span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">As a result, we will get nicely formatted, cleansed, full addresses and their coordinates. We will take a look on how to determine if lookup worked successfully and to what extent you should trust Geocoding API&#8217;s response. Finally, we will save retrieved addresses and their individual components (e.g. street number, street name, city, country, etc.) to a SQL Server database table.</span></span></span></span></p>
<div class="content_block" id="custom_post_widget-5017"><h3>Create a Google project</h3>
First, to use a Google API, you need to have a Google project. Create one, if you don't have any or want to use a new project:
<ol>
 	<li>Go to <a href="https://console.cloud.google.com/home/dashboard" target="_blank" rel="noopener">Google Console</a> and click on the projects list:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-4923" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-project-list.png" alt="" width="603" height="243" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-project-list.png 603w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-project-list-300x121.png 300w" sizes="(max-width: 603px) 100vw, 603px" /></li>
 	<li>Once a window opens, click "New Project":
<img loading="lazy" decoding="async" class="alignnone wp-image-4924 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-create-new-project-1-e1538487942630.png" alt="" width="731" height="258" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-create-new-project-1-e1538487942630.png 731w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-create-new-project-1-e1538487942630-300x106.png 300w" sizes="(max-width: 731px) 100vw, 731px" /></li>
 	<li>Give a name for the project and click "Create":
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-4925" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-give-name-for-project.png" alt="" width="603" height="379" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-give-name-for-project.png 603w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-give-name-for-project-300x189.png 300w" sizes="(max-width: 603px) 100vw, 603px" /></li>
 	<li>Wait a couple of minutes for the project to create.</li>
 	<li>Again, click on the projects drop-down list:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-4926" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-project-list-1.png" alt="" width="603" height="243" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-project-list-1.png 603w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-project-list-1-300x121.png 300w" sizes="(max-width: 603px) 100vw, 603px" /></li>
 	<li>Finally, select the project you've just created:
<img loading="lazy" decoding="async" class="alignnone wp-image-4927 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-select-the-project-e1538487850139.png" alt="" width="721" height="355" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-select-the-project-e1538487850139.png 721w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-select-the-project-e1538487850139-300x148.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-select-the-project-e1538487850139-720x355.png 720w" sizes="(max-width: 721px) 100vw, 721px" /></li>
</ol></div>
<div class="content_block" id="custom_post_widget-5025"><h3>Enable billing for the project</h3>
Not all Google APIs are free. So you'll have to add billing for the project you have just created:
<div class="su-note" style="border-color: #e5dea5; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;">
<div class="su-note-inner su-clearfix" style="background-color: #fff7b7; border-color: #fffdf1; color: #333333; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;"><strong>NOTE</strong>: As of September 21, 2018, Google offers 300 USD credit for free (but you will still need to create a billing account).</div>
</div>
<ol>
 	<li>Visit <a href="https://console.cloud.google.com/project/_/billing/enable?redirect=https://developers.google.com/maps/documentation/geocoding/usage-and-billing?dialogOnLoad%3Dbilling-enabled" target="_blank" rel="noopener">Billing on Google Console</a> page.</li>
 	<li>Once it's opened, select the project:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-4928" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-billing-project-list.png" alt="" width="641" height="385" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-billing-project-list.png 641w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-billing-project-list-300x180.png 300w" sizes="(max-width: 641px) 100vw, 641px" /></li>
 	<li>Once a list of projects appears, select the one you created.</li>
 	<li>Then you will be prompted to create a billing account. Proceed to create one:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-4929" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-billing-create-account.png" alt="" width="514" height="202" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-billing-create-account.png 514w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-billing-create-account-300x118.png 300w" sizes="(max-width: 514px) 100vw, 514px" /></li>
</ol></div>
<div class="content_block" id="custom_post_widget-5031"><h3>Enable Google API for your project</h3>
To use any Google API you must enable it for your project:
<ol>
 	<li>Visit <a href="https://console.cloud.google.com/apis" target="_blank" rel="noopener">Google APIs Dashboard</a> page.</li>
 	<li>Make sure your project is selected and then click "Enable APIs and services":
<img loading="lazy" decoding="async" class="alignnone wp-image-4931 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-enable-api-for-the-project-e1538488797230.png" alt="" width="718" height="272" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-enable-api-for-the-project-e1538488797230.png 718w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-enable-api-for-the-project-e1538488797230-300x114.png 300w" sizes="(max-width: 718px) 100vw, 718px" /></li>
 	<li>Then in the box which appears, search for API you are interested in, e.g. "geocoding":
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-4934" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-search-for-api-1.png" alt="" width="645" height="303" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-search-for-api-1.png 645w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-search-for-api-1-300x141.png 300w" sizes="(max-width: 645px) 100vw, 645px" /></li>
 	<li>Finally, click on the Google API (e.g. "Geocoding API") tile:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-4935" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-select-geocoding-api.png" alt="" width="654" height="405" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-select-geocoding-api.png 654w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-select-geocoding-api-300x186.png 300w" sizes="(max-width: 654px) 100vw, 654px" /></li>
 	<li>Finally finally, enable Google API:
<img loading="lazy" decoding="async" class="alignnone wp-image-4936 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-enable-geocoding-api-e1537539131256.png" alt="" width="647" height="343" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-enable-geocoding-api-e1537539131256.png 647w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-enable-geocoding-api-e1537539131256-300x159.png 300w" sizes="(max-width: 647px) 100vw, 647px" /></li>
</ol></div>
<div class="content_block" id="custom_post_widget-5035"><h3>Create Geocoding API Key</h3>
Once you have Google API enabled, you are ready to create a Google API Key, which you will use in all HTTP requests:
<ol>
 	<li>Go to <a href="https://console.cloud.google.com/apis/dashboard" target="_blank" rel="noopener">Google APIs Dashboard</a>.</li>
 	<li>Make sure you have your project selected, then select "Credentials" menu item and create a new API Key:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-4937" src="https://zappysys.com/blog/wp-content/uploads/2018/09/sssi-google-api-how-to-create-api-key.png" alt="" width="695" height="434" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/sssi-google-api-how-to-create-api-key.png 695w, https://zappysys.com/blog/wp-content/uploads/2018/09/sssi-google-api-how-to-create-api-key-300x187.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/sssi-google-api-how-to-create-api-key-436x272.png 436w" sizes="(max-width: 695px) 100vw, 695px" /></li>
 	<li>Copy the newly created API Key to a safe place; we will use it later.</li>
</ol></div>
<h3>Load addresses from a SQL Server database table</h3>
<p>We prepared the Google Geocoding API part, now we are ready to get to the place where the rubber meets the road <span id="Step-by-Step_Export_data_from_Salesforce_to_SQL_Server_using_SSIS"><span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">– </span></span></span></span>we will create an SSIS package and load addresses from a database table:</p>
<ol>
<li>Create a new SSIS package.</li>
<li>Drag and drop <strong>Data Flow</strong> from SSIS Toolbox onto the Control Flow.
<div id="attachment_8028" style="width: 470px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8028" class="size-full wp-image-8028" src="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png" alt="" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /><p id="caption-attachment-8028" class="wp-caption-text">Dragging and dropping Data Flow Task into Control Flow</p></div></li>
<li>Drag and drop <strong>OLE DB Source</strong> onto the Data Flow.</li>
<li>Configure <strong>OLE DB Source</strong> to retrieve addresses from your table. We will use a table from Microsoft&#8217;s Northwind&#8217;s modified database &#8220;Marketing&#8221; (<a href="https://zappysys.com/blog/wp-content/uploads/2018/09/Marketing-database-script.zip">download it</a>):</li>
</ol>
<div id="attachment_4949" style="width: 718px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-load-addresses-1-e1538134305642.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4949" class="wp-image-4949 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-load-addresses-1-e1538134305642.png" alt="Loading user-entered addresses to be looked up in Google Geocoding API using SSIS." width="708" height="704" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-load-addresses-1-e1538134305642.png 708w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-load-addresses-1-e1538134305642-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-load-addresses-1-e1538134305642-300x298.png 300w" sizes="(max-width: 708px) 100vw, 708px" /></a><p id="caption-attachment-4949" class="wp-caption-text">Loading user-entered addresses to be looked up in Google Geocoding API using SSIS.</p></div>
<h3>Construct lookup URL</h3>
<ol>
<li>Drag and drop <strong>Derived Column</strong> component onto the Data Flow.</li>
<li>Add a new column and construct Geocoding lookup URL in this format (just like it says in <a href="https://developers.google.com/maps/documentation/geocoding/start" rel="noopener">Geocoding API documentation</a>):</li>
</ol>
<pre class="crayon-plain-tag">https://maps.googleapis.com/maps/api/geocode/json?address=ADDRESS_TO_LOOKUP&amp;key=YOUR_API_KEY</pre>
<div id="attachment_4959" style="width: 729px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-construct-url-e1538140223385.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4959" class="wp-image-4959 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-construct-url-e1538140223385.png" alt="Adding Google Geocoding API lookup URL as Derived Column to be used for geocoding in SSIS." width="719" height="510" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-construct-url-e1538140223385.png 719w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-construct-url-e1538140223385-300x213.png 300w" sizes="(max-width: 719px) 100vw, 719px" /></a><p id="caption-attachment-4959" class="wp-caption-text">Adding Google Geocoding API lookup URL as Derived Column to be used for geocoding in SSIS.</p></div>
<h3>Configure the Geocoding API request</h3>
<ol>
<li>Drag and drop <strong>Web API Destination</strong> onto the Data Flow and connect it with Derived Column. We will use Web API Destination to make HTTP requests to Geocoding API.</li>
<li>Then double-click on Web API Destination and create a new HTTP connection:
<div id="attachment_4962" style="width: 796px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-create-http-connection.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4962" class="wp-image-4962 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-create-http-connection.png" alt="Setting up HTTP Connection Manager for Web API Destination to make HTTP requests to Google Geocoding API using SSIS." width="786" height="478" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-create-http-connection.png 786w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-create-http-connection-300x182.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-create-http-connection-768x467.png 768w" sizes="(max-width: 786px) 100vw, 786px" /></a><p id="caption-attachment-4962" class="wp-caption-text">Setting up HTTP Connection Manager for Web API Destination to make HTTP requests to Google Geocoding API using SSIS.</p></div></li>
<li>Finally, configure <em>Input Column for URL</em>, <em>HTTP Request Method</em> and input into URL field a sample lookup URL:<br />
<pre class="crayon-plain-tag">https://maps.googleapis.com/maps/api/geocode/json?address=One Microsoft Way Redmond 98052-6399 USA&amp;key=YOUR_API_KEY</pre>
<div id="attachment_4963" style="width: 711px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-web-api-destination.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4963" class="wp-image-4963 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-web-api-destination.png" alt="Configuring Web API Destination to make geocoding lookups in Google Geocoding API using SSIS." width="701" height="623" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-web-api-destination.png 701w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-web-api-destination-300x267.png 300w" sizes="(max-width: 701px) 100vw, 701px" /></a><p id="caption-attachment-4963" class="wp-caption-text">Configuring Web API Destination to make geocoding lookups in Google Geocoding API using SSIS.</p></div>
<p>Once you are done, click <strong>Test Request/Response</strong> button. This will actually make a geocoding lookup for Microsoft headquarters:</li>
<li>In the <em>Response (Raw)</em> tab you see the actual response from Geocoding API. Within it –  cleansed, formatted and full Microsoft headquarters address together with geographical coordinates (even we looked it up using just the part of it). Now copy-paste the response body somewhere, so that we can use it in the next step while parsing:
<div id="attachment_4964" style="width: 693px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-sample-response.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4964" class="wp-image-4964 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-sample-response.png" alt="Checking Google Geocoding API HTTP response in Web API Destination using SSIS." width="683" height="642" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-sample-response.png 683w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-sample-response-300x282.png 300w" sizes="(max-width: 683px) 100vw, 683px" /></a><p id="caption-attachment-4964" class="wp-caption-text">Checking Google Geocoding API HTTP response in Web API Destination using SSIS.</p></div></li>
</ol>
<div class="su-note"  style="border-color:#e5da9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff4b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>NOTE:</strong> When Google Geocoding API retrieves only a partial result, it adds a new property in JSON named <em>partial_match</em>, as described in <a href="https://developers.google.com/maps/documentation/geocoding/intro#Results" rel="noopener">Geocoding API documentation</a>. This node is not present in the above sample response. </div></div>
<h3>Parsing Geocoding API JSON response into columns</h3>
<ol>
<li>Drag and drop <strong>JSON Parser Transform</strong> onto the Data Flow and connect it to Web API Destination.</li>
<li>Then open it and configure <em>Input JSON Column</em>.</li>
<li>After that, set the <em>Filter</em> to <strong>$.results[*]</strong>.</li>
<li>Continue by setting <em>Sample JSON strin</em>g to the one you saved in the previous step. Actually, before doing that let&#8217;s modify it and add <strong>partial_match</strong> node next to <strong>place_id</strong> so that <em>exact</em> and <em>partial</em> matches could be told apart (otherwise this property won&#8217;t be parsed):<br />
<pre class="crayon-plain-tag">{
    "results": [{
        "address_components": [{
            "long_name": "One",
            "short_name": "One",
            "types": ["street_number"]
        }, {
            "long_name": "Microsoft Way",
            "short_name": "Microsoft Way",
            "types": ["route"]
        }, {
            "long_name": "Overlake",
            "short_name": "Overlake",
            "types": ["neighborhood", "political"]
        }, {
            "long_name": "Redmond",
            "short_name": "Redmond",
            "types": ["locality", "political"]
        }, {
            "long_name": "King County",
            "short_name": "King County",
            "types": ["administrative_area_level_2", "political"]
        }, {
            "long_name": "Washington",
            "short_name": "WA",
            "types": ["administrative_area_level_1", "political"]
        }, {
            "long_name": "United States",
            "short_name": "US",
            "types": ["country", "political"]
        }, {
            "long_name": "98052",
            "short_name": "98052",
            "types": ["postal_code"]
        }],
        "formatted_address": "One Microsoft Way, Redmond, WA 98052, USA",
        "geometry": {
            "location": {
                "lat": 47.6423318,
                "lng": -122.1369302
            },
            "location_type": "ROOFTOP",
            "viewport": {
                "northeast": {
                    "lat": 47.6436807802915,
                    "lng": -122.1355812197085
                },
                "southwest": {
                    "lat": 47.6409828197085,
                    "lng": -122.1382791802915
                }
            }
        },
        "partial_match": false,
        "place_id": "ChIJGxUEuHFtkFQRnokD7mkppQE",
        "plus_code": {
            "compound_code": "JVR7+W6 Redmond, Washington, United States",
            "global_code": "84VVJVR7+W6"
        },
        "types": ["establishment", "point_of_interest"]
    }],
    "status": "OK"
}</pre>
<div id="attachment_4967" style="width: 729px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-json-parser-transform-1.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4967" class="wp-image-4967 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-json-parser-transform-1.png" alt="Configuring JSON Parser Transform to parse looked up addresses in Google Geocoding API HTTP JSON response using SSIS." width="719" height="584" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-json-parser-transform-1.png 719w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-json-parser-transform-1-300x244.png 300w" sizes="(max-width: 719px) 100vw, 719px" /></a><p id="caption-attachment-4967" class="wp-caption-text">Configuring JSON Parser Transform to parse looked up addresses in Google Geocoding API HTTP JSON response using SSIS.</p></div></li>
<li>To proceed and parse <em>individual address components</em> from JSON response (e.g. number, street, city, country, etc.), you will need to specify columns for each address component manually, just like portrayed in <a href="https://zappysys.com/blog/parse-multi-dimensional-json-array-ssis/#Pattern_5_8211_Multiple_Columns_with_Expressions_Google_Geocoding_API_Usecase" rel="noopener">Parse multi-dimensional JSON array in SSIS or Drivers</a> article. Just open <em>2D Array Transform</em> tab and select <strong>Multiple columns using expressions</strong> as <em>Transform Type</em> and configure them:
<div id="attachment_4970" style="width: 716px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-columns-json-parser-transform-1.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4970" class="wp-image-4970 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-columns-json-parser-transform-1.png" alt="Configuring JSON Parser Transform to parse individual address components from Google Geocoding API HTTP JSON response using SSIS." width="706" height="739" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-columns-json-parser-transform-1.png 706w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-columns-json-parser-transform-1-287x300.png 287w" sizes="(max-width: 706px) 100vw, 706px" /></a><p id="caption-attachment-4970" class="wp-caption-text">Configuring JSON Parser Transform to parse individual address components from Google Geocoding API HTTP JSON response using SSIS.</p></div>
<p>We specify these columns in our example:</p><pre class="crayon-plain-tag">Number = $.address_components[?(@.types[0]=='street_number')].long_name
Street = $.address_components[?(@.types[0]=='route')].long_name
City = $.address_components[?(@.types[0]=='locality')].long_name
State = $.address_components[?(@.types[0]=='administrative_area_level_1')].long_name
Country = $.address_components[?(@.types[0]=='country')].long_name
PostalCode = $.address_components[?(@.types[0]=='postal_code')].long_name</pre><p>
</li>
<li>Finally, be sure to set <strong>Include all upstream columns to downstream</strong> (quite important), so that CustomerID is passed downstream and which we can save into a destination table. Later it can be a useful column to join the source table and the destination table on. In that way, you will be able to map user-entered addresses with looked up, fully formatted addresses (won&#8217;t be demonstrated in this tutorial).</li>
</ol>
<h3>Save geocoding results into a SQL Server database table</h3>
<ol>
<li>We are now ready to add <strong>OLE DB Destination</strong>, execute the package, make the lookups, and save the results into the database:
<div id="attachment_4971" style="width: 828px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-saving-results-into-ole-db-destination-e1538150325533.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4971" class="wp-image-4971 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-saving-results-into-ole-db-destination-e1538150325533.png" alt="Creating a database table for the Google Geocoding API looked up addresses in SSIS." width="818" height="727" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-saving-results-into-ole-db-destination-e1538150325533.png 818w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-saving-results-into-ole-db-destination-e1538150325533-300x267.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-saving-results-into-ole-db-destination-e1538150325533-768x683.png 768w" sizes="(max-width: 818px) 100vw, 818px" /></a><p id="caption-attachment-4971" class="wp-caption-text">Creating a database table for the Google Geocoding API looked up addresses in SSIS.</p></div></li>
<li>Execute the package!
<div id="attachment_4972" style="width: 705px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-lookup-results.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4972" class="wp-image-4972 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-lookup-results.png" alt="SSIS geocoding package execution and its results." width="695" height="471" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-lookup-results.png 695w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-lookup-results-300x203.png 300w" sizes="(max-width: 695px) 100vw, 695px" /></a><p id="caption-attachment-4972" class="wp-caption-text">SSIS geocoding package execution and its results.</p></div></li>
</ol>
<h3>The results of SSIS geocoding</h3>
<div id="attachment_4985" style="width: 614px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-result-analysis.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4985" class="wp-image-4985 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-result-analysis.png" alt="Viewing the results of SSIS geocoding in SQL Server destination table." width="604" height="209" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-result-analysis.png 604w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-result-analysis-300x104.png 300w" sizes="(max-width: 604px) 100vw, 604px" /></a><p id="caption-attachment-4985" class="wp-caption-text">Viewing the results of SSIS geocoding in SQL Server destination table.</p></div>
<p style="text-align: justify;">Once you query the table of looked up results, you will notice several things:</p>
<ol style="text-align: justify;">
<li>Perhaps there are more rows in the results table than in the source table</li>
<li><em>partial_match</em> column is either <strong>1</strong> or <strong>NULL</strong></li>
<li><em>geometry.location_type </em>column has several values, e.g. <strong>ROOFTOP</strong>, <strong>RANGE_INTERPOLATED</strong>, <strong>APPROXIMATE</strong>, etc.</li>
</ol>
<p style="text-align: justify;">So to what extent should you trust the results? The answer is to take a look at <a href="https://developers.google.com/maps/documentation/geocoding/intro#Results" rel="noopener">the documentation</a> and see what these values mean.</p>
<p style="text-align: justify;">Basically, when <em>partial_match</em> is equal to <strong>1</strong>, according to Google:</p>
<ul style="text-align: justify;">
<li>Partial matches most often occur for street addresses that do not exist within the locality you pass in the request.</li>
<li>Partial matches may also be returned when a request matches two or more locations in the same locality. For example, &#8220;21 Henr St, Bristol, UK&#8221; will return a partial match for both Henry Street and Henrietta Street. Note that if a request includes a misspelled address component, the geocoding service may suggest an alternative address. Suggestions triggered in this way will also be marked as a partial match.</li>
</ul>
<p style="text-align: justify;">While <em>geometry.location_type</em> column tells how accurate the lookup was. Again, according to Google:</p>
<ul style="text-align: justify;">
<li><strong>&#8220;ROOFTOP&#8221;</strong> indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision.</li>
<li><strong>&#8220;RANGE_INTERPOLATED&#8221;</strong> indicates that the returned result reflects an approximation (usually on a road) interpolated between two precise points (such as intersections). Interpolated results are generally returned when rooftop geocodes are unavailable for a street address.</li>
<li><strong>&#8220;GEOMETRIC_CENTER&#8221;</strong> indicates that the returned result is the geometric center of a result such as a polyline (for example, a street) or polygon (region).</li>
<li><strong>&#8220;APPROXIMATE&#8221;</strong> indicates that the returned result is approximate.</li>
</ul>
<p style="text-align: justify;">Simply put, <strong>&#8220;ROOFTOP&#8221;</strong> is the most accurate lookup, while <strong>&#8220;APPROXIMATE&#8221;</strong> is the least accurate.</p>
<p style="text-align: justify;">Another valuable piece of information is how many individual address components are filled. The more <strong>NULLs</strong> are there, the less accurate is the address. So if you have <strong>NULL</strong> in the <em>Number</em> column and in the <em>Street</em> column, most likely this is not a very accurate lookup:</p>
<div id="attachment_4987" style="width: 675px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-result-analysis2.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4987" class="wp-image-4987 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-result-analysis2.png" alt="Individual address components of looked up addresses in Google Geocoding API using SSIS." width="665" height="210" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-result-analysis2.png 665w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-result-analysis2-300x95.png 300w" sizes="(max-width: 665px) 100vw, 665px" /></a><p id="caption-attachment-4987" class="wp-caption-text">Individual address components of looked up addresses in Google Geocoding API using SSIS.</p></div>
<p style="text-align: justify;">Concluding, in the figure above, you can see how user-entered address can be <em>validated</em>, <em>cleansed</em> and <em>formatted</em>.</p>
<h2>SSIS reverse geocoding with Google Maps API</h2>
<p>The concepts presented above about &#8220;forward&#8221; geocoding will help you to make reverse geocoding requests too. The only difference is the request URL:</p><pre class="crayon-plain-tag">https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&amp;key=YOUR_API_KEY</pre><p>
For reference and help visit official <a href="https://developers.google.com/maps/documentation/geocoding/intro#ReverseGeocoding" rel="noopener">Google Geocoding API documentation</a>.</p>
<div class="content_block" id="custom_post_widget-2021"><h2>Things have gone bad: Error handling &amp; debugging</h2>
<p style="text-align: justify;">Incidentally, bad things can happen<i>. </i>A remote server may go offline or your server may go out of memory. In any case, you may want to know when that happens and take actions accordingly. For that purpose, you have to redirect bad rows to some other destination. For this example, we will take and use <em>Web API Destination</em>, but basically, you can use any SSIS component:</p>

<h3>Handling errors</h3>
<ol style="margin-left: 0;">
 	<li>Add a <em>Derived Column</em> above <em>Web API Destination</em> with expression <strong>"(DT_WSTR,4000)ZS_JSON_OUT"</strong> and name it <strong>"JsonAsString"</strong>. This will let you see what JSON you are actually passing.</li>
 	<li>Then add a database or file destination or use another <em>Trash Destination</em> for debugging purposes and redirect the bad rows (<span style="color: #d66565;">red arrow</span>) from <em><em>Web API Destination </em></em>into it<em><em>. </em></em>Don't forget to set <span class="lang:default decode:true crayon-inline">Redirect row</span> option for both, <em>Error</em> and <em>Truncation</em> columns:<em><em>
</em></em>
<div class="wp-caption">

<a href="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-1487 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows.png" alt="Redirect bad rows from &lt;em&gt;Web API Destination&lt;/em&gt; to &lt;em&gt;Trash Destination&lt;/em&gt; when load from SQL Server to Elasticsearch is failing. Add derived column JsonAsString to be able to read JSON you are using." width="739" height="267" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows.png 739w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows-300x108.png 300w" sizes="(max-width: 739px) 100vw, 739px" /></a>
<p class="wp-caption-text">Redirected failed requests from <em>Web API Destination</em> to a desired destination when loading from SQL Server to REST API Service is failing. Derived Column <em>JsonAsString</em> added to be able to read JSON which was passed to Elasticsearch</p>

</div></li>
 	<li>Finally, add a <a href="https://technet.microsoft.com/en-us/library/ms140318%28v=sql.90%29.aspx?f=255&amp;MSPPError=-2147217396" target="_blank" rel="noopener"><em>Data Viewer</em></a> for the red path, if you want to debug the flow. You will be able to see URL, JSON and the error message for each record. You may want to copy-paste <em>ErrorMessage</em> to <em>Notepad </em>if you want it to be more readable:
<div class="wp-caption">

<a href="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-1494 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling.png" alt="Use Data Viewer to view HTTP requests that failed to be fulfilled in Elasticsearch" width="752" height="280" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling.png 752w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-300x112.png 300w" sizes="(max-width: 752px) 100vw, 752px" /></a>
<p class="wp-caption-text">Use Data Viewer to view HTTP requests that failed to be fulfilled.</p>

</div></li>
</ol>
<div class="su-note" style="border-color: #e5dea5; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;">
<div class="su-note-inner su-clearfix" style="background-color: #fff7b7; border-color: #fffdf1; color: #333333; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;"><strong>NOTE</strong>: You can read more about redirecting rows in <a href="//zappysys.com/blog/ssis-error-handling-in-data-flow-redirect-bad-rows/" target="_blank" rel="noopener">SSIS Error Handling (Redirect bad rows)</a> article.</div>
</div>
<h3>Debugging HTTP requests</h3>
<p style="text-align: justify;">A common thing you have to do when working with HTTP requests is to debug those requests; e.g. to check what headers, body or URL was passed. <span id="Debug_Web_API_call_using_Fiddler"></span>To test how things look behind the scenes we strongly suggest to use <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">Fiddler</a> - a popular web debugging tool.</p>
<p style="text-align: justify;">Inside it, you can double-click the URL entry (Right side) to see Request and Response Panels. The top panel is Request (URL, Headers, Body) and Bottom Panel is Response. For https:// (secure URL) make sure you enable HTTPS option in Fiddler (Tools &gt; Options &gt; HTTPS &gt; Check Decrypt https request):</p>

<div id="attachment_2344" class="wp-caption alignnone">

<a href="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?ssl=1" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-2344 size-full" style="border: 0px; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.176) 0px 1px 2px;" src="https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png" alt="Debugging Web API call using Fiddler in SSIS" width="1287" height="564" data-attachment-id="2344" data-permalink="https://zappysys.com/blog/pass-authorization-header-redirected-location/ssis-rest-api-call-debug-via-fiddler/#main" data-orig-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=1287%2C564&amp;ssl=1" data-orig-size="1287,564" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ssis-rest-api-call-debug-via-fiddler" data-image-description="&lt;p&gt;Debugging Web API call using Fiddler in SSIS&lt;/p&gt; " data-medium-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=300%2C131&amp;ssl=1" data-large-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=720%2C316&amp;ssl=1" srcset="https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png 1287w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler-300x131.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler-768x337.png 768w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler-1024x449.png 1024w" sizes="(max-width: 1287px) 100vw, 1287px" /></a>
<p class="wp-caption-text">Debugging Web API call using Fiddler in SSIS</p>

</div></div>
<h2>Common errors</h2>
<div class="content_block" id="custom_post_widget-1887"><h3>Truncation related error</h3>
<p style="text-align: justify;">The most common error you may face when you run an 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 on how to fix common metadata related errors read an article "<a href="//zappysys.com/blog/handling-ssis-component-metadata-issues/" target="_blank" rel="noopener">How to handle SSIS errors (truncation, metadata issues)</a>".</p>

<h3>Authentication related error</h3>
Another frequent error you may get is an authentication error, which happens when you deploy/copy a package to another machine and run it there. Check <a href="#Deployment_to_Production">the paragraph below</a> to see why it happens and how to solve this problem.</div>
<h2><span id="Deployment_to_Production">Parameterization and d</span><span id="Deployment_to_Production">eployment to production </span></h2>
<div class="content_block" id="custom_post_widget-1932"><p style="text-align: justify;">In SSIS package <a href="https://docs.microsoft.com/en-us/sql/integration-services/security/access-control-for-sensitive-data-in-packages" target="_blank" rel="noopener">sensitive data such as tokens and passwords are by default encrypted by SSIS</a> with your Windows account which you use to create a package. So SSIS will fail to decrypt tokens/passwords when you run it from another machine using another Windows account. To circumvent this when you are creating an SSIS package which uses authentication components (e.g. an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-oauth-connection-manager.htm" target="_blank" rel="noopener">OAuth Connection Manager</a> or an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-http-connection-manager.htm" target="_blank" rel="noopener">HTTP Connection Manager</a> with credentials, etc.), consider using parameters/variables to pass tokens/passwords. In this way, you won’t face authentication related errors when a package is deployed to a production server.</p>
<p style="text-align: justify;">Check our article on <a href="https://zappysys.com/blog/how-to-run-an-ssis-package-with-sensitive-data-on-sql-server/" target="_blank" rel="noopener">how to configure packages with sensitive data on your production or development server</a>.</p></div>
<h2>Download a sample package</h2>
<p style="text-align: justify;">Be sure to download a <a href="https://zappysys.com/blog/wp-content/uploads/2018/09/SSIS-Geocoding-using-Google-Maps-API.zip">sample SQL Server 2012 SSIS package</a>, in case you want to try it right away (you can upgrade it to a higher version). If you want to use the database that was used in this tutorial, don&#8217;t forget to create the <a href="https://zappysys.com/blog/wp-content/uploads/2018/09/Marketing-database-script.zip">Marketing database from the script</a> (a modified Microsoft&#8217;s Northwind database).</p>
<h2>Conclusion</h2>
<p style="text-align: justify;">In this tutorial, we step-by-step covered how to make geocoding lookups using Geocoding API, part of Google Maps API. We learned how to <em>cleanse</em>, <em>validate</em> and <em>format</em> address just by submitting it to Geocoding API and parsing the results. We moved forward and looked at how to interpret the results and what geocoding results to trust. Then we touched the point that the same process could be applied to <a href="https://developers.google.com/maps/documentation/geocoding/intro#ReverseGeocoding" rel="noopener"><em>reverse geocoding</em></a>. Concluding, we took a look at how to handle common errors and how to parameterize an SSIS package and deploy it to production.</p>
<p>The post <a href="https://zappysys.com/blog/ssis-geocoding-with-google-maps-api/">SSIS Geocoding with Google Maps API</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Read / Write Zoho CRM data using SSIS REST API Call</title>
		<link>https://zappysys.com/blog/read-write-zoho-crm-data-using-ssis-rest-api-call/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 16 Feb 2018 04:21:06 +0000</pubDate>
				<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS Template Transform]]></category>
		<category><![CDATA[SSIS WEB API Destination]]></category>
		<category><![CDATA[SSIS XML Parser Transform]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[zoho]]></category>
		<category><![CDATA[zoho crm]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=2625</guid>

					<description><![CDATA[<p>Introduction In this post, you will learn how to read / write Zoho CRM data using SSIS (Drag and drop approach without any coding).  We will use SSIS JSON/ REST API Source to extract data from Zoho API and use SSIS Web API Destination to write data to Zoho. We will look at step-by-step instructions to read Zoho CRM [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-write-zoho-crm-data-using-ssis-rest-api-call/">Read / Write Zoho CRM data using SSIS REST API Call</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF8B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>UPDATE:</strong> ZappySys has released a brand new <a href="https://zappysys.com/api/integration-hub/zoho-crm-connector/">API Connector for Zoho CRM Online</a> which makes it much simpler to <strong>Read/Write Zoho CRM Data in SSIS</strong> compared to the steps listed in this article. You can still use steps from this article but if you are new to API or want to avoid learning curve with API then use newer approach.</p>
<p>Please visit <a href="https://zappysys.com/api/integration-hub/">this page to see all</a> Pre-Configured ready to use API connectors which you can use in <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-source/">SSIS API Source</a> / <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-destination/">SSIS API Destination</a> OR <a href="https://zappysys.com/products/odbc-powerpack/odbc-api-driver/">API ODBC Driver</a> (for non-SSIS Apps such as Excel, Power BI, Informatica).</p>
</div></div>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/02/zoho-crm-api-integration-logo.jpg"><img loading="lazy" decoding="async" class=" wp-image-2655 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/02/zoho-crm-api-integration-logo.jpg" alt="" width="147" height="147" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/zoho-crm-api-integration-logo.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/zoho-crm-api-integration-logo-150x150.jpg 150w" sizes="(max-width: 147px) 100vw, 147px" /></a>In this post, you will learn how to read / write Zoho CRM data using SSIS (Drag and drop approach without any coding).  We will use <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">SSIS JSON/ REST API Source</a> to extract data from Zoho API and use <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">SSIS Web API Destination</a> to write data to Zoho.</p>
<p>We will look at step-by-step instructions to read Zoho CRM data (e.g. Leads, Accounts, Contacts) and load into SQL Server Database Table. In the next section, we will look at Write scenario too.</p>
<p>Now let’s look at step-by-step approach to call Zoho API  using SSIS.</p>
<p>&nbsp;</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>Authentication Using Zoho V2 REST API (OAuth 2.0)</h2>
<p>Zoho recently released v2 API. It uses OAuth 2.0 instead of static Token based (described in the next section). OAuth approach is more secure an recommended. If you must use static token-method then check next section. Zoho may discontinue Token based method in future.</p>
<h3>Register Zoho OAuth App and get ClientID/ Secret (*** MUST READ ***)</h3>
<p><a href="https://zappysys.com/blog/register-oauth-app-zoho-api/" target="_blank" rel="noopener">Check this article</a> to register your OAuth App and obtain Client ID  /Client Secret</p>
<h3>Create Zoho OAuth Connection in SSIS (for API call)</h3>
<p>Once you create Zoho OAuth App now its time to call some Zoho API. We will use <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">ZappySys REST API Task</a> to make simple API call. In the next section we will see how to load data in SQL Server.</p>
<ol>
<li>Open SSIS Package and go to SSIS Designer (Control Flow)</li>
<li>Drag <strong>ZS REST API Task</strong> from Control Flow SSIS Toolbox as below
<div style="width: 565px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/rest-api-task/ssis-rest-api-web-service-task-drag.png" alt="Drag and drop SSIS REST API Task from SSIS Toolbox " width="555" height="199" /><p class="wp-caption-text">Drag and drop SSIS REST API Task from SSIS Toolbox</p></div></li>
<li>Double click the task to configure.</li>
<li>Change URL Access mode to <strong>URL from Connection</strong></li>
<li>Enter API <strong>URL</strong> you like to call. For example you can enter below<br />
<pre class="crayon-plain-tag">https://www.zohoapis.com/crm/v2/settings/modules</pre>
</li>
<li>Select <strong>New ZS-OAUTH</strong> connection from Connection drop down
<div id="attachment_8307" style="width: 511px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-rest-api-oauth-use-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8307" class="size-full wp-image-8307" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-rest-api-oauth-use-connection.png" alt="Call Zoho REST API using OAuth 2.0" width="501" height="406" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-rest-api-oauth-use-connection.png 501w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-rest-api-oauth-use-connection-300x243.png 300w" sizes="(max-width: 501px) 100vw, 501px" /></a><p id="caption-attachment-8307" class="wp-caption-text">Call Zoho REST API using OAuth 2.0</p></div></li>
<li>Configure your OAuth connection General Tab as below
<ol>
<li>OAuth Provider: <strong>Custom</strong></li>
<li>OAuth Version: <strong>OAuth2</strong></li>
<li><strong>Client Id</strong> , <strong>Client Secret </strong></li>
<li>Enter One Scope Per Line (For more info on scope <a href="https://www.zoho.com/crm/help/api/v2/#OAuth2_0" target="_blank" rel="noopener">read here</a>)<br />
<pre class="crayon-plain-tag">ZohoCRM.modules.READ
ZohoCRM.settings.READ</pre>
</li>
<li>Auth URL : <strong>https://accounts.zoho.com/oauth/v2/auth</strong></li>
<li>Token URL:  <strong><strong>https://accounts.zoho.com/oauth/v2/token</strong></strong><a href="https://zappysys.com/blog/wp-content/uploads/2022/04/zoho-api-configure-oauth-token-url-scopes.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-9617" src="https://zappysys.com/blog/wp-content/uploads/2022/04/zoho-api-configure-oauth-token-url-scopes.png" alt="" width="577" height="328" srcset="https://zappysys.com/blog/wp-content/uploads/2022/04/zoho-api-configure-oauth-token-url-scopes.png 577w, https://zappysys.com/blog/wp-content/uploads/2022/04/zoho-api-configure-oauth-token-url-scopes-300x171.png 300w" sizes="(max-width: 577px) 100vw, 577px" /></a></li>
</ol>
</li>
<li>Configure Advanced tab as below
<ol>
<li>Enter Callback URL : <strong>https://zappysys.com/oauth</strong></li>
<li>Enter Extra Attribute for /Auth : <strong>access_type=offline&amp;prompt=consent</strong><br />
This is needed to obtain refresh_token (if you ommit this then only access_token returned which cannot be renewed once expired after 1hr)</p>
<div class="mceTemp"></div>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2022/04/zoho-api-oauth-redirect-callback-url.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-9618" src="https://zappysys.com/blog/wp-content/uploads/2022/04/zoho-api-oauth-redirect-callback-url.png" alt="" width="551" height="320" srcset="https://zappysys.com/blog/wp-content/uploads/2022/04/zoho-api-oauth-redirect-callback-url.png 551w, https://zappysys.com/blog/wp-content/uploads/2022/04/zoho-api-oauth-redirect-callback-url-300x174.png 300w" sizes="(max-width: 551px) 100vw, 551px" /></a></li>
</ol>
</li>
<li>Now go back to general tab and <strong>Click Generate Token</strong>.
<div id="attachment_3349" style="width: 824px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/zoho-oauth-get-token-authenticate-for-rest-api-access.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3349" class="size-full wp-image-3349" src="https://zappysys.com/blog/wp-content/uploads/2018/02/zoho-oauth-get-token-authenticate-for-rest-api-access.png" alt="Generate OAuth Token for Zoho CRM REST API Access" width="814" height="749" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/zoho-oauth-get-token-authenticate-for-rest-api-access.png 814w, https://zappysys.com/blog/wp-content/uploads/2018/02/zoho-oauth-get-token-authenticate-for-rest-api-access-300x276.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/zoho-oauth-get-token-authenticate-for-rest-api-access-768x707.png 768w" sizes="(max-width: 814px) 100vw, 814px" /></a><p id="caption-attachment-3349" class="wp-caption-text">Generate OAuth Token for Zoho CRM REST API Access</p></div></li>
<li>Click OK to save the connection UI</li>
</ol>
<h3>Call Zoho API using OAuth Connection</h3>
<ol>
<li>On the REST API Task click Test Request / Response
<div id="attachment_3351" style="width: 790px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-zoho-rest-api-using-oauth.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3351" class="size-full wp-image-3351" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-zoho-rest-api-using-oauth.png" alt="SSIS REST API Task - Call Zoho REST API in SSIS (OAuth 2.0) " width="780" height="679" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-zoho-rest-api-using-oauth.png 780w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-zoho-rest-api-using-oauth-300x261.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-zoho-rest-api-using-oauth-768x669.png 768w" sizes="(max-width: 780px) 100vw, 780px" /></a><p id="caption-attachment-3351" class="wp-caption-text">SSIS REST API Task &#8211; Call Zoho REST API in SSIS (OAuth 2.0)</p></div></li>
</ol>
<h2>Read data from Zoho Table in SSIS JSON Source</h2>
<p>In this section we will learn how to read data from Zoho using SSIS JSON Source. We will use OAuth connection created in earlier section.</p>
<p>Now lets look at step by step example of reading Zoho CRM data using SSIS (e.g. read Leads, Accounts, Contacts, Invoice etc). Zoho provides JSON API for read action so we will Use <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">SSIS JSON Source</a> for this purpose. Full sample package is attached at the end of this article but see below steps for high level configuration.</p>
<h3>Configure JSON Source</h3>
<p>So below steps shows example of reading from Zoho Lead modules using <a href="https://www.zoho.com/crm/developer/docs/api/get-records.html" target="_blank" rel="noopener">v2 records API Call</a>.</p>
<ol>
<li>Open SSIS Package</li>
<li>Drag data flow task from Control flow SSIS Toolbox
<div style="width: 470px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/drag-and-drop-data-flow-task.png" alt="Drag data flow from SSIS Toolbox" width="460" height="155" /><p class="wp-caption-text">Drag data flow from SSIS Toolbox</p></div></li>
<li>Go to data flow and drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">ZS JSON Source</a> from SSIS Toolbox
<div style="width: 551px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/json-source/ssis-json-source-adapter-drag.png" alt="Drag and drop SSIS JSON Source (REST API or File)" width="541" height="144" /><p class="wp-caption-text">Drag and drop SSIS JSON Source (REST API or File)</p></div></li>
<li>Double click JSON Source to configure. Enter URL as below. You can supply few more parameters. <a href="https://www.zoho.com/crm/developer/docs/api/get-records.html" target="_blank" rel="noopener">Click Here to get full list of parameters and usage</a>. In below example we are reading records from Leads Module but you can replace Leads to something else (e.g. Accounts). Refer to above help link for available Modules.<br />
<pre class="crayon-plain-tag">https://www.zohoapis.com/crm/v2/Leads?per_page=200</pre>
</li>
<li>Check Use Credentials. Select OAuth connection manager we created in the previous section.</li>
<li>Under filter options tab, enter Array Filter as  <pre class="crayon-plain-tag">$.data[*]</pre></li>
<li>Now click Preview to see your data
<div id="attachment_8308" style="width: 947px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-extract-data-based-on-last-modified-date.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8308" class="size-full wp-image-8308" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-extract-data-based-on-last-modified-date.png" alt="Read data from Zoho API v2 using SSIS - OAuth (Use Last Modified Date for Incremental Extract)" width="937" height="806" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-extract-data-based-on-last-modified-date.png 937w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-extract-data-based-on-last-modified-date-300x258.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-extract-data-based-on-last-modified-date-768x661.png 768w" sizes="(max-width: 937px) 100vw, 937px" /></a><p id="caption-attachment-8308" class="wp-caption-text">Read data from Zoho API v2 using SSIS &#8211; OAuth (Use Last Modified Date for Incremental Extract)</p></div></li>
<li>Click OK to save UI. In the next section we will see how to setup pagination and incremental extract of Zoho records. After that we will see how to load data into SQL Server Table.</li>
</ol>
<h3>Zoho API Pagination (Read all rows)</h3>
<p>Just like most API zoho also uses pagination. See below for how to configure pagination in JSON Source for Zoho API.</p>
<ol>
<li>Double click JSON Source</li>
<li>Go to the <strong>Pagination</strong> Tab and select <strong>URL Parameter Mode</strong></li>
<li>For <strong>Page Num Indicator</strong> Enter <pre class="crayon-plain-tag">page</pre></li>
<li>For <strong>Last Page Detection</strong> select <pre class="crayon-plain-tag">Detect last page based on status code</pre></li>
<li>In the Status code field<br />
enter <strong>304</strong> (if you added If-Modified-Since header for incremental extract &#8211; See next section)<br />
enter <strong>204</strong> (if you do not add If-Modified-Since)</li>
</ol>
<p>Once you configure this way now your API will return all records until last page is detected. For more information on pagination <a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/" target="_blank" rel="noopener">check this article</a></p>
<div id="attachment_8309" style="width: 674px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/pagination-stop-detect-based-on-status-code.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8309" class="size-full wp-image-8309" src="https://zappysys.com/blog/wp-content/uploads/2018/02/pagination-stop-detect-based-on-status-code.png" alt="Paginate Zoho API records" width="664" height="243" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/pagination-stop-detect-based-on-status-code.png 664w, https://zappysys.com/blog/wp-content/uploads/2018/02/pagination-stop-detect-based-on-status-code-300x110.png 300w" sizes="(max-width: 664px) 100vw, 664px" /></a><p id="caption-attachment-8309" class="wp-caption-text">Paginate Zoho API records</p></div>
<h3>Incremental Extract based on Last Modified Date/Time field</h3>
<p>Each module in Zoho has Last Modified By and LastModified Date/Time fields. You can filter extracted data for incremental extract by supplying <pre class="crayon-plain-tag">If-Modified-Since</pre>  HTTP header along with your request. Here is how to do.</p>
<ol>
<li>On the JOSN Source, click Raw Edit above HTTP Headers Grid.  We can define Header to extract data after last modified date. Skip this step if you like to extract all records.<br />
For example to read Lead records which are modified after 12/31/2019 you can enter header like below. Date/Time is UTC. When record is created Modified date is set as creation date too so this will include created records too.<br />
<pre class="crayon-plain-tag">If-Modified-Since: 2019-12-31T00:00:00</pre>
If you have local time saved in a variable and you like to use SSIS variable then you can use below way. In this example we converted Local time to UTC.<br />
<pre class="crayon-plain-tag">If-Modified-Since: &lt;&lt;{{User::varExtractDate,yyyy-MM-ddTHH:mm:ss}},FUN_TO_UTC_DATE&gt;&gt;</pre>
</li>
</ol>
<h2></h2>
<h3>Loading Zoho data into SQL Server Table / Other Target</h3>
<div class="content_block" id="custom_post_widget-5617"><p>ZappySys SSIS PowerPack makes it easy to load data from various sources such as REST, SOAP, JSON, XML, CSV or from other source into SQL Server, or PostgreSQL, or Amazon Redshift, or other  targets. The <strong>Upsert Destination</strong> component allows you to automatically insert new records and update existing ones based on key columns. Below are the detailed steps to configure it.</p>
<h3>Step 1: Add Upsert Destination to Data Flow</h3>
<ol>
<li>Drag and drop the <strong>Upsert Destination</strong> component from the SSIS Toolbox.</li>
<li>Connect your source component (e.g., JSON / REST / Other Source) to the Upsert Destination.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png" /></a>
<p class="wp-caption-text">SSIS - Data Flow - Drang and Drop Upsert Destination Component</p>
</div>
<h3>Step 2: Configure Target Connection</h3>
<ol>
<li>Double-click the <strong>Upsert Destination</strong> component to open the configuration window.</li>
<li>Under <strong>Connection</strong>, select an existing target connection or click <strong>NEW</strong> to create a new connection.
<ul>
<li>Example: SQL Server, or PostgreSQL, or Amazon Redshift.</li>
</ul>
</li>
</ol>
<h3>Step 3: Select or Create Target Table</h3>
<ol>
<li>In the <strong>Target Table</strong> dropdown, select the table where you want to load data.</li>
<li>Optionally, click <strong>NEW</strong> to create a new table based on the source columns.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png" /></a>
<p class="wp-caption-text">Configure SSIS Upsert Destination Connection - Loading data (REST / SOAP / JSON / XML /CSV) into SQL Server or other target using SSIS</p>
</div>
<h3>Step 4: Map Columns</h3>
<ol>
<li>Go to the <strong>Mappings</strong> tab.</li>
<li>Click <strong>Auto Map</strong> to map source columns to target columns by name.</li>
<li>Ensure you <strong>check the Primary key column(s)</strong> that will determine whether a record is inserted or updated.</li>
<li>You can manually adjust the mappings if necessary.</li>
</ol>
 <div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination - Columns Mappings</p>
</div>
<h3>Step 5: Save Settings</h3>
<ul>
<li>Click <strong>OK</strong> to save the Upsert Destination configuration.</li>
</ul>
<h3>Step 6: Optional: Add Logging or Analysis</h3>
<ul>
<li>You may add extra destination components to log the number of inserted vs. updated records for monitoring or auditing purposes.</li>
</ul>
<h3>Step 7: Execute the Package</h3>
<ul>
<li>Run your SSIS package and verify that the data is correctly inserted and updated in the target table.</li>
</ul>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination Execution</p>
</div></div>
<h3>Write data to Zoho CRM using OAuth 2.0</h3>
<p>If you like to load data from any source (i.e. SQL Server) to Zoho CRM then you can use <a href="https://www.zoho.com/crm/developer/docs/api/insert-records.html" target="_blank" rel="noopener">Records API (POST)</a>. Use combination of the following Transforms  / Components. Later in this article we have some more examples (Older API) which may give you one more ways to load data into Zoho (Use of Template Transform).</p>
<p>Basically you have to build POST Body using JSON Generator Transform or Template Transform and then use that data in Web API Destination to call POST API request to push data to Zoho.</p>
<div class="su-table su-table-alternate">
<table>
<tbody>
<tr class="su-even">
<td width="36"><img loading="lazy" decoding="async" src="https://i0.wp.com/zappysys.com/images/ssis-powerpack/ssis-rest-api-web-service-task.png?w=32&amp;ssl=1" alt="Custom SSIS Tasks - Call REST API Webservice (GET, POST, DELETE etc)" width="32" height="32" /></td>
<td><u><a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">Web API Destination</a></u></td>
</tr>
<tr>
<td width="36" height="36"><img loading="lazy" decoding="async" class="alignnone" src="https://zappysys.com/images/SSIS-PowerPack/ssis-json-generator-transform.png" alt="JSON Generator Transform" width="32" height="32" /></td>
<td><a href="https://zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/" target="_blank" rel="noopener">JSON Generator Transform</a></td>
</tr>
<tr class="su-even">
<td width="36"><img loading="lazy" decoding="async" class="alignnone" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/json-parser-transform/ssis-json-parser-transform.png" alt="XML Parser Transform" width="32" height="32" /></td>
<td><a href="https://zappysys.com/products/ssis-powerpack/ssis-json-parser-transform/" target="_blank" rel="noopener">JSON Parser Transform</a></td>
</tr>
</tbody>
</table>
</div>
<div id="attachment_8312" style="width: 678px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-json-generator-single-dataset-zoho-write.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8312" class="size-full wp-image-8312" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-json-generator-single-dataset-zoho-write.png" alt="Create JSON for POST request (Single dataset pattern)" width="668" height="730" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-json-generator-single-dataset-zoho-write.png 668w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-json-generator-single-dataset-zoho-write-275x300.png 275w" sizes="(max-width: 668px) 100vw, 668px" /></a><p id="caption-attachment-8312" class="wp-caption-text">Create JSON for POST request (Single dataset pattern)</p></div>
<p>&nbsp;</p>
<div id="attachment_8313" style="width: 757px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-write-data-bulk-insert-leads-accounts.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8313" class="size-full wp-image-8313" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-write-data-bulk-insert-leads-accounts.png" alt="Insert data to Zoho Table using SSIS (Lead, Account Modules) - Bulk Load using POST API call" width="747" height="630" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-write-data-bulk-insert-leads-accounts.png 747w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-write-data-bulk-insert-leads-accounts-300x253.png 300w" sizes="(max-width: 747px) 100vw, 747px" /></a><p id="caption-attachment-8313" class="wp-caption-text">Insert data to Zoho Table using SSIS (Lead, Account Modules) &#8211; Bulk Load using POST API call</p></div>
<h2>Authentication Using Zoho Tokens</h2>
<p>If you don&#8217;t want to use a <a href="https://www.zoho.com/crm/help/api/v2/" target="_blank" rel="noopener">newer version of Zoho API</a> (v2) then you can use Token based Authentication method.</p>
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff8b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">Token based method will be depreciated soon so avoid it if possible. Use OAuth 2.0 described in the previous section whenever possible. </div></div>
<p>In Zoho Portal perform following steps to obtain API token</p>
<ol>
<li>Click on Setup (Toolbox icon at the top-right corner)</li>
<li>Search for &#8220;API&#8221; &gt; Select CRM API  or find under <strong>Developer space</strong> &gt; <strong>APIs</strong></li>
<li>Click on <strong>Gear icon</strong> found above Usage Panel (small icon so find carefully)</li>
<li>Click on <strong>Authentication Token generation</strong></li>
<li>Specify the APP Name and <strong>Click Generate</strong></li>
<li>This will direct to the new page which may contain text like below. Just copy AUTHTOKEN part (i.e. <strong>8a08xxxxxxxxxx13630d</strong> )<br />
<pre class="crayon-plain-tag">#
#Mon May 15 12:21:42 PDT 2017
AUTHTOKEN=8a083f76xxxxxxxxxxxxxxxxxxxdxxxxxxxx13630d
RESULT=TRUE</pre>
</li>
<li>Now use the newly created auth token to your API call.</li>
</ol>
<div id="attachment_2642" style="width: 1091px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/how-to-get-zoho-crm-api-token.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2642" class="size-full wp-image-2642" src="https://zappysys.com/blog/wp-content/uploads/2018/02/how-to-get-zoho-crm-api-token.png" alt="How to get Zoho CRM API Token(For SSIS or other app integration)" width="1081" height="576" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/how-to-get-zoho-crm-api-token.png 1081w, https://zappysys.com/blog/wp-content/uploads/2018/02/how-to-get-zoho-crm-api-token-300x160.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/how-to-get-zoho-crm-api-token-768x409.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/02/how-to-get-zoho-crm-api-token-1024x546.png 1024w" sizes="(max-width: 1081px) 100vw, 1081px" /></a><p id="caption-attachment-2642" class="wp-caption-text">How to get Zoho CRM API Token (For SSIS or other app integration)</p></div>
<p>&nbsp;</p>
<h3>Read data from Zoho using SSIS (Export Zoho CRM data to SQL Server Table)</h3>
<p>Now lets look at step by step example of reading Zoho CRM data using SSIS (e.g. read Leads, Accounts, Contacts, Invoice etc). Zoho provides JSON API for read action so we will Use <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">SSIS JSON Source</a> for this purpose. Full sample package is attached at the end of this article but see below steps for high level configuration.</p>
<p>So below steps shows example of reading Zoho Lead modules using <a href="https://www.zoho.com/crm/help/api/getrecords.html" target="_blank" rel="noopener">getRecords API Call</a>.</p>
<ol>
<li>Goto SSIS &gt; Variable and create a new string variable called token. Enter your Zoho API token as value (see previous section to get API token)</li>
<li>Drag data flow task from Control flow SSIS Toolbox</li>
<li>Go to data flow and drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">ZS JSON Source</a> from SSIS Toolbox</li>
<li>Double click JSON Source to configure as below
<ol>
<li>Enter URL as below. Note that we have use Variable for Token to make URL dynamic.To read from different module change URL (e.g. rather than Leads in URL use Accounts).  <a href="https://www.zoho.com/crm/help/api/modules-fields.html" target="_blank" rel="noopener">Click Here to get full list of Modules and Fields</a><br />
<pre class="crayon-plain-tag">https://crm.zoho.com/crm/private/json/Leads/getRecords?newFormat=1&amp;authtoken={{User::token}}&amp;scope=crmapi&amp;fromIndex=0&amp;toIndex=200</pre>
You can also use lastModifiedTime parameter along leads modified after certain date/time (this time is <strong>Local time</strong> and not the UTC). To extract leads modified after certain date (Create a datetime variable called varExtractDate) and use it as below in the URL. You can use any <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-format-specifiers.htm" target="_blank" rel="noopener">valid format specifiers for date time</a><br />
<pre class="crayon-plain-tag">https://crm.zoho.com/crm/private/json/Leads/getRecords?newFormat=1&amp;authtoken={{User::token}}&amp;scope=crmapi&amp;fromIndex=0&amp;toIndex=200&amp;lastModifiedTime={{User::varExtractDate,yyyy-MM-dd HH:mm:ss}}</pre>
</li>
<li>Click on the Select Filter and select node with Array icon as below. Each Module may have different structure for example for Leads module Filter may look like <strong>$.response.result.Leads.row[*]</strong>
<div id="attachment_2643" style="width: 1028px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-read-zoho-crm-data-using-json-api-source-import-leads.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2643" class="size-full wp-image-2643" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-read-zoho-crm-data-using-json-api-source-import-leads.png" alt="Configure SSIS JSON Source - Read Zoho CRM Leads (getRecords API call with lastModifiedDate Example)" width="1018" height="759" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-read-zoho-crm-data-using-json-api-source-import-leads.png 1018w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-read-zoho-crm-data-using-json-api-source-import-leads-300x224.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-read-zoho-crm-data-using-json-api-source-import-leads-768x573.png 768w" sizes="(max-width: 1018px) 100vw, 1018px" /></a><p id="caption-attachment-2643" class="wp-caption-text">Configure SSIS JSON Source &#8211; Read Zoho CRM Leads (getRecords API call with lastModifiedDate Example)</p></div></li>
<li>Now go to 2D Array Tab and configure like below
<ol>
<li>Select Transform Type to Key/Value Pivot Mode.</li>
<li>Select or type Column Filter as <strong>$.FL[*].val</strong></li>
<li>Select or type Row Value Filter as <strong>$.FL[*].content</strong></li>
</ol>
</li>
<li>Once you configure 2D Array Transform click Preview to see sample data</li>
<li>.<a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-read-zoho-crm-data-pivot-attributes-preview-leads.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2644" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-read-zoho-crm-data-pivot-attributes-preview-leads.png" alt="" width="736" height="460" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-read-zoho-crm-data-pivot-attributes-preview-leads.png 736w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-read-zoho-crm-data-pivot-attributes-preview-leads-300x188.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-read-zoho-crm-data-pivot-attributes-preview-leads-436x272.png 436w" sizes="(max-width: 736px) 100vw, 736px" /></a></li>
<li>Click OK to save JSON Source and attach it to target such as SQL Server Destination like below.</li>
<li>Execute Package to test.
<div id="attachment_2645" style="width: 718px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-to-sql-server-data-table-loading-json-api-source-example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2645" class="size-full wp-image-2645" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-to-sql-server-data-table-loading-json-api-source-example.png" alt="SSIS Example : Loading Zoho CRM data to SQL Server Table (JSON API Source)" width="708" height="343" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-to-sql-server-data-table-loading-json-api-source-example.png 708w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-to-sql-server-data-table-loading-json-api-source-example-300x145.png 300w" sizes="(max-width: 708px) 100vw, 708px" /></a><p id="caption-attachment-2645" class="wp-caption-text">SSIS Example : Loading Zoho CRM data to SQL Server Table (JSON API Source)</p></div></li>
</ol>
</li>
</ol>
<h2>Write data to Zoho using SSIS (Import SQL Server Table to Zoho CRM)</h2>
<p>Now you know how to read data from Zoho CRM using JSON API Source next step is to load data to Zoho CRM. For writing data we will use following three components</p>
<div class="su-table su-table-alternate">
<table>
<tbody>
<tr class="su-even">
<td width="36"><img loading="lazy" decoding="async" src="https://i0.wp.com/zappysys.com/images/ssis-powerpack/ssis-rest-api-web-service-task.png?w=32&amp;ssl=1" alt="Custom SSIS Tasks - Call REST API Webservice (GET, POST, DELETE etc)" width="32" height="32" /></td>
<td><u><a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">Web API Destination</a></u></td>
</tr>
<tr>
<td width="36" height="36"></td>
<td>Template Transform</td>
</tr>
<tr class="su-even">
<td width="36"><img loading="lazy" decoding="async" class="alignnone" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/xml-parser-transform/ssis-xml-parser-transform.png" alt="XML Parser Transform" width="32" height="32" /></td>
<td><a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-parser-transform/" target="_blank" rel="noopener">XML Parser Transform</a></td>
</tr>
</tbody>
</table>
</div>
<p>For this example we will use hard coded data in CSV Source (Sample Leads ) but in real world you will have data coming from some RDBMS such as SQL Server.</p>
<ol>
<li>Drag Data flow Task and double click to go to Data flow designer.</li>
<li>Drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-file-source-flat-file-web-api/" target="_blank" rel="noopener">ZS CSV Source</a> from the SSIS Toolbox. Change Access mode to Direct Value. Enter following sample data for demo.<br />
<pre class="crayon-plain-tag">Company,First Name,Last Name,Email,Lead Status,Lead Source,Phone
Microsoft,TestMaawia,TestBrito,Maawia@outlook.com,Lunk Lead,Web Download,111-111-3333
Microsoft,Testraja,Testvedaiyan,raja@outlook.com,Lunk Lead,Web Download,111-222-3333
Yahoo,TestJayder,Testelnageib,Jayder@outlook.com,Lunk Lead,Web Download,111-333-3333
Yahoo,TestStephen,TestTjebane,Stephen@outlook.com,Lunk Lead,Web Download,111-444-3333
Google,TestHarold,TestBatista,Harold@gmail.com,Lunk Lead,Web Download,111-555-3333
Google,TestVennon,TestMills,Vennon@gmail.com,Lunk Lead,Web Download,111-666-3333
Google,TestMichael,TestTremblay,Michael@gmail.com,Lunk Lead,Web Download,111-777-3333</pre>
</li>
<li>Now drag ZS Template Transform. Connect it with previous step.</li>
<li>Double click Template Transform to configure it with following sample Text (This transform was introduced in v2.6.6. If you dont see it then update your SSIS PowerPack to latest version). Use of XMLENC is optional for Non string columns or Alphanumeric values but if you not sure about column type then just add it anyways.<br />
<pre class="crayon-plain-tag">&lt;Leads&gt;
 &lt;row no="1"&gt;
  &lt;FL val="Lead Status"&gt;&lt;%Lead Status,XMLENC%&gt;&lt;/FL&gt;
  &lt;FL val="Company"&gt;&lt;%Company,XMLENC%&gt;&lt;/FL&gt;
  &lt;FL val="First Name"&gt;&lt;%First Name,XMLENC%&gt;&lt;/FL&gt;
  &lt;FL val="Last Name"&gt;&lt;%Last Name,XMLENC%&gt;&lt;/FL&gt;
  &lt;FL val="Email"&gt;&lt;%Email,XMLENC%&gt;&lt;/FL&gt;
  &lt;FL val="Phone"&gt;&lt;%Phone,XMLENC%&gt;&lt;/FL&gt;
  &lt;FL val="Lead Source"&gt;Web Download&lt;/FL&gt;
 &lt;/row&gt;
&lt;/Leads&gt;</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-api-create-xml-body.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2647" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-api-create-xml-body.png" alt="" width="922" height="762" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-api-create-xml-body.png 922w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-api-create-xml-body-300x248.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-api-create-xml-body-768x635.png 768w" sizes="(max-width: 922px) 100vw, 922px" /></a></li>
<li>Now drag another ZS Template Transform and connect it with previous step.</li>
<li>Double click Template Transform to configure. Enter below text. This is final text we will use as Request Body in the Web API Destination.<br />
<pre class="crayon-plain-tag">xmlData=&lt;%TemplateOutput,URLENC%&gt;</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-api-encode-post-xml-body.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2648" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-api-encode-post-xml-body.png" alt="" width="725" height="711" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-api-encode-post-xml-body.png 725w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-api-encode-post-xml-body-300x294.png 300w" sizes="(max-width: 725px) 100vw, 725px" /></a></li>
<li>Drag Microsoft Derived Column Transform. Connect with previous step and double click it to configure.</li>
<li>Select <strong>Replace &#8216;TemplateOutput&#8217;</strong> action. Type new column name in the first column e.g. <strong>TemplateOutput_Encoded</strong><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-api-derived-column-rename.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2649" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-api-derived-column-rename.png" alt="" width="849" height="386" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-api-derived-column-rename.png 849w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-api-derived-column-rename-300x136.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-api-derived-column-rename-768x349.png 768w" sizes="(max-width: 849px) 100vw, 849px" /></a></li>
<li>Now drag ZS Web API Destination, Connect with previous step and double click to configure as below.
<ol>
<li>Select New HTTP Connection. Enter some valid URL e.g. https://zoho.com  (This will be ignored anyways because we will use Dynamic URL on main UI)</li>
<li>Enter URL as below (see how we again added API token as dynamic variable) . If you inserting to different Module (e.g. Accounts rather than Leads then change accordingly).   <a href="https://www.zoho.com/crm/help/api/modules-fields.html" target="_blank" rel="noopener">Click Here to get full list of Modules and Fields</a><br />
<pre class="crayon-plain-tag">https://crm.zoho.com/crm/private/xml/Leads/insertRecords?newFormat=1&amp;authtoken={{User::token}}&amp;scope=crmapi&amp;duplicateCheck</pre>
</li>
<li>Select Input Body column as <strong>TemplateOutput_Encoded</strong></li>
<li>Enter Sample Body as below if you like to use Test feature else ignore this step. Click Test to see its working. Capture Response XML because you may need in the next step to feed as sample to XML Parser Transform (again optional step).<br />
<pre class="crayon-plain-tag">&lt;Leads&gt;
 &lt;row no="1"&gt;
  &lt;FL val="Lead Status"&gt;Junk Lead&lt;/FL&gt;
  &lt;FL val="Company"&gt;ABCD Inc&lt;/FL&gt;
  &lt;FL val="First Name"&gt;Bob&lt;/FL&gt;
  &lt;FL val="Last Name"&gt;Smith&lt;/FL&gt;
  &lt;FL val="Email"&gt;bob@abc.com&lt;/FL&gt;
  &lt;FL val="Phone"&gt;111-222-3333&lt;/FL&gt;
  &lt;FL val="Lead Source"&gt;Web Download&lt;/FL&gt;
 &lt;/row&gt;
&lt;/Leads&gt;</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-web-api-destination-post.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2650" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-web-api-destination-post.png" alt="" width="833" height="615" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-web-api-destination-post.png 833w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-web-api-destination-post-300x221.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-insert-leads-web-api-destination-post-768x567.png 768w" sizes="(max-width: 833px) 100vw, 833px" /></a></li>
</ol>
</li>
<li>Now once API destination is set we can optionally configure below steps if you want to store status and ID of newly created records. If you don&#8217;t care for that then skip below steps.</li>
<li>Drag ZS XML Parser Transform, Connect it Web API Destination (Response Output &#8211; Blue Arrow). Double click XML Parser to configure as below
<ol>
<li>Select Input XMl Column as <strong>ResponseText</strong></li>
<li>Enter Sample Text as below<br />
<pre class="crayon-plain-tag">&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
&lt;response uri="/crm/private/xml/Leads/insertRecords"&gt;
	&lt;result&gt;
		&lt;message&gt;Record(s) added successfully&lt;/message&gt;
		&lt;recorddetail&gt;
			&lt;FL val="Id"&gt;1558554000015597002&lt;/FL&gt;
			&lt;FL val="Created Time"&gt;2018-02-13 16:14:10&lt;/FL&gt;
			&lt;FL val="Modified Time"&gt;2018-02-13 16:14:10&lt;/FL&gt;
			&lt;FL val="Created By"&gt;
				&lt;![CDATA[ZappySys Support]]&gt;
			&lt;/FL&gt;
			&lt;FL val="Modified By"&gt;
				&lt;![CDATA[ZappySys Support]]&gt;
			&lt;/FL&gt;
		&lt;/recorddetail&gt;
	&lt;/result&gt;
&lt;/response&gt;</pre>
&nbsp;</li>
<li>Enter Filter as below<br />
<pre class="crayon-plain-tag">$.response.result.recorddetail[*]</pre>
</li>
<li><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-parse-response-insert-leads-web-api-destination-extract-id.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2651" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-parse-response-insert-leads-web-api-destination-extract-id.png" alt="" width="1042" height="534" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-parse-response-insert-leads-web-api-destination-extract-id.png 1042w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-parse-response-insert-leads-web-api-destination-extract-id-300x154.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-parse-response-insert-leads-web-api-destination-extract-id-768x394.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-parse-response-insert-leads-web-api-destination-extract-id-1024x525.png 1024w" sizes="(max-width: 1042px) 100vw, 1042px" /></a></li>
<li>Now Go to 2D Array Transform Tab. Configure as below</li>
<li>Select Transform Mode to <strong>Key/Value</strong></li>
<li>Column name filter as  <pre class="crayon-plain-tag">$.FL[:3].@val</pre></li>
<li>Row value filter as  <pre class="crayon-plain-tag">$.FL[:3].#text</pre><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-parse-xml-api-response-extract-record-id.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2652" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-parse-xml-api-response-extract-record-id.png" alt="" width="898" height="261" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-parse-xml-api-response-extract-record-id.png 898w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-parse-xml-api-response-extract-record-id-300x87.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-crm-parse-xml-api-response-extract-record-id-768x223.png 768w" sizes="(max-width: 898px) 100vw, 898px" /></a></li>
<li>Now click OK to close.</li>
</ol>
</li>
<li>Drag ZS Trash Destination or some other destination (e.g. SQL Server) and connect Red arrow coming from Web API destination to this component to capture any errors.</li>
<li>Thats it now you ready to run your SSIS sample package which Inserts Leads to Zoho CRM. See below for full package.</li>
</ol>
<div id="attachment_2653" style="width: 808px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-api-call-insert-records-leads.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2653" class="size-full wp-image-2653" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-api-call-insert-records-leads.png" alt="SSIS Example: Import data to Zoho CRM using SSIS Web API Destination (Loading Leads, Accounts, Contacts)" width="798" height="772" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-api-call-insert-records-leads.png 798w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-api-call-insert-records-leads-300x290.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-zoho-api-call-insert-records-leads-768x743.png 768w" sizes="(max-width: 798px) 100vw, 798px" /></a><p id="caption-attachment-2653" class="wp-caption-text">SSIS Example: Import data to Zoho CRM using SSIS Web API Destination (Loading Leads, Accounts, Contacts)</p></div>
<div class="content_block" id="custom_post_widget-1887"><h3>Truncation related error</h3>
<p style="text-align: justify;">The most common error you may face when you run an 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 on how to fix common metadata related errors read an article "<a href="//zappysys.com/blog/handling-ssis-component-metadata-issues/" target="_blank" rel="noopener">How to handle SSIS errors (truncation, metadata issues)</a>".</p>

<h3>Authentication related error</h3>
Another frequent error you may get is an authentication error, which happens when you deploy/copy a package to another machine and run it there. Check <a href="#Deployment_to_Production">the paragraph below</a> to see why it happens and how to solve this problem.</div>
<div class="content_block" id="custom_post_widget-2021"><h2>Things have gone bad: Error handling &amp; debugging</h2>
<p style="text-align: justify;">Incidentally, bad things can happen<i>. </i>A remote server may go offline or your server may go out of memory. In any case, you may want to know when that happens and take actions accordingly. For that purpose, you have to redirect bad rows to some other destination. For this example, we will take and use <em>Web API Destination</em>, but basically, you can use any SSIS component:</p>

<h3>Handling errors</h3>
<ol style="margin-left: 0;">
 	<li>Add a <em>Derived Column</em> above <em>Web API Destination</em> with expression <strong>"(DT_WSTR,4000)ZS_JSON_OUT"</strong> and name it <strong>"JsonAsString"</strong>. This will let you see what JSON you are actually passing.</li>
 	<li>Then add a database or file destination or use another <em>Trash Destination</em> for debugging purposes and redirect the bad rows (<span style="color: #d66565;">red arrow</span>) from <em><em>Web API Destination </em></em>into it<em><em>. </em></em>Don't forget to set <span class="lang:default decode:true crayon-inline">Redirect row</span> option for both, <em>Error</em> and <em>Truncation</em> columns:<em><em>
</em></em>
<div class="wp-caption">

<a href="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-1487 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows.png" alt="Redirect bad rows from &lt;em&gt;Web API Destination&lt;/em&gt; to &lt;em&gt;Trash Destination&lt;/em&gt; when load from SQL Server to Elasticsearch is failing. Add derived column JsonAsString to be able to read JSON you are using." width="739" height="267" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows.png 739w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows-300x108.png 300w" sizes="(max-width: 739px) 100vw, 739px" /></a>
<p class="wp-caption-text">Redirected failed requests from <em>Web API Destination</em> to a desired destination when loading from SQL Server to REST API Service is failing. Derived Column <em>JsonAsString</em> added to be able to read JSON which was passed to Elasticsearch</p>

</div></li>
 	<li>Finally, add a <a href="https://technet.microsoft.com/en-us/library/ms140318%28v=sql.90%29.aspx?f=255&amp;MSPPError=-2147217396" target="_blank" rel="noopener"><em>Data Viewer</em></a> for the red path, if you want to debug the flow. You will be able to see URL, JSON and the error message for each record. You may want to copy-paste <em>ErrorMessage</em> to <em>Notepad </em>if you want it to be more readable:
<div class="wp-caption">

<a href="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-1494 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling.png" alt="Use Data Viewer to view HTTP requests that failed to be fulfilled in Elasticsearch" width="752" height="280" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling.png 752w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-300x112.png 300w" sizes="(max-width: 752px) 100vw, 752px" /></a>
<p class="wp-caption-text">Use Data Viewer to view HTTP requests that failed to be fulfilled.</p>

</div></li>
</ol>
<div class="su-note" style="border-color: #e5dea5; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;">
<div class="su-note-inner su-clearfix" style="background-color: #fff7b7; border-color: #fffdf1; color: #333333; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;"><strong>NOTE</strong>: You can read more about redirecting rows in <a href="//zappysys.com/blog/ssis-error-handling-in-data-flow-redirect-bad-rows/" target="_blank" rel="noopener">SSIS Error Handling (Redirect bad rows)</a> article.</div>
</div>
<h3>Debugging HTTP requests</h3>
<p style="text-align: justify;">A common thing you have to do when working with HTTP requests is to debug those requests; e.g. to check what headers, body or URL was passed. <span id="Debug_Web_API_call_using_Fiddler"></span>To test how things look behind the scenes we strongly suggest to use <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">Fiddler</a> - a popular web debugging tool.</p>
<p style="text-align: justify;">Inside it, you can double-click the URL entry (Right side) to see Request and Response Panels. The top panel is Request (URL, Headers, Body) and Bottom Panel is Response. For https:// (secure URL) make sure you enable HTTPS option in Fiddler (Tools &gt; Options &gt; HTTPS &gt; Check Decrypt https request):</p>

<div id="attachment_2344" class="wp-caption alignnone">

<a href="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?ssl=1" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-2344 size-full" style="border: 0px; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.176) 0px 1px 2px;" src="https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png" alt="Debugging Web API call using Fiddler in SSIS" width="1287" height="564" data-attachment-id="2344" data-permalink="https://zappysys.com/blog/pass-authorization-header-redirected-location/ssis-rest-api-call-debug-via-fiddler/#main" data-orig-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=1287%2C564&amp;ssl=1" data-orig-size="1287,564" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ssis-rest-api-call-debug-via-fiddler" data-image-description="&lt;p&gt;Debugging Web API call using Fiddler in SSIS&lt;/p&gt; " data-medium-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=300%2C131&amp;ssl=1" data-large-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=720%2C316&amp;ssl=1" srcset="https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png 1287w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler-300x131.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler-768x337.png 768w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler-1024x449.png 1024w" sizes="(max-width: 1287px) 100vw, 1287px" /></a>
<p class="wp-caption-text">Debugging Web API call using Fiddler in SSIS</p>

</div></div>
<h2>Sample SSIS Package Download</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/SSIS-ZohoCRM-ReadWrite.zip">Click here to download sample package (SSIS 2012 or Higher).</a></p>
<h2>Conclusion</h2>
<p>Zoho CRM API provides great way to automate data read/write operations. However to call Zoho API  you have to use SDK / coding approach (e.g. C#, Java, Python, Ruby). Luckily ZappySys <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> provides great way to integrate any Zoho API call via simple drag and drop approach without coding. Try  <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> for free and call virtually any REST API in few clicks.</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/read-write-zoho-crm-data-using-ssis-rest-api-call/">Read / Write Zoho CRM data using SSIS REST API Call</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Read / Write Smartsheet data using SSIS REST API Call</title>
		<link>https://zappysys.com/blog/read-write-smartsheet-data-using-ssis-rest-api-call/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 07 Feb 2018 23:27:38 +0000</pubDate>
				<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS REST API Task]]></category>
		<category><![CDATA[SSIS Template Transform]]></category>
		<category><![CDATA[SSIS WEB API Destination]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[smartsheet]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=2588</guid>

					<description><![CDATA[<p>Introduction In this post you will learn how to Read / write Smartsheet data using SSIS (Drag and drop approach without any coding).  We will use SSIS JSON/ REST API Source to extract data from Smartsheet API and use SSIS Web API Destination to write data to Smartsheet. This approach is similar to our previous [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-write-smartsheet-data-using-ssis-rest-api-call/">Read / Write Smartsheet data using SSIS REST API Call</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/smartsheet-api-integration-logo.png"><img loading="lazy" decoding="async" class="wp-image-2606 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/02/smartsheet-api-integration-logo.png" alt="Smartsheet REST API Integration" width="126" height="126" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/smartsheet-api-integration-logo.png 280w, https://zappysys.com/blog/wp-content/uploads/2018/02/smartsheet-api-integration-logo-150x150.png 150w" sizes="(max-width: 126px) 100vw, 126px" /></a>In this post you will learn how to Read / write Smartsheet data using SSIS (Drag and drop approach without any coding).  We will use <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">SSIS JSON/ REST API Source</a> to extract data from Smartsheet API and use <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">SSIS Web API Destination</a> to write data to Smartsheet. This approach is similar to our previous blog where we described <a href="https://zappysys.com/blog/get-data-google-spreadsheet-using-ssis/" target="_blank" rel="noopener">how to read and write Google sheet using SSIS</a></p>
<p>Now let&#8217;s look at step by step approach to call Smartsheet REST API.</p>
<p>&nbsp;</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
<p>Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:</p>
<ol style="margin-left: 1.5em;">
<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven&#8217;t already).</li>
<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol>
</div>
<h2>Create Token to access Smartsheet REST API</h2>
<p>First step to access smartsheet API in SSIS is create API Token. We will use this API token later on to read data from Smartsheet Sheet.</p>
<ol>
<li>Login to your Smartsheet account</li>
<li>Click on Account &gt; Apps &amp; Integrations &gt; Click API Access &gt; Click Generate Token
<div id="attachment_2599" style="width: 315px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/smartsheet-create-api-access-token.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2599" class="size-full wp-image-2599" src="https://zappysys.com/blog/wp-content/uploads/2018/02/smartsheet-create-api-access-token.png" alt="Create Smartsheet API Token for REST API Access" width="305" height="257" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/smartsheet-create-api-access-token.png 305w, https://zappysys.com/blog/wp-content/uploads/2018/02/smartsheet-create-api-access-token-300x253.png 300w" sizes="(max-width: 305px) 100vw, 305px" /></a><p id="caption-attachment-2599" class="wp-caption-text">Create Smartsheet API Token for REST API Access (Step 1)</p></div>
<div id="attachment_2600" style="width: 604px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/smartsheet-rest-api-access-create-new-access-token-step-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2600" class="size-full wp-image-2600" src="https://zappysys.com/blog/wp-content/uploads/2018/02/smartsheet-rest-api-access-create-new-access-token-step-2.png" alt="Generate new Smartsheet token (Step 2)" width="594" height="354" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/smartsheet-rest-api-access-create-new-access-token-step-2.png 594w, https://zappysys.com/blog/wp-content/uploads/2018/02/smartsheet-rest-api-access-create-new-access-token-step-2-300x179.png 300w" sizes="(max-width: 594px) 100vw, 594px" /></a><p id="caption-attachment-2600" class="wp-caption-text">Generate new Smartsheet token (Step 2)</p></div></li>
<li>Once Token is generated copy that for later use (Make sure you treat this token as password and do not share with unauthorized user.</li>
</ol>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>Getting started with Smartsheet API</h2>
<p>In this article we will use few out of many API provided by Smartsheet. To get started with Smartsheet API concepts <a href="https://www.smartsheet.com/blog/api-getting-started" target="_blank" rel="noopener">click here</a>. To read full details about each Smartsheet API <a href="https://smartsheet-platform.github.io/api-docs/" target="_blank" rel="noopener">click here</a>.</p>
<h2>Step-By-Step &#8211; Import/Export Smartsheet data in SSIS</h2>
<p>Now lets see how to read and write smartsheet data using SSIS.</p>
<h3>Read data from Smartsheet using SSIS JSON / REST API Source (Load Smartsheet to SQL Server)</h3>
<p>To read data from smartsheet you need to perform following steps.</p>
<p><strong>Find Sheet ID for Smartsheet API access</strong></p>
<ol>
<li>First you need to know how to find Sheet ID. Perform below steps to find Sheet ID.</li>
<li>Goto your portal and open sheet you like to read. Right click on the Sheet Tab &gt; Click Properties and Copy Sheet ID
<div id="attachment_2601" style="width: 377px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/how-to-find-smartsheet-id-for-rest-api-call.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2601" class="size-full wp-image-2601" src="https://zappysys.com/blog/wp-content/uploads/2018/02/how-to-find-smartsheet-id-for-rest-api-call.png" alt="Find Sheet ID for Smartsheet API call" width="367" height="127" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/how-to-find-smartsheet-id-for-rest-api-call.png 367w, https://zappysys.com/blog/wp-content/uploads/2018/02/how-to-find-smartsheet-id-for-rest-api-call-300x104.png 300w" sizes="(max-width: 367px) 100vw, 367px" /></a><p id="caption-attachment-2601" class="wp-caption-text">Find Sheet ID for Smartsheet API call</p></div></li>
</ol>
<p>Once you know Sheet ID. Now lets create SSIS package to extract data from Smartsheet and load into SQL Server.</p>
<ol>
<li>Create new SSIS Package or Open existing one.</li>
<li>From control flow SSIS toolbox drag Data Flow task</li>
<li>Double click Data flow</li>
<li>From SSIS Toolbox drag and drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">ZS JSON Source (for REST API / File)</a></li>
<li>Double click JSON Source and configure following properties
<ol>
<li>Enter Shartsheet API Access URL as below (Change last part with your own sheet id)<br />
<pre class="crayon-plain-tag">https://api.smartsheet.com/2.0/sheets/YOUR-SHEET-ID-GOES-HERE</pre>
</li>
<li>Check use credentials and then create a new HTTP connection. Select Static Token / API Key and enter enter your token we got in previous section<br />
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2022/09/smartsheetconnection.png" /></li>
<li>Click on Select Filter and pick Rows node or just type below text in the Filter textbox<br />
<pre class="crayon-plain-tag">$.rows[*]</pre>
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2022/09/smartsheetconnection-1.png" /></li>
<li>Now goto 2D Array Transformation Tab and set following settings
<ol>
<li>Set Transformation Type to <strong>Complex 2-dimensional array</strong></li>
<li>Column Name Filter to <strong>$.columns[*].title</strong></li>
<li>Row Value Filter to <strong>$.cells[*].value<br />
</strong></p>
<div id="attachment_2605" style="width: 700px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-read-smartsheet-data-configure-array-transform-json-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2605" class="size-full wp-image-2605" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-read-smartsheet-data-configure-array-transform-json-source.png" alt="SSIS Smartsheet API Configuration - Complex Array transformation (Read nested array)" width="690" height="263" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-read-smartsheet-data-configure-array-transform-json-source.png 690w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-read-smartsheet-data-configure-array-transform-json-source-300x114.png 300w" sizes="(max-width: 690px) 100vw, 690px" /></a><p id="caption-attachment-2605" class="wp-caption-text">SSIS Smartsheet API Configuration &#8211; Complex Array transformation (Read nested array)</p></div></li>
</ol>
</li>
<li>Once everything is configured Click Preview. Click OK to save.</li>
<li>Drag OLEDB Destination from SSIS Toolbox.</li>
<li>Connect JSON SOurce to OLEDB Destination</li>
<li>Double click OLEDB Destination and configure connection (e.g. Select SQL Server connection) and select Target Table or click New to Create new Table based on Source columns.</li>
<li>Click on Mappings to map source columns to target</li>
<li>Click OK to save</li>
<li>Execute Package
<div id="attachment_2604" style="width: 880px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-loading-smartsheet-to-sql-server-read-json-rest-api-example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2604" class="size-full wp-image-2604" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-loading-smartsheet-to-sql-server-read-json-rest-api-example.png" alt="SSIS Example : Loading Smartsheet data into SQL Server (REST API Call)" width="870" height="543" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-loading-smartsheet-to-sql-server-read-json-rest-api-example.png 870w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-loading-smartsheet-to-sql-server-read-json-rest-api-example-300x187.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-loading-smartsheet-to-sql-server-read-json-rest-api-example-768x479.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-loading-smartsheet-to-sql-server-read-json-rest-api-example-436x272.png 436w" sizes="(max-width: 870px) 100vw, 870px" /></a><p id="caption-attachment-2604" class="wp-caption-text">SSIS Example : Loading Smartsheet data into SQL Server (REST API Call)</p></div></li>
</ol>
</li>
</ol>
<p>&nbsp;</p>
<h3>Read Smartsheet data with Pagination option</h3>
<p>Smartsheet API support options to read large amount of data in small chunks by using <a href="https://smartsheet-platform.github.io/api-docs/#paging" target="_blank" rel="noopener">pagination options</a>. ZappySys offers <a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/" target="_blank" rel="noopener">many ways to paginate</a> for various API.</p>
<h4>Disable Smartsheet Pagination</h4>
<p>Many API endpoints in Smartsheet by default send you paginated response. Pagination requires some extra configuration so try to disable it if possible by using <strong>includeAll=true</strong> option in your URL as below. If you cannot includeAll for some reason then perform steps listed in next section.</p><pre class="crayon-plain-tag">https://api.smartsheet.com/2.0/sheets?includeAll=true</pre><p>
<h4>Smartsheet Pagination in SSIS</h4>
<p>To paginate Smartsheet response in SSIS JSON Source perform the following steps. Below steps assume that you trying to get all sheets by calling <pre class="crayon-plain-tag">https://api.smartsheet.com/2.0/sheets</pre>  URL in JSON Source (Just like we explained in previous section). Before dataflow we have to add one step to enable pagination. Lets check.</p>
<ol>
<li>Go to Control Flow designer right click &gt; Select Variables</li>
<li>Create new <strong>string datatype</strong> variable called name it <strong>TotalPages</strong>. Set <strong>default value to 0</strong></li>
<li>Now drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">ZS REST API Task</a> from SSIS Toolbox</li>
<li>Enter Following URL (we don&#8217;t need many rows to so reduced default page size to just 10)<br />
<pre class="crayon-plain-tag">https://api.smartsheet.com/2.0/sheets?pageSize=10</pre>
</li>
<li>Now click on Raw Edit (Above Headers grid)</li>
<li>Enter following header (Replace Token with your own token we obtained in the previous section)<br />
<pre class="crayon-plain-tag">Authorization: Bearer YOUR-TOKEN-GOES-HERE</pre>
</li>
<li>Go to Response Settings Tab</li>
<li>Select Content Type Json and enter filter as <strong>$.totalPages</strong></li>
<li>Check Save response to Variable. Select Variable we created in Previous step (Only string datatype variables are visible)
<div id="attachment_2610" style="width: 932px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-save-rest-api-response-json-value-to-variable.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2610" class="size-full wp-image-2610" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-save-rest-api-response-json-value-to-variable.png" alt="Save Total Page Count to SSIS variable" width="922" height="293" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-save-rest-api-response-json-value-to-variable.png 922w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-save-rest-api-response-json-value-to-variable-300x95.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-save-rest-api-response-json-value-to-variable-768x244.png 768w" sizes="(max-width: 922px) 100vw, 922px" /></a><p id="caption-attachment-2610" class="wp-caption-text">Save Total Page Count to SSIS variable</p></div></li>
<li>Click Test Request/Response to confirm it works</li>
<li>Click OK to save</li>
<li>Now let&#8217;s use this variable to configure <strong>MaxPageNumber</strong> setting in JSON Source. Using following way you can make any Data flow component property dynamic.
<div id="attachment_2609" style="width: 1069px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-expression-on-data-flow-component.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2609" class="size-full wp-image-2609" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-expression-on-data-flow-component.png" alt="Define expression on SSIS Data flow Component Property (Dynamic Value)" width="1059" height="732" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-expression-on-data-flow-component.png 1059w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-expression-on-data-flow-component-300x207.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-expression-on-data-flow-component-768x531.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-expression-on-data-flow-component-1024x708.png 1024w" sizes="(max-width: 1059px) 100vw, 1059px" /></a><p id="caption-attachment-2609" class="wp-caption-text">Define expression on SSIS Data flow Component Property (Dynamic Value)</p></div></li>
<li>Now connect your REST API Task to Data flow</li>
<li>On the JSON Source go to Pagination Tab and enter following settings.
<div id="attachment_2611" style="width: 675px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-smartsheet-api-pagination-json-rest-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2611" class="size-full wp-image-2611" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-smartsheet-api-pagination-json-rest-source.png" alt="Smartsheet API Pagination settings - SSIS JSON / REST Source" width="665" height="275" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-smartsheet-api-pagination-json-rest-source.png 665w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-smartsheet-api-pagination-json-rest-source-300x124.png 300w" sizes="(max-width: 665px) 100vw, 665px" /></a><p id="caption-attachment-2611" class="wp-caption-text">Smartsheet API Pagination settings &#8211; SSIS JSON / REST Source</p></div></li>
<li>That&#8217;s it. Now if you run it you will see all records will be pulled.</li>
</ol>
<div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF7B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">You can configure delay after each request [on Throttling Tab] if you want to slow down requests. This is usually helpful if you are getting too many API requests error at runtime.</div></div>
<h3>Write data to Smartsheet using SSIS Web API Destination (SQL Server to Smartsheet Import)</h3>
<p>Now lets see how to write some data to Smartsheet Sheet. We will read records from SQL Server and write to SmartSheet using ZS Web API Destination</p>
<p>For inserting multiple rows we can call <a href="https://smartsheet-platform.github.io/api-docs/#add-rows" target="_blank" rel="noopener">this Smartsheet API Endpoint</a></p>
<p>Basically High level steps are.</p>
<ol>
<li>Find out Smartsheet Column ID to use along with API call</li>
<li>Read Records from SQL Server using OLEDB Source</li>
<li>Construct desired JSON for Add New Row API Call</li>
<li>Send JSON to <a href="https://smartsheet-platform.github.io/api-docs/#add-rows" target="_blank" rel="noopener">Smartsheet Add Row API</a>  (Configure Bulk Options )</li>
</ol>
<h4>Find out Smartsheet Column ID</h4>
<p>Very first step you have to perform is get Column ID which correspond to certain title. You can use following URL endpoint to get list of all columns (Change your Sheet ID). Make sure you append <strong>includeAll=true</strong> else it may only fetch 100 columns. You can save Column result to some database table to File to copy ID. Preview Grid also allows to copy cell.</p><pre class="crayon-plain-tag">https://api.smartsheet.com/2.0/sheets/YOUR-SHEET-ID/columns?includeAll=true</pre><p>
<div id="attachment_2613" style="width: 770px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-get-smartsheet-column-id-api-call-json-rest-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2613" class="size-full wp-image-2613" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-get-smartsheet-column-id-api-call-json-rest-source.png" alt="Get Smartsheet Column ID using API call in SSIS JSON Source" width="760" height="734" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-get-smartsheet-column-id-api-call-json-rest-source.png 760w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-get-smartsheet-column-id-api-call-json-rest-source-300x290.png 300w" sizes="(max-width: 760px) 100vw, 760px" /></a><p id="caption-attachment-2613" class="wp-caption-text">Get Smartsheet Column ID using API call in SSIS JSON Source</p></div>
<h4>Configure SQL Server Source (OLEDB Source)</h4>
<p>Once you have column ID you can drag OLEDB Source from SSIS Toolbox and configure to read from SQL Server. Below is sample source query to extract data from SQL Server.</p><pre class="crayon-plain-tag">Select OrderID,CustomerID,EmployeeID,OrderDate from Orders</pre><p>
<h4>Configure SSIS Template Transform</h4>
<p>Once SQL Source is configure we are ready for next step. SSIS PowerPack v2.6.4 and later introduced new SSIS transform called <strong>Template Transform</strong>. This transform allows you to produce desired JSON /XML from single input record by using Column name as placeholder anywhere in your text. This is much simpler method than constructing JSON using JSON Generator Transform</p>
<p>Here is the sample JSON we want to produce to insert into Sheet which contains 4 columns OrderID, CustomerID, EmployeeID and OrderDate.</p><pre class="crayon-plain-tag">{
  "toTop": true,
  "cells": [
    {
      "columnId": 8146714579232644,
      "value": 10548
    },
    {
      "columnId": 828365184755588,
      "value": "TOMSP"
    },
    {
      "columnId": 5331964812126084,
      "value": 3
    },
    {
      "columnId": 3080164998440836,
      "value": "1997-05-26T00:00:00"
    }
  ]
}</pre><p>
&nbsp;</p>
<p>Now lets configure SSIS Template Transform to create desired JSON Request for API call.</p>
<ol>
<li>Drag ZS Template Transform from the SSIS toolbox</li>
<li>Connect OLEDB Source to ZS Template Transform</li>
<li>Double click Template Transform. Paste above sample request in the Template Text</li>
<li>Now highlight sample value you wish to replace from upstream by some input column.</li>
<li>Click on <strong>Insert Placeholders</strong> &gt; <strong>Columns</strong> &gt;  Your Column</li>
<li>Perform above steps for each value you wish to replace. You can also add <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-format-specifiers.htm" target="_blank" rel="noopener">use placeholder functions</a> such as <strong>JSONENC</strong> after column name (useful if you expecting new line or special characters such as tab or double quotes in your input text ). Date formatting (e.g. <strong>yyyy-MM-dd </strong>) also allowed. See below example after placeholders added.<br />
<pre class="crayon-plain-tag">{
  "toTop": true,
  "cells": [
    {
      "columnId": 8146714579232644,
      "value": &lt;%OrderID%&gt;
    },
    {
      "columnId": 828365184755588,
      "value": "&lt;%CustomerID,JSONENC%&gt;"
    },
    {
      "columnId": 5331964812126084,
      "value": &lt;%EmployeeID%&gt;
    },
    {
      "columnId": 3080164998440836,
      "value": "&lt;%OrderDate,yyyy-MM-ddTHH:mm:ss%&gt;"
    }
  ]
}</pre>
</li>
<li>Here is final configuration of Template Transform
<div id="attachment_2614" style="width: 983px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-template-transform-create-json-xml-for-api-call.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2614" class="size-full wp-image-2614" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-template-transform-create-json-xml-for-api-call.png" alt="Create JSON for API Request (POST) using SSIS Template Transform" width="973" height="611" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-template-transform-create-json-xml-for-api-call.png 973w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-template-transform-create-json-xml-for-api-call-300x188.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-template-transform-create-json-xml-for-api-call-768x482.png 768w" sizes="(max-width: 973px) 100vw, 973px" /></a><p id="caption-attachment-2614" class="wp-caption-text">Create JSON for API Request (POST) using SSIS Template Transform</p></div></li>
</ol>
<h4>Configure SSIS Web API Destination (POST New Rows to Smartsheet)</h4>
<p>Now lets configure last step. This will POST API request to insert multiple rows to Smartsheet. Previous template transform crafts request for one new row but later in this section we will enable Batch mode so we can JOIN multiple JSON and created Bulk requests in one go so we avoid many API call. Always use Bulk mode if API endpoint supports it.</p>
<ol>
<li>Drag and drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">ZS Web API destination</a> from SSIS Toolbox</li>
<li>Connect previous Template Transform to your Web API Destination.</li>
<li>Select new HTTP connection. When Prompted enter following URL on HTTP Connection UI (Replace your Sheet ID)<br />
<pre class="crayon-plain-tag">https://api.smartsheet.com/2.0/sheets/YOUR-SHEET-ID/rows</pre>
</li>
<li>In the input column for Body select <strong>TemplateOutput</strong></li>
<li>For Body you can enter Sample Body if you wish to Test at design time else leave it blank</li>
<li>Select Body Content Type as <strong>application/json</strong></li>
<li>In the Headers enter Authorization Header like we did in previous section (Read from Smartsheet)<br />
<pre class="crayon-plain-tag">Authorization: Bearer YOUR-TOKEN-GOES-HERE</pre>
<div id="attachment_2615" style="width: 823px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-web-api-destination-insert-multiple-rows-smartsheet-rest-api-call.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2615" class="size-full wp-image-2615" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-web-api-destination-insert-multiple-rows-smartsheet-rest-api-call.png" alt="Configure SSIS Web API Destination - Add / Insert Rows to Smartsheet (Bulk API call)" width="813" height="616" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-web-api-destination-insert-multiple-rows-smartsheet-rest-api-call.png 813w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-web-api-destination-insert-multiple-rows-smartsheet-rest-api-call-300x227.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-web-api-destination-insert-multiple-rows-smartsheet-rest-api-call-768x582.png 768w" sizes="(max-width: 813px) 100vw, 813px" /></a><p id="caption-attachment-2615" class="wp-caption-text">Configure SSIS Web API Destination &#8211; Add / Insert Rows to Smartsheet (Bulk API call)</p></div></li>
<li>Go to Batch Setting mode. Change following settings
<ol>
<li>Check on Enable submitting multiple records</li>
<li>For Body Header enter <strong>[</strong></li>
<li>For Body Footer enter  <strong>]</strong></li>
<li>For Body Row separator enter<strong> ,</strong> (i.e comma)</li>
<li>You can change Body Batch Size to desired value (100 is recommended)
<div id="attachment_2616" style="width: 919px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-smartsheet-rest-api-post-bulk-mode-web-api-destination.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2616" class="size-full wp-image-2616" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-smartsheet-rest-api-post-bulk-mode-web-api-destination.png" alt="Configure SSIS Web API Destination for Bulk API call (Smartsheet REST API - Insert multiple rows)" width="909" height="445" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-smartsheet-rest-api-post-bulk-mode-web-api-destination.png 909w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-smartsheet-rest-api-post-bulk-mode-web-api-destination-300x147.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-smartsheet-rest-api-post-bulk-mode-web-api-destination-768x376.png 768w" sizes="(max-width: 909px) 100vw, 909px" /></a><p id="caption-attachment-2616" class="wp-caption-text">Configure SSIS Web API Destination for Bulk API call (Smartsheet REST API &#8211; Insert multiple rows)</p></div></li>
</ol>
</li>
<li>That&#8217;s it run your package to test the entire flow.
<div id="attachment_2617" style="width: 1058px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-loading-sql-server-to-smartsheet-rest-api-example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2617" class="size-full wp-image-2617" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-loading-sql-server-to-smartsheet-rest-api-example.png" alt="Loading data from SQL Server to Smartsheet using SSIS (Web API POST Example - Bulk Mode)" width="1048" height="777" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-loading-sql-server-to-smartsheet-rest-api-example.png 1048w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-loading-sql-server-to-smartsheet-rest-api-example-300x222.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-loading-sql-server-to-smartsheet-rest-api-example-768x569.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-loading-sql-server-to-smartsheet-rest-api-example-1024x759.png 1024w" sizes="(max-width: 1048px) 100vw, 1048px" /></a><p id="caption-attachment-2617" class="wp-caption-text">Loading data from SQL Server to Smartsheet using SSIS (Web API POST Example &#8211; Bulk Mode)</p></div></li>
</ol>
<p>&nbsp;</p>
<div class="content_block" id="custom_post_widget-1887"><h3>Truncation related error</h3>
<p style="text-align: justify;">The most common error you may face when you run an 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 on how to fix common metadata related errors read an article &#8220;<a href="//zappysys.com/blog/handling-ssis-component-metadata-issues/" target="_blank" rel="noopener">How to handle SSIS errors (truncation, metadata issues)</a>&#8220;.</p>
<h3>Authentication related error</h3>
<p>Another frequent error you may get is an authentication error, which happens when you deploy/copy a package to another machine and run it there. Check <a href="#Deployment_to_Production">the paragraph below</a> to see why it happens and how to solve this problem.</p>
</div>
<div class="content_block" id="custom_post_widget-2021"><h2>Things have gone bad: Error handling &amp; debugging</h2>
<p style="text-align: justify;">Incidentally, bad things can happen<i>. </i>A remote server may go offline or your server may go out of memory. In any case, you may want to know when that happens and take actions accordingly. For that purpose, you have to redirect bad rows to some other destination. For this example, we will take and use <em>Web API Destination</em>, but basically, you can use any SSIS component:</p>
<h3>Handling errors</h3>
<ol style="margin-left: 0;">
<li>Add a <em>Derived Column</em> above <em>Web API Destination</em> with expression <strong>&#8220;(DT_WSTR,4000)ZS_JSON_OUT&#8221;</strong> and name it <strong>&#8220;JsonAsString&#8221;</strong>. This will let you see what JSON you are actually passing.</li>
<li>Then add a database or file destination or use another <em>Trash Destination</em> for debugging purposes and redirect the bad rows (<span style="color: #d66565;">red arrow</span>) from <em><em>Web API Destination </em></em>into it<em><em>. </em></em>Don&#8217;t forget to set <span class="lang:default decode:true crayon-inline">Redirect row</span> option for both, <em>Error</em> and <em>Truncation</em> columns:<em><em><br />
</em></em></p>
<div class="wp-caption">
<p><a href="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-1487 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows.png" alt="Redirect bad rows from &lt;em&gt;Web API Destination&lt;/em&gt; to &lt;em&gt;Trash Destination&lt;/em&gt; when load from SQL Server to Elasticsearch is failing. Add derived column JsonAsString to be able to read JSON you are using." width="739" height="267" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows.png 739w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows-300x108.png 300w" sizes="(max-width: 739px) 100vw, 739px" /></a></p>
<p class="wp-caption-text">Redirected failed requests from <em>Web API Destination</em> to a desired destination when loading from SQL Server to REST API Service is failing. Derived Column <em>JsonAsString</em> added to be able to read JSON which was passed to Elasticsearch</p>
</div>
</li>
<li>Finally, add a <a href="https://technet.microsoft.com/en-us/library/ms140318%28v=sql.90%29.aspx?f=255&amp;MSPPError=-2147217396" target="_blank" rel="noopener"><em>Data Viewer</em></a> for the red path, if you want to debug the flow. You will be able to see URL, JSON and the error message for each record. You may want to copy-paste <em>ErrorMessage</em> to <em>Notepad </em>if you want it to be more readable:
<div class="wp-caption">
<p><a href="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-1494 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling.png" alt="Use Data Viewer to view HTTP requests that failed to be fulfilled in Elasticsearch" width="752" height="280" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling.png 752w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-300x112.png 300w" sizes="(max-width: 752px) 100vw, 752px" /></a></p>
<p class="wp-caption-text">Use Data Viewer to view HTTP requests that failed to be fulfilled.</p>
</div>
</li>
</ol>
<div class="su-note" style="border-color: #e5dea5; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;">
<div class="su-note-inner su-clearfix" style="background-color: #fff7b7; border-color: #fffdf1; color: #333333; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;"><strong>NOTE</strong>: You can read more about redirecting rows in <a href="//zappysys.com/blog/ssis-error-handling-in-data-flow-redirect-bad-rows/" target="_blank" rel="noopener">SSIS Error Handling (Redirect bad rows)</a> article.</div>
</div>
<h3>Debugging HTTP requests</h3>
<p style="text-align: justify;">A common thing you have to do when working with HTTP requests is to debug those requests; e.g. to check what headers, body or URL was passed. <span id="Debug_Web_API_call_using_Fiddler"></span>To test how things look behind the scenes we strongly suggest to use <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">Fiddler</a> &#8211; a popular web debugging tool.</p>
<p style="text-align: justify;">Inside it, you can double-click the URL entry (Right side) to see Request and Response Panels. The top panel is Request (URL, Headers, Body) and Bottom Panel is Response. For https:// (secure URL) make sure you enable HTTPS option in Fiddler (Tools &gt; Options &gt; HTTPS &gt; Check Decrypt https request):</p>
<div id="attachment_2344" class="wp-caption alignnone">
<p><a href="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?ssl=1" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-2344 size-full" style="border: 0px; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.176) 0px 1px 2px;" src="https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png" alt="Debugging Web API call using Fiddler in SSIS" width="1287" height="564" data-attachment-id="2344" data-permalink="https://zappysys.com/blog/pass-authorization-header-redirected-location/ssis-rest-api-call-debug-via-fiddler/#main" data-orig-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=1287%2C564&amp;ssl=1" data-orig-size="1287,564" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ssis-rest-api-call-debug-via-fiddler" data-image-description="&lt;p&gt;Debugging Web API call using Fiddler in SSIS&lt;/p&gt; " data-medium-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=300%2C131&amp;ssl=1" data-large-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=720%2C316&amp;ssl=1" srcset="https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png 1287w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler-300x131.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler-768x337.png 768w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler-1024x449.png 1024w" sizes="(max-width: 1287px) 100vw, 1287px" /></a></p>
<p class="wp-caption-text">Debugging Web API call using Fiddler in SSIS</p>
</div>
</div>
<h2>Conclusion</h2>
<p>Smartsheet API provides great way to automate data read/write. However to call Smartsheet API  you have to use SDK / coding approach (e.g. C#, Java, Python, Ruby). Luckily ZappySys <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> provides great way to integrate any Smartsheet API call via simple drag and drop approach without coding. Try  <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> for free and call virtually any REST API in few clicks.</p>
<p><strong>Keywords:</strong> Import smartsheet into sql server | export smartsheet to sql server | ssis smartsheet read | ssis smartsheet write | reading smartsheet data using API call | write to smartsheet</p>
<p>The post <a href="https://zappysys.com/blog/read-write-smartsheet-data-using-ssis-rest-api-call/">Read / Write Smartsheet data using SSIS REST API Call</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
