<?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 CSV Source Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/category/ssis/components/ssis-csv-source/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/category/ssis/components/ssis-csv-source/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Wed, 11 Mar 2026 07:08:08 +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 CSV Source Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/category/ssis/components/ssis-csv-source/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to download images from a web page using SSIS</title>
		<link>https://zappysys.com/blog/how-to-download-images-from-a-web-page-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys Team]]></dc:creator>
		<pubDate>Mon, 27 Mar 2023 11:49:52 +0000</pubDate>
				<category><![CDATA[REST API]]></category>
		<category><![CDATA[SSIS CSV Source]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[rest api]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=9918</guid>

					<description><![CDATA[<p>Introduction The article shows how to download images from a web page using SSIS. Sometimes we need to download the images from a web page. In this post, we will show how to do this. Prerequisites Before we perform steps listed in this article, you will need to make sure following prerequisites are met: SSIS [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/how-to-download-images-from-a-web-page-using-ssis/">How to download images from a web page using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><strong>Introduction</strong></h2>
<p>The article shows how to download images from a web page using SSIS. Sometimes we need to download the images from a web page. In this post, we will show how to do this.</p>
<h2><strong>Prerequisites</strong></h2>
<p>Before we perform steps listed in this article, you will need to make sure following prerequisites are met:</p>
<ol>
<li>SSIS designer installed. Sometimes it is referred as BIDS or SSDT (<a href="https://learn.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt?view=sql-server-ver16">download it from Microsoft site</a>).</li>
<li>Basic knowledge of SSIS package development using Microsoft SQL Server Integration Services.</li>
<li>Make sure <a href="https://zappysys.com/products/ssis-powerpack/">ZappySys SSIS PowerPack</a> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/">download it</a>).</li>
<li>Optional (If you want to Deploy and Schedule ) &#8211; <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593">Deploy and Schedule SSIS Packages</a></li>
</ol>
<h2><strong>Steps-by-step process to download images from HTML using SSIS</strong></h2>
<h3>Use REST API task to get the HTML body</h3>
<p>1. Drag and drop the REST API Task from SSIS toolbox, select the html page you want and save it in a variable.</p>
<div id="attachment_9958" style="width: 846px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2023/02/RAT1.png"><img decoding="async" aria-describedby="caption-attachment-9958" class="size-full wp-image-9958" src="https://zappysys.com/blog/wp-content/uploads/2023/02/RAT1.png" alt="" width="836" height="713" srcset="https://zappysys.com/blog/wp-content/uploads/2023/02/RAT1.png 836w, https://zappysys.com/blog/wp-content/uploads/2023/02/RAT1-300x256.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/02/RAT1-768x655.png 768w" sizes="(max-width: 836px) 100vw, 836px" /></a><p id="caption-attachment-9958" class="wp-caption-text">Select the page you want to get the images</p></div>
<p>2. Go to <strong>Response Settings. </strong>Check the option Save the response content. In <strong>Save Mode, </strong>select <strong>Save to File. </strong>In the option <strong>Enter File Path</strong>, write the path for the html file.</p>
<div id="attachment_9959" style="width: 846px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2023/02/RAT2.png"><img decoding="async" aria-describedby="caption-attachment-9959" class="size-full wp-image-9959" src="https://zappysys.com/blog/wp-content/uploads/2023/02/RAT2.png" alt="" width="836" height="713" srcset="https://zappysys.com/blog/wp-content/uploads/2023/02/RAT2.png 836w, https://zappysys.com/blog/wp-content/uploads/2023/02/RAT2-300x256.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/02/RAT2-768x655.png 768w" sizes="(max-width: 836px) 100vw, 836px" /></a><p id="caption-attachment-9959" class="wp-caption-text">Save the page in a file</p></div>
<h3>Parse the image with Regular Expression parser task</h3>
<p>3. From the SSIS toolbox drag and drop Regular Expression Parser Task on the Control flow designer surface.</p>
<p>4. The next step is to save the source path from the images. You need to use Regex and here are two example you can use, in this page <a href="https://regex101.com/">Regex101</a> you can check more details about the expressions we are using:</p>
<p>Expression 1: <pre class="crayon-plain-tag">&lt;img.*?src="(.*?)"{{*}}</pre>
Expression 2: <pre class="crayon-plain-tag">src="([a-z\-_0-9\/\:\.]*\.(png|jpg|jpeg|gif|png))"{{*}}</pre>
<div id="attachment_9960" style="width: 692px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2023/02/Regex1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9960" class="wp-image-9960 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/02/Regex1.png" alt="download images from a web page - Regex configuration" width="682" height="805" srcset="https://zappysys.com/blog/wp-content/uploads/2023/02/Regex1.png 682w, https://zappysys.com/blog/wp-content/uploads/2023/02/Regex1-254x300.png 254w" sizes="(max-width: 682px) 100vw, 682px" /></a><p id="caption-attachment-9960" class="wp-caption-text">Regex expression to get the image code from the page</p></div>
<h3>Read the image source with CSV source in order to download images from a Web page</h3>
<p>5. Now, Drag and Drop SSIS <b>Data Flow Task</b> from SSIS Toolbox.</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/drag-and-drop-data-flow-task.png" width="460" height="155" /></p>
<p>6. Double click on the DataFlow task to see DataFlow designer surface.</p>
<p>7. From the SSIS toolbox drag and drop CSV source and insert the variable you are using from the previous task</p>
<div id="attachment_9961" style="width: 836px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2023/02/csv.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9961" class="wp-image-9961 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/02/csv.png" alt="CSV Source configuration" width="826" height="733" srcset="https://zappysys.com/blog/wp-content/uploads/2023/02/csv.png 826w, https://zappysys.com/blog/wp-content/uploads/2023/02/csv-300x266.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/02/csv-768x682.png 768w" sizes="(max-width: 826px) 100vw, 826px" /></a><p id="caption-attachment-9961" class="wp-caption-text">Use CSV source to read the variable</p></div>
<h3>Get the image name, image full path and the destination folder to download images from a Web Page</h3>
<p>8. From the SSIS toolbox drag and drop Derived Column transform to remove the HTML code and get the image name.</p>
<p>Expression for the Image name:</p><pre class="crayon-plain-tag">(DT_WSTR,1000)REVERSE(LEFT(REVERSE(REPLACE(REPLACE(Column1,"src=\"",""),"\"","")),(FINDSTRING(REVERSE(REPLACE(REPLACE(Column1,"src=\"",""),"\"","")),"/",1) - 1)))</pre><p>
Remove the HTML code:</p><pre class="crayon-plain-tag">REPLACE(REPLACE(Column1,"src=\"",""),"\"","")</pre><p>
<div id="attachment_9962" style="width: 796px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2023/02/derivedColumn1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9962" class="wp-image-9962 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/02/derivedColumn1.png" alt="Image name" width="786" height="635" srcset="https://zappysys.com/blog/wp-content/uploads/2023/02/derivedColumn1.png 786w, https://zappysys.com/blog/wp-content/uploads/2023/02/derivedColumn1-300x242.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/02/derivedColumn1-768x620.png 768w" sizes="(max-width: 786px) 100vw, 786px" /></a><p id="caption-attachment-9962" class="wp-caption-text">Add a new column and remove HTML code</p></div>
<p>9. Now we will drag and drop another Derived Column, this one is for the file path for the images and validate if the image URL is valid. If the image URL has “http” in the stringm then it is valid otherwise you need to add the rest of the URL. Here is our example for the filePath and validate the URL image. If everything is OK, we can send the image URL.</p><pre class="crayon-plain-tag">File path: (DT_WSTR,2500)@[User::vDestinationFolder] + ImageName

Validate image URL: ((FINDSTRING(Column1,"http",1) &gt; 0) ? Column1 : (DT_WSTR,2500)("https://www.urlexample/image/" + Column1))

Note: @[User::vDestinationFolder] is a variable we used for the local path</pre><p>
<div id="attachment_9963" style="width: 796px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2023/02/derivedColumn2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9963" class="wp-image-9963 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/02/derivedColumn2.png" alt="Expression in derived column" width="786" height="635" srcset="https://zappysys.com/blog/wp-content/uploads/2023/02/derivedColumn2.png 786w, https://zappysys.com/blog/wp-content/uploads/2023/02/derivedColumn2-300x242.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/02/derivedColumn2-768x620.png 768w" sizes="(max-width: 786px) 100vw, 786px" /></a><p id="caption-attachment-9963" class="wp-caption-text">Add a new column and verify the HTML path</p></div>
<h3>Send the request and save the image In the folder TO download images from a Web Page</h3>
<p>10. Now we will drag and drop a web API destination and select the column in the input column to URL. If the request is right, we can save the image in the local file.</p>
<div id="attachment_11103" style="width: 728px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/03/wad1.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11103" src="https://zappysys.com/blog/wp-content/uploads/2023/03/wad1.jpg" alt="Web API destination for images URL" width="718" height="771" class="size-full wp-image-11103" srcset="https://zappysys.com/blog/wp-content/uploads/2023/03/wad1.jpg 718w, https://zappysys.com/blog/wp-content/uploads/2023/03/wad1-279x300.jpg 279w" sizes="(max-width: 718px) 100vw, 718px" /></a><p id="caption-attachment-11103" class="wp-caption-text">Send a request for all images you get</p></div>
<p>11. Now drag and drop an Export Column transformation and select the ResponseText from the request and the file path.</p>
<div id="attachment_9967" style="width: 761px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2023/02/exportColumn.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9967" class="wp-image-9967 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/02/exportColumn.png" alt="download images from a web page - Export properties" width="751" height="635" srcset="https://zappysys.com/blog/wp-content/uploads/2023/02/exportColumn.png 751w, https://zappysys.com/blog/wp-content/uploads/2023/02/exportColumn-300x254.png 300w" sizes="(max-width: 751px) 100vw, 751px" /></a><p id="caption-attachment-9967" class="wp-caption-text">Select the image response and the local file path</p></div>
<p>12. Finally, we use a trash destination to close the flow.</p>
<div id="attachment_9964" style="width: 352px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2023/02/dataflow2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9964" class="wp-image-9964 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/02/dataflow2.png" alt="download images from a web page - All the tasks together " width="342" height="523" srcset="https://zappysys.com/blog/wp-content/uploads/2023/02/dataflow2.png 342w, https://zappysys.com/blog/wp-content/uploads/2023/02/dataflow2-196x300.png 196w" sizes="(max-width: 342px) 100vw, 342px" /></a><p id="caption-attachment-9964" class="wp-caption-text">The final result</p></div>
<h2>Conclusion</h2>
<p>If everything is OK, you will be able to download the images from your HTML page. To do that, we read the list of URLs from a list. Then we get the name of the images using expressions. Then we add a path for each image to store them. Finally, we save the images.</p>
<p>The post <a href="https://zappysys.com/blog/how-to-download-images-from-a-web-page-using-ssis/">How to download images from a web page using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to query salesforce data using Bulk API in SSIS</title>
		<link>https://zappysys.com/blog/query-salesforce-data-using-bulk-api-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Thu, 20 Jan 2022 19:07:09 +0000</pubDate>
				<category><![CDATA[SSIS CSV Source]]></category>
		<category><![CDATA[SSIS Salesforce API Task]]></category>
		<category><![CDATA[SSIS Salesforce Connection]]></category>
		<category><![CDATA[bulk api]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[Regular Expression]]></category>
		<category><![CDATA[salesforce]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=9507</guid>

					<description><![CDATA[<p>Introduction In our previous post, we saw how to read Salesforce data using SSIS Salesforce Source (Which uses SOAP API under the hood). This may be slow if you have millions of rows because Salesforce Source paginates every 2000 rows, so it&#8217;s not a good option to read millions of rows to iterate on a [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/query-salesforce-data-using-bulk-api-ssis/">How to query salesforce data using Bulk API in SSIS</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 post, we saw how to <a href="https://zappysys.com/blog/export-data-from-salesforce-to-sql-server-using-ssis/" target="_blank" rel="noopener">read Salesforce</a> data using SSIS Salesforce Source (Which uses SOAP API under the hood). This may be slow if you have millions of rows because Salesforce Source paginates every 2000 rows, so it&#8217;s not a good option to read millions of rows to iterate on a large Salesforce dataset (Table or Query). To increase the read speed, you can use BULK API. This article explains how to read salesforce data using BULK API and increase read speed.</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>NEW Version (v5.5+)</h2>
<p>In the new version (v5.5), we have added an option to query in Bulk Mode. This means if you have millions of Salesforce object rows to read, no worries; it may be very fast in the new version. Previously, it used to take a long time because it read in batches of 2000 rows in each request. With the Bulk API, the batch size is really large.</p>
<p>Here is how to set Salesforce Bulk API Mode in SELECT query (Read operation).</p>
<ol>
<li>Install new version of SSIS PowerPack. Make sure it is v5.5 or higher.</li>
<li>Open existing Salesforce Source UI</li>
<li>Make sure you <strong>check [Use Bulk API]</strong> option like below. if you do not see this option then most likely you are using older version.<br />
-OR-<br />
Just add <strong>#bulkmode</strong> prefix in the SQL query like below, it will use Bulk API</p>
<div id="attachment_11114" style="width: 687px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-bulk-api-option-soql-select-query.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11114" class="size-full wp-image-11114" src="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-bulk-api-option-soql-select-query.png" alt="" width="677" height="585" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-bulk-api-option-soql-select-query.png 677w, https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-bulk-api-option-soql-select-query-300x259.png 300w" sizes="(max-width: 677px) 100vw, 677px" /></a><p id="caption-attachment-11114" class="wp-caption-text">Bulk API mode for SSIS Salesforce Source (Read Large amount of data using SOQL Query)</p></div></li>
</ol>
<h2>OLD Version</h2>
<p>If you are using an older version of SSIS Power Pack (v5.4.0 or older), you can follow the steps mentioned in the following section.</p>
<p>We will see how to query using Salesforce Bulk API in SSIS. It involves three simple steps like the one below.</p>
<ol>
<li>Call BULK API &#8211; Submit SOQL Query and receive a JobId back (Use <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-api-task/">SSIS Salesforce API Task</a>)<br />
<pre class="crayon-plain-tag">https://{your-instance}.salesforce.com/services/data/v50.0/jobs/query</pre>
</li>
<li>Keep checking Job Status Until Status is <strong>JobComplete</strong> (Use <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-api-task/">SSIS Salesforce API Task</a>)<br />
<pre class="crayon-plain-tag">https://{your-instance}.salesforce.com/services/data/v50.0/jobs/query/{{User::JobId}}</pre>
</li>
<li>Read Query Result  (Use <a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-file-source-flat-file-web-api/" target="_blank" rel="noopener">SSIS CSV Source</a>)<br />
<pre class="crayon-plain-tag">https://{your-instance}.salesforce.com/services/data/v50.0/jobs/query/{{User::JobId}}/results</pre>
</li>
</ol>
<div id="attachment_9515" style="width: 671px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-query-bulk-api-read-data.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9515" class="size-full wp-image-9515" src="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-query-bulk-api-read-data.png" alt="Query Salesforce Data using Bulk API in SSIS (read using SOQL query in Bulk mode / large dataset)" width="661" height="330" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-query-bulk-api-read-data.png 661w, https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-query-bulk-api-read-data-300x150.png 300w" sizes="(max-width: 661px) 100vw, 661px" /></a><p id="caption-attachment-9515" class="wp-caption-text">Query Salesforce Data using Bulk API in SSIS (read using SOQL query in Bulk mode / large dataset)</p></div>
<p>Now, let&#8217;s look at everything in detail.</p>
<h3>Obtain Salesforce Credentials</h3>
<p>The first step to call Salesforce API is to obtain credentials (security token or OAuth ClientId /Secret)</p>
<p>Method#1 &#8211; Check <a href="https://zappysys.com/blog/export-data-from-salesforce-to-sql-server-using-ssis/#Get_Salesforce_Security_Token">this article</a> to use <strong>UserId/ Password / SecretToken</strong><br />
Method#2 &#8211; Check <a href="https://zappysys.com/blog/register-salesforce-app-obtain-client-id-secret-oauth-api-call/">this article</a> to use the <strong>OAuth</strong> Connection Option</p>
<h3>Create Salesforce Connection</h3>
<p>Once we have Salesforce Credentials, we can create a new Salesforce Connection (You can do this from Task UI or the below way)</p>
<ol>
<li>Open Visual Studio ( Assuming you already have SSIS installed along with <a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">ZappySys PowerPack</a> )</li>
<li>Create a New SSIS Package Project.</li>
<li>Right-click on the Connection Manager panel and click on New Connection.<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>Select <strong>ZS-SALESFORCE</strong> Connection Manager from the Connection Managers list and Click on the Add Button.<br />
<img decoding="async" class="figureimage" title="SSIS Salesforce Connection Manager - ADD" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/salesforce-connection/ssis-salesforce-api-task-connection-1.png" alt="SSIS Salesforce Connection Manager - ADD" /></li>
<li>Now in Connection Manager UI, Enter your SalesForce Credentials (OAuth Client Id/. Secret &#8211;or&#8212; User Name, Password and Security Token), and leave all other properties as it is.<br />
<img decoding="async" class="figureimage" title="SSIS Salesforce Connection Manager UI " src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/salesforce-connection/ssis-salesforce-connection-manager-ui.png" alt="SSIS Salesforce Connection Manager UI " /></li>
</ol>
<h3>Call Create Job &#8211; Retrieve / Save JobId</h3>
<p>Once the connection is created, we can create our first step. Basically, we will call this API to <a href="https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/query_create_job.htm" target="_blank" rel="noopener">create Job</a> (Bulk Read)</p>
<ol>
<li>Here, in Visual Studio, drag and drop the ZS Salesforce API Task on the design surface.<img decoding="async" class="figureimage" title="SSIS Salesforce API Task - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/salesforce-api-task/ssis-salesforce-api-task-drag.png" alt="SSIS Salesforce API Task - Drag and Drop" /></li>
<li>Double click the Task and configure Request Settings Tab like below<br />
&#8211; Select Salesforce Connection (Created in the previous section)<br />
&#8211; Check <strong>Use direct URL</strong><br />
&#8211; Enter URL like below (Replace <strong>{your-instance}</strong> with your own instance (i.e. na9) . For more information on how to find out my<br />
salesforce instance id <a href="https://help.salesforce.com/s/articleView?id=000322728&amp;type=1">check this article</a><br />
<pre class="crayon-plain-tag">https://{your-instance}.salesforce.com/services/data/v50.0/jobs/query</pre>
&#8211; Request Method <strong>POST</strong><br />
&#8211; Enter Body like below (You can use your own <a href="https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm" target="_blank" rel="noopener">SOQL query</a>). Keep in mind SQOL must be <a href="https://www.freeformatter.com/json-escape.html" target="_blank" rel="noopener">encoded for JSON format</a>. This means the entire SQL must be in one line (replace new lines with \r\n , quotes with \&#8221; and tabs with \t)<br />
For example, to execute SELECT Id, Name FROM Accounts, you can write something like the one below in BODY.<br />
<pre class="crayon-plain-tag">{
  "operation": "query",
  "query": "SELECT Id, Name\r\nFROM Account"
}</pre>
The above is for below (with a new line)<br />
<pre class="crayon-plain-tag">SELECT Id, Name
FROM Account</pre>
<div id="attachment_9516" style="width: 690px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-call-salesforce-bulk-api-query-soql-sql.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9516" class="size-full wp-image-9516" src="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-call-salesforce-bulk-api-query-soql-sql.png" alt="Create Job - Call Bulk API to Read / Query using SOQL" width="680" height="547" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-call-salesforce-bulk-api-query-soql-sql.png 680w, https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-call-salesforce-bulk-api-query-soql-sql-300x241.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></a><p id="caption-attachment-9516" class="wp-caption-text">Create Job &#8211; Call Bulk API to Read / Query using SOQL</p></div></li>
<li>Now Click Test Request (Copy the <strong>JobId</strong> which we will use in the Variable for Designtime Testing)</li>
<li>On the Response Tab, configure it like the below.<br />
&#8211; Select Response content Type = Json<br />
&#8211; Enter <strong>$.id</strong> as the expression<br />
&#8211; Check Save response option<br />
&#8211; Select Save to Variable and click New to create a variable. Name it <strong>JobId</strong> and enter a sample <strong>JobId</strong> value (copied from the previous step)</p>
<div id="attachment_9517" style="width: 459px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-call-salesforce-bulk-api-extract-jobid-from-result.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9517" class="size-full wp-image-9517" src="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-call-salesforce-bulk-api-extract-jobid-from-result.png" alt="Extract Salesforce JobId save to SSIS Variable" width="449" height="236" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-call-salesforce-bulk-api-extract-jobid-from-result.png 449w, https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-call-salesforce-bulk-api-extract-jobid-from-result-300x158.png 300w" sizes="(max-width: 449px) 100vw, 449px" /></a><p id="caption-attachment-9517" class="wp-caption-text">Extract Salesforce JobId save to SSIS Variable</p></div></li>
</ol>
<h3>Do Status Check &#8211; Look for JobComplete</h3>
<p>Once we create a job and store JobId in the variable we have to keep <a href="https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/query_get_one_job.htm" target="_blank" rel="noopener">checking Job status</a> every X seconds. Don&#8217;t worry you don&#8217;t have to use Loop or timer control for that. ZappySys made it so simple to check such thing without Loop /Timer.</p>
<ol>
<li>Drag and drop the ZS Salesforce API Task in the design surface.<img decoding="async" class="figureimage" title="SSIS Salesforce API Task - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/salesforce-api-task/ssis-salesforce-api-task-drag.png" alt="SSIS Salesforce API Task - Drag and Drop" /></li>
<li>Double click and configure like below. URL will be different this time. Use variable as below and replace your instance ID<br />
<pre class="crayon-plain-tag">https://{your-instance}.salesforce.com/services/data/v50.0/jobs/query/{{User::JobId}}</pre>
<div id="attachment_9518" style="width: 720px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-api-job-status-check.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9518" class="size-full wp-image-9518" src="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-api-job-status-check.png" alt="Check Salesforce Job Status Periodically (Without Loop + Timer Controls) " width="710" height="566" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-api-job-status-check.png 710w, https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-api-job-status-check-300x239.png 300w" sizes="(max-width: 710px) 100vw, 710px" /></a><p id="caption-attachment-9518" class="wp-caption-text">Check Salesforce Job Status Periodically (Without Loop + Timer Controls)</p></div></li>
<li>Now go to the Status Check Tab and configure it, as shown below. It will keep looking for the words below in the response to decide whether it is a Success or Failure. If those words are not found, they will be checked every 5 seconds (Maximum 1200 secs).<br />
&#8211; Check Enable Status Check option<br />
&#8211; For Success Value &#8211; Enter <strong>JobComplete</strong><br />
-Check Fail task option<br />
&#8211; Enter <strong>Cancel|Failed|Abort</strong> in the text box</p>
<div id="attachment_9519" style="width: 709px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-api-job-status-check-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9519" class="size-full wp-image-9519" src="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-api-job-status-check-2.png" alt="Configure Job Status Check Loop using Salesforce API Task" width="699" height="640" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-api-job-status-check-2.png 699w, https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-api-job-status-check-2-300x275.png 300w" sizes="(max-width: 699px) 100vw, 699px" /></a><p id="caption-attachment-9519" class="wp-caption-text">Configure Job Status Check Loop using Salesforce API Task</p></div></li>
</ol>
<h2></h2>
<h3>Read data (Compressed CSV Format)</h3>
<p>Last step is <a href="https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/query_get_job_results.htm" target="_blank" rel="noopener">read the result</a> from completed Salesforce Job. Its in CSV format so we will use Advanced <a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-file-source-flat-file-web-api/" target="_blank" rel="noopener">SSIS CSV Source</a> which supports API connection to Salesforce. For that, we will use the same Salesforce API Task used before.</p>
<ol>
<li>Drag and Drop SSIS Data Flow Task 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 DataFlow task to see DataFlow designer surface.</li>
<li>Here, In Visual Studio, drag and drop the ZS CSV Source (Web API or File) in the design panel<br />
<img decoding="async" class="figureimage" title="SSIS CSV Source (Web API or File) - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-source/ssis-csv-file-source-drag.png" alt="SSIS CSV Source (Web API or File) - Drag and Drop" /></li>
<li>Double click on ZS CSV Source (Web API or File) Configure it like below.<br />
&#8211; Enter URL to read result like this (You can supply OPTIONAL maxRecords parameters to control how much data comes in a single response)<br />
<pre class="crayon-plain-tag">https://{your-instance}.salesforce.com/services/data/v50.0/jobs/query/{{User::JobId}}/results
--OR--
https://{your-instance}.salesforce.com/services/data/v50.0/jobs/query/{{User::JobId}}/results?maxRecords=50000</pre>
&#8211; Check Use Credentials and select Salesforce Connection<br />
&#8211; Click Preview (assuming JobId variable has a valid completed JobId)</p>
<div id="attachment_9520" style="width: 689px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/read-salesforce-data-bulk-api-csv-result.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9520" class="size-full wp-image-9520" src="https://zappysys.com/blog/wp-content/uploads/2022/01/read-salesforce-data-bulk-api-csv-result.png" alt="Read Salesforce Bulk API Job Result - Using SSIS CSV / API Source" width="679" height="663" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/read-salesforce-data-bulk-api-csv-result.png 679w, https://zappysys.com/blog/wp-content/uploads/2022/01/read-salesforce-data-bulk-api-csv-result-300x293.png 300w" sizes="(max-width: 679px) 100vw, 679px" /></a><p id="caption-attachment-9520" class="wp-caption-text">Read Salesforce Bulk API Job Result &#8211; Using SSIS CSV / API Source</p></div></li>
<li>Now, set up Pagination as below to read all records using an automated loop. You will need <strong>VERSION Released after Jun 20, 2022</strong> to use Regular Expression feature in Header Value extractionBy default, Salesforce doesn&#8217;t send all records in response so we <a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/#Method-7_REST_APIPagination_using_Cursor_Continuation_Token_from_Response_Header" target="_blank" rel="noopener">need to setup pagination</a>. In below example we are reading <strong>Sforce-Locator</strong> attribute from Response and sending it to the next URL as <strong>locator=&lt;continue-token&gt;</strong> value<br />
&#8211; Choose <strong>Response Header Contains Continue Token </strong><br />
&#8211; Enter below expression in <strong>Page Num Indicator</strong><br />
<pre class="crayon-plain-tag">locator=Sforce-Locator(^((?!null\b).)*$)</pre>
Basically, the above expression will keep looping until we find <strong>Sforce-Locator : null</strong> in the response header.</p>
<div id="attachment_9723" style="width: 872px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-bulk-query-api-pagination-read-csv-data.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9723" class="size-full wp-image-9723" src="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-bulk-query-api-pagination-read-csv-data.png" alt="Pagination for Salesforce Bulk Query API (Get Header Value from Sforce-Locator)" width="862" height="523" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-bulk-query-api-pagination-read-csv-data.png 862w, https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-bulk-query-api-pagination-read-csv-data-300x182.png 300w, https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-bulk-query-api-pagination-read-csv-data-768x466.png 768w" sizes="(max-width: 862px) 100vw, 862px" /></a><p id="caption-attachment-9723" class="wp-caption-text">Pagination for Salesforce Bulk Query API (Get Header Value from Sforce-Locator)</p></div></li>
<li>Click OK to save and now run entire package like below.</li>
</ol>
<div id="attachment_9515" style="width: 671px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-query-bulk-api-read-data.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9515" class="size-full wp-image-9515" src="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-query-bulk-api-read-data.png" alt="Query Salesforce Data using Bulk API in SSIS (read using SOQL query in Bulk mode / large dataset)" width="661" height="330" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-query-bulk-api-read-data.png 661w, https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-query-bulk-api-read-data-300x150.png 300w" sizes="(max-width: 661px) 100vw, 661px" /></a><p id="caption-attachment-9515" class="wp-caption-text">Query Salesforce Data using Bulk API in SSIS (read using SOQL query in Bulk mode / large dataset)</p></div>
<h2>Conclusion</h2>
<p>In this article we saw how to use various ZappySys Components / Task to achieve complex Salesforce API calls to read Query data using Bulk API. Download <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> and try yourself and also explore 70+ other tasks /components not discussed in this article.</p>
<p>The post <a href="https://zappysys.com/blog/query-salesforce-data-using-bulk-api-ssis/">How to query salesforce data using Bulk API in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Read API data in SSIS and Load into SQL Table</title>
		<link>https://zappysys.com/blog/ssis-read-api-data-load-sql-table/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 25 Sep 2020 17:35:17 +0000</pubDate>
				<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS Components]]></category>
		<category><![CDATA[SSIS CSV Source]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS XML Source (File / SOAP)]]></category>
		<category><![CDATA[oauth]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=9141</guid>

					<description><![CDATA[<p>Introduction If you have need to integrate REST API in SSIS (i.e. fetch JSON, XML, CSV via HTTP call) and wondering how to Read API data in SSIS and Load into SQL DB (i.e. SQL Server, MySQL, Oracle) then you are at the right place. In this article we will cover simple step by step [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-read-api-data-load-sql-table/">How to Read API data in SSIS and Load into SQL Table</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/2017/09/api-180x180.png"><img loading="lazy" decoding="async" class=" wp-image-1854 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2017/09/api-180x180.png" alt="" width="109" height="109" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/api-180x180.png 180w, https://zappysys.com/blog/wp-content/uploads/2017/09/api-180x180-150x150.png 150w" sizes="(max-width: 109px) 100vw, 109px" /></a>If you have need to integrate REST API in SSIS (i.e. fetch JSON, XML, CSV via HTTP call) and wondering how to Read API data in SSIS and Load into SQL DB (i.e. SQL Server, MySQL, Oracle) then you are at the right place.</p>
<p>In this article we will cover simple step by step approach how to achieve API integration in few clicks. For detailed introduction please refer to our <a href="https://zappysys.com/blog/call-rest-api-using-ssis-web-service-task/" target="_blank" rel="noopener">previous article</a>.</p>
<p>In next few sections we will cover the following SSIS Components to read data from API like a Table (Parse in Rows / Column). Our instructions will be mostly for JSON Format but concepts are same for other formats (i.e. XML / CSV).</p>
<div class="su-table su-table-alternate">
<table>
<colgroup>
<col style="vertical-align: top" width="100" />
<col style="vertical-align: top" /></colgroup>
<tbody>
<tr>
<td><img decoding="async" style="width: 72px;height: 72px" src="//zappysys.com/images/ssis-powerpack/SSIS-Json-Source-Adapter.png" alt="Custom SSIS Components - Json Source" /></td>
<td style="vertical-align: top"><a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/">JSON Source Connector</a> (Read from REST API, JSON File or OData Service): Use this dataflow component when you have to <strong>fetch data from REST API webservice like a table</strong>. This component allows you to extract JSON data from webservice and de-normalize nested structure so you can save to Relational database such as SQL Server or any other target (Oracle, FlatFile, Excel, MySQL). This component also supports reading local JSON files or direct JSON string (Wildcard pattern supported too e.g. c:\data\file*.json).</td>
</tr>
<tr>
<td><img decoding="async" style="width: 72px;height: 72px" src="//zappysys.com/images/ssis-powerpack/ssis-xml-source.png" alt="Custom SSIS Components - XML Source (Read File/SOAP/REST Web Service)" /></td>
<td style="vertical-align: top"><a href="//zappysys.com/products/ssis-powerpack/ssis-xml-source/">XML Source Connector</a> (SOAP, File, REST) : Use this dataflow component when you have to fetch data from XML or SOAP webservice and consume data like a table. This component allows you to extract data from webservice and save to SQL Server or any other target (Oracle, FlatFile, Excel, MySQL). This component also supports reading local XML files or direct XML string.</td>
</tr>
<tr>
<td><img loading="lazy" decoding="async" class="alignnone" style="width: 72px;height: 72px" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-source/ssis-csv-file-source.png" alt="Custom SSIS Components - CSV Source (Read File/REST API)" width="128" height="128" /></td>
<td style="vertical-align: top"><a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-file-source-flat-file-web-api/">CSV Source Connector</a> (File, REST) : Use this dataflow component when you have to fetch data from File or REST API which returns data in CSV format . This component allows you to extract data from webservice and save to SQL Server or any other target (Oracle, FlatFile, Excel, MySQL). This component also supports reading local CSV files or direct CSV string.</td>
</tr>
</tbody>
</table>
</div>
<p>There are few more API components not discussed in this articles. They are <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">REST API Task</a> (no Parser &#8211; Just raw API calls) and <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">Web API Destination</a> (Write / Send Data To API / Delete rows). They both have different use case to check them see it fits in your need.</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>Video Tutorial</h2>
<h2><a href="https://zappysys.com/blog/ssis-read-api-data-load-sql-table/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FaO8cVRyCBWw%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></h2>
<h2>Step-By-Step &#8211; Read API data in SSIS using JSON / XML / CSV Source</h2>
<p>In this section you will learn how to use JSON Source Adapter to Read data from API URL.</p>
<div>
<ol>
<li>Open Visual Studio and Create New SSIS Package Project.</li>
<li>Now, Drag and Drop the SSIS <strong>Data Flow Task</strong> from the 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. If your data format is XML then <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-xml-source.htm" target="_blank" rel="noopener">use XML Source</a>, if your data format is CSV then <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-csv-source.htm">use CSV Source</a>.<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 to configure it.</li>
<li>From the Access Mode dropdown select [File path or web Url] and paste the following Url for this example .<br />
<pre class="crayon-plain-tag">https://services.odata.org/V3/OData/OData.svc/Products?$format=json</pre>
</li>
<li>Now next step is to select Filter (Click <strong>Browse</strong> button next to <strong>Array Filter</strong>) or just type below expression in the text box to define which Hierarchy you like to Flatten (i.e. Array).
<div id="attachment_11491" style="width: 838px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/09/json-source-configuration.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11491" class="wp-image-11491 size-full" src="https://zappysys.com/blog/wp-content/uploads/2020/09/json-source-configuration.png" alt="" width="828" height="745" srcset="https://zappysys.com/blog/wp-content/uploads/2020/09/json-source-configuration.png 828w, https://zappysys.com/blog/wp-content/uploads/2020/09/json-source-configuration-300x270.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/09/json-source-configuration-768x691.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-11491" class="wp-caption-text">JSON Source Select Filter</p></div>
<div class="mceTemp"></div>
</li>
<li>JSON/XML can contain multiple arrays within a single document (similar to many tables within a single database). So you have to define which branch you like to extract.  Enter <a href="http://goessner.net/articles/JSONPath/" target="_blank" rel="noopener">JSONPath expression</a> in the Filter textbox to extract only specific part of JSON file as below (<strong>$.value[*]</strong> will get content of value property from JSON document. Value property is an array of JSON documents so we have to use <strong>[*]</strong> to indicate we want all records of that array)<br />
<pre class="crayon-plain-tag">$.value[*]</pre>
<div id="attachment_11492" style="width: 838px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/09/json-source-rsult.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11492" class="size-full wp-image-11492" src="https://zappysys.com/blog/wp-content/uploads/2020/09/json-source-rsult.png" alt="" width="828" height="745" srcset="https://zappysys.com/blog/wp-content/uploads/2020/09/json-source-rsult.png 828w, https://zappysys.com/blog/wp-content/uploads/2020/09/json-source-rsult-300x270.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/09/json-source-rsult-768x691.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-11492" class="wp-caption-text">JSON Source preview data</p></div></li>
<li>Click &#8216;Preview&#8217; to check if our settings are correct.</li>
<li>Click OK to save settings.</li>
<li>How to Pass Credentials to the Service (Basic Authorization Header) Check <a href="https://zappysys.com/blog/how-to-set-base64-encoded-authorization-header-for-http-web-request/" target="_blank" rel="noopener">this article</a> for more information</li>
</ol>
<p>After this section we will see how to connect Source to Target like SQL Server and Load API data into SQL Server Table.</p>
</div>
<h2>Load API data into SQL Server Table / Other Target</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>API Authentication</h2>
<p>In our step by step example we did not cover Authentication to keep things simple but in real world you have to pass some sort of authentication details to make API calls (e.g. UserID/Password or Secure Token). There are many ways to authenticate with API Services. ZappySys offer mainly 2 Connection Managers to cover most Authentication scenarios.</p>
<ol>
<li><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-http-connection-manager.htm" target="_blank" rel="noopener">HTTP Connection Manager</a></li>
<li><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-oauth-connection-manager.htm" target="_blank" rel="noopener">OAuth Connection Manager</a></li>
</ol>
<h3>Using HTTP Connection Manager</h3>
<p>If you have use case of using UserID / Password or any other method supported by HTTP Connection Manager then use below option (Below example is for Basic Authentication)</p>
<div id="attachment_11495" style="width: 835px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/09/using-HTTP-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11495" class="wp-image-11495 size-full" src="https://zappysys.com/blog/wp-content/uploads/2020/09/using-HTTP-connection.png" alt="SSIS JSON Source - Passing Basic Credentials (Supply UserID / Password) using HTTP Connection" width="825" height="812" srcset="https://zappysys.com/blog/wp-content/uploads/2020/09/using-HTTP-connection.png 825w, https://zappysys.com/blog/wp-content/uploads/2020/09/using-HTTP-connection-300x295.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/09/using-HTTP-connection-768x756.png 768w" sizes="(max-width: 825px) 100vw, 825px" /></a><p id="caption-attachment-11495" class="wp-caption-text">SSIS JSON Source &#8211; Passing Basic Credentials (Supply UserID / Password) using HTTP Connection</p></div>
<h3>Using OAuth Connection Manager</h3>
<p>If your API support <a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">OAuth Standard</a> for Authorization then use OAuth Connection Type as below.</p>
<div id="attachment_11496" style="width: 838px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/09/using-OAUTH-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11496" class="size-full wp-image-11496" src="https://zappysys.com/blog/wp-content/uploads/2020/09/using-OAUTH-connection.png" alt="" width="828" height="896" srcset="https://zappysys.com/blog/wp-content/uploads/2020/09/using-OAUTH-connection.png 828w, https://zappysys.com/blog/wp-content/uploads/2020/09/using-OAUTH-connection-277x300.png 277w, https://zappysys.com/blog/wp-content/uploads/2020/09/using-OAUTH-connection-768x831.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-11496" class="wp-caption-text">Generate Token for Google API using OAuth 2.0</p></div>
<h2>API Pagination</h2>
<p>Pagination is another important concept to understand when you call API using ZappySys Connector. If you ready many records from your API then by default API might not return all rows so you have to paginate until all records are read (Like a Loop in Programming). ZappySys makes it easy to paginate. Check this article to configure <a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/" target="_blank" rel="noopener">many different Pagination Modes</a></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 "<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>Conclusion</h2>
<p>REST API is becoming more and more popular each day. With that Data integration from RESTful API services going to be challenge. Luckily ZappySys <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> provides a great way to integrate any API in SSIS via simple drag and drop approach without coding. Try <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack for FREE</a>  see how much time / money you can save and to integrate virtually any REST API.</p>
<p>The post <a href="https://zappysys.com/blog/ssis-read-api-data-load-sql-table/">How to Read API data in SSIS and Load into SQL Table</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Pivot CSV Data in SSIS</title>
		<link>https://zappysys.com/blog/pivot-csv-data-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 19 Oct 2019 08:22:53 +0000</pubDate>
				<category><![CDATA[SSIS CSV Source]]></category>
		<category><![CDATA[SSIS JSON Generator Transform]]></category>
		<category><![CDATA[SSIS JSON Parser Transform]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=8207</guid>

					<description><![CDATA[<p>Introduction In our previous blog we saw How to write data into CSV file in SSIS (GZip / Split). Now in this blog, we will see How to Pivot CSV Data in SSIS using CSV Source. It also supports Pivot mode so you can convert single CSV string value into Rows. In this article we [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/pivot-csv-data-ssis/">How to Pivot CSV Data in SSIS</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/ssis-csv-file-source.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-3102 size-full alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-csv-file-source.png" alt="" width="100" height="100" /></a>In our previous blog we saw <a href="https://zappysys.com/blog/write-data-csv-file-ssis-gzip-split/" target="_blank" rel="noopener">How to write data into CSV file in SSIS (GZip / Split)</a>. Now in this blog, we will see <strong>How to Pivot CSV Data in SSIS using <a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-file-source-flat-file-web-api/" target="_blank" rel="noopener">CSV Source</a></strong>. It also supports Pivot mode so you can convert single CSV string value into Rows. In this article we also see how make some CSV columns as parent and not consider it in pivot and load it as it is using <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/" target="_blank" rel="noopener">JSON Generator</a> and <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-parser-transform/" target="_blank" rel="noopener">JSON Parser Transform</a> Pivot Option.</p>
<p>In nutshell, this post will focus on how to Pivot CSV Data into multiple columns and rows.</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>How to Pivot CSV Data in SSIS using CSV File Source</h2>
<p>Let´s start with an example. In this SSIS CSV Parser Transform example, we will Parse database column string into multiple columns and rows.</p>
<ol>
<li>First of All, Drag and drop Data Flow Task from SSIS Toolbox and double click it to edit.
<div id="attachment_7934" style="width: 470px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7934" class="wp-image-7934 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" alt="Drag and Drop SSIS Data Flow Task from SSIS Toolbox" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a><p id="caption-attachment-7934" class="wp-caption-text">Drag and Drop : SSIS Data Flow Task from SSIS Toolbox</p></div></li>
<li>Furthermore, drag and drop the CSV Source and Double click on it to configure it.
<div id="attachment_8212" style="width: 701px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-drag-drop-csv-source.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8212" class="wp-image-8212 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-drag-drop-csv-source.png" alt="Drag and Drop : CSV Source from SSIS Toolbox" width="691" height="357" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-drag-drop-csv-source.png 691w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-drag-drop-csv-source-300x155.png 300w" sizes="(max-width: 691px) 100vw, 691px" /></a><p id="caption-attachment-8212" class="wp-caption-text">Drag and Drop : CSV Source from SSIS Toolbox</p></div></li>
<li>Enter the CSV file path and select desire column delimiter most common in CSV is comma and check the First Row as headers and click on preview.
<div id="attachment_8213" style="width: 683px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-preview.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8213" class="wp-image-8213 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-preview.png" alt="CSV Source Preview" width="673" height="735" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-preview.png 673w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-preview-275x300.png 275w" sizes="(max-width: 673px) 100vw, 673px" /></a><p id="caption-attachment-8213" class="wp-caption-text">CSV Source Preview</p></div></li>
<li>Now, go to Pivot Columns to Rows Tab and checked Enable Pivoting and click on Preview Data to view the data.
<div id="attachment_8214" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-pivot-preview.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8214" class="wp-image-8214 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-pivot-preview-768x643.png" alt="CSV Source Pivoted Data Preview" width="720" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-pivot-preview-768x643.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-pivot-preview-300x251.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-pivot-preview.png 874w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-8214" class="wp-caption-text">CSV Source Pivoted Data Preview</p></div></li>
<li>That&#8217;s it we see how to read data from CSV File and also Pivot the CSV Data using CSV Source.</li>
<li>Now In the next section we will see how to how make some CSV columns as parent and not consider it in pivot and load it as it is.</li>
</ol>
<h2>How make some CSV columns as parent.</h2>
<p>Sometimes you just need to make child columns in to rows and want to leave parent level columns as it is.</p>
<ol>
<li>First of All, Drag and drop Data Flow Task from SSIS Toolbox and double click it to edit.
<div id="attachment_7934" style="width: 470px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7934" class="wp-image-7934 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" alt="Drag and Drop SSIS Data Flow Task from SSIS Toolbox" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a><p id="caption-attachment-7934" class="wp-caption-text">Drag and Drop : SSIS Data Flow Task from SSIS Toolbox</p></div></li>
<li>Secondly, drag and drop the CSV Source and Double click on it to configure it.
<div id="attachment_8212" style="width: 701px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-drag-drop-csv-source.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8212" class="wp-image-8212 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-drag-drop-csv-source.png" alt="Drag and Drop : CSV Source from SSIS Toolbox" width="691" height="357" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-drag-drop-csv-source.png 691w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-drag-drop-csv-source-300x155.png 300w" sizes="(max-width: 691px) 100vw, 691px" /></a><p id="caption-attachment-8212" class="wp-caption-text">Drag and Drop : CSV Source from SSIS Toolbox</p></div></li>
<li>Furthermore, enter the file path and click on preview.
<div id="attachment_8213" style="width: 683px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-preview.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8213" class="wp-image-8213 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-preview.png" alt="CSV Source Preview" width="673" height="735" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-preview.png 673w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-preview-275x300.png 275w" sizes="(max-width: 673px) 100vw, 673px" /></a><p id="caption-attachment-8213" class="wp-caption-text">CSV Source Preview</p></div></li>
<li>For example if we want to pivot Email and Phone only in pivoting and wants to exclude parent level columns FirstName and LastName as it is.</li>
<li>For that drag and drop JSON Generator Transform and Select Output Mode as <strong>Output One JSON Per Parent Input Row</strong>  and Add Unbound Nested Element and named it as <strong>Persons and click on OK</strong>.
<div id="attachment_8277" style="width: 638px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8277" class="wp-image-8277 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element.png" alt="JSON Generator Add Unbound Nested Element" width="628" height="624" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element.png 628w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element-300x298.png 300w" sizes="(max-width: 628px) 100vw, 628px" /></a><p id="caption-attachment-8277" class="wp-caption-text">JSON Generator Add Unbound Nested Element</p></div></li>
<li>Now add that two parent level fields FirstName and LastName in the Persons.
<div id="attachment_8278" style="width: 746px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-multiple.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8278" class="wp-image-8278 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-multiple.png" alt="JSON Generator Add Multiple Elements" width="736" height="623" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-multiple.png 736w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-multiple-300x254.png 300w" sizes="(max-width: 736px) 100vw, 736px" /></a><p id="caption-attachment-8278" class="wp-caption-text">JSON Generator Add Multiple Elements</p></div></li>
<li>Now select Person Element and right click and Add Unbound Nested Element and <strong>named it as Contacts and click on OK</strong>.
<div id="attachment_8279" style="width: 746px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element-in-attribute.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8279" class="wp-image-8279 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element-in-attribute.png" alt="JSON Generator Add Unbound Nested Element" width="736" height="623" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element-in-attribute.png 736w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element-in-attribute-300x254.png 300w" sizes="(max-width: 736px) 100vw, 736px" /></a><p id="caption-attachment-8279" class="wp-caption-text">JSON Generator Add Unbound Nested Element</p></div></li>
<li>Now add that two child level fields Email and Phone in the Contacts.
<div id="attachment_8280" style="width: 746px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-multiple-attributes-2.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8280" class="wp-image-8280 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-multiple-attributes-2.png" alt="JSON Generator Add Multiple Elements" width="736" height="623" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-multiple-attributes-2.png 736w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-multiple-attributes-2-300x254.png 300w" sizes="(max-width: 736px) 100vw, 736px" /></a><p id="caption-attachment-8280" class="wp-caption-text">JSON Generator Add Multiple Elements</p></div></li>
<li>Therefore JSON Generator Transform looks like below screen. Now Copy that Sample Preview JSON String to use it in the JSON Parser Transom as sample string.
<div id="attachment_8276" style="width: 743px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-sample-data.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8276" class="wp-image-8276 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-sample-data.png" alt="JSON Generator Transform - Sample Data" width="733" height="833" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-sample-data.png 733w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-sample-data-264x300.png 264w" sizes="(max-width: 733px) 100vw, 733px" /></a><p id="caption-attachment-8276" class="wp-caption-text">JSON Generator Transform &#8211; Sample Data</p></div></li>
<li>Similarly, drag and drop JSON Parser Transform and select the Input JSON Column and Paste that copied Sample JSON String and select the Contacts filter to read the Child data and click on Include Parent.
<div id="attachment_8281" style="width: 853px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-select-filter.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8281" class="wp-image-8281 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-select-filter.png" alt="JSON Parser Transform - Select Filter " width="843" height="650" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-select-filter.png 843w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-select-filter-300x231.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-select-filter-768x592.png 768w" sizes="(max-width: 843px) 100vw, 843px" /></a><p id="caption-attachment-8281" class="wp-caption-text">JSON Parser Transform &#8211; Select Filter</p></div></li>
<li>Now go to Pivot Columns to Rows Tab and checked the Enable Pivoting and click on the Preview.
<div id="attachment_8282" style="width: 608px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-enable-pivoting.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8282" class="wp-image-8282 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-enable-pivoting.png" alt="JSON Parser Transform - Enable Pivoting" width="598" height="656" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-enable-pivoting.png 598w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-enable-pivoting-273x300.png 273w" sizes="(max-width: 598px) 100vw, 598px" /></a><p id="caption-attachment-8282" class="wp-caption-text">JSON Parser Transform &#8211; Enable Pivoting</p></div></li>
<li>Finally, we are ready to load this data.
<div id="attachment_8283" style="width: 887px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-pivot-data-viewer.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8283" class="wp-image-8283 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-pivot-data-viewer.png" alt="CSV Pivoted Data" width="877" height="388" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-pivot-data-viewer.png 877w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-pivot-data-viewer-300x133.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-pivot-data-viewer-768x340.png 768w" sizes="(max-width: 877px) 100vw, 877px" /></a><p id="caption-attachment-8283" class="wp-caption-text">CSV Pivoted Data</p></div></li>
<li>Let&#8217;s load this data in the SQL Server.</li>
</ol>
<h2><span id="Load_Walmart_API_data_into_SQL_Server">Load Pivoted CSV File data into SQL Server</span></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><span id="Conclusion">Conclusion</span></h2>
<p>After all, we saw you how to read CSV file data, pivot the data and Similarly, using SSIS JSON Generator and Parser Transform Pivot the CSV Data excluding some columns from pivoting.  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 URL for more information.</p>
<ul>
<li>Help File: <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=ssis-csv-source.htm" target="_blank" rel="noopener">CSV Source</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/pivot-csv-data-ssis/">How to Pivot CSV Data in SSIS</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>How to call Amazon MWS API using SSIS</title>
		<link>https://zappysys.com/blog/call-amazon-mws-api-using-ssis-marketplace-web-service/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 15 Oct 2016 04:42:21 +0000</pubDate>
				<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS CSV Source]]></category>
		<category><![CDATA[SSIS XML Source (File / SOAP)]]></category>
		<category><![CDATA[Amazon MWS]]></category>
		<category><![CDATA[API Integration]]></category>
		<category><![CDATA[looping]]></category>
		<category><![CDATA[paging]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[ssis xml source]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=822</guid>

					<description><![CDATA[<p>Introduction In this post you will learn how to call Amazon MWS API (Amazon Marketplace Web Service) or Amazon Product Advertising API using SSIS PowerPack. Using drag and drop approach you can consume data from Amazon MWS XML Web service. In this post we will use ZappySys XML Source connector to read data from Amazon MWS [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/call-amazon-mws-api-using-ssis-marketplace-web-service/">How to call Amazon MWS API 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:#e2dec9;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:#fcf8e3;border-color:#ffffff;color:#8a6d3b;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">
<strong><span style="vertical-align: text-bottom;font-size: 0.86em;">⚠️</span> Deprecation Notice: MWS API is deprecated</strong><br />
Amazon&#8217;s MWS (Marketplace Web Service) is being deprecated and <strong>replaced by the newer AWS Selling Partner API (SP-API).</strong> For a more robust and secure integration, we <strong>recommend</strong> using our <strong><a href="/api/integration-hub/amazon-selling-partner-connector/">AWS Selling Partner (SP-API) Connector</a>.</strong> As Amazon is phasing out MWS functionality and eventually plans to fully deprecate it.<br />
</div></div>
<p><a href="//zappysys.com/blog/wp-content/uploads/2016/10/amazon-mws-api-integration.png"><img loading="lazy" decoding="async" class="alignleft wp-image-1632" src="//zappysys.com/blog/wp-content/uploads/2016/10/amazon-mws-api-integration.png" alt="" width="120" height="120" srcset="https://zappysys.com/blog/wp-content/uploads/2016/10/amazon-mws-api-integration.png 505w, https://zappysys.com/blog/wp-content/uploads/2016/10/amazon-mws-api-integration-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2016/10/amazon-mws-api-integration-300x300.png 300w" sizes="(max-width: 120px) 100vw, 120px" /></a>In this post you will learn how to <em>call Amazon MWS API</em> (<a href="https://developer.amazonservices.com/" target="_blank" rel="noopener">Amazon Marketplace Web Service</a>) or <a href="http://docs.aws.amazon.com/AWSECommerceService/latest/GSG/Welcome.html" target="_blank" rel="noopener">Amazon Product Advertising API</a> using <a href="//zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a>.</p>
<p>Using drag and drop approach you can <em>consume data from Amazon MWS XML Web service.</em> In this post we will use <a href="//zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener">ZappySys XML Source connector</a> to read data from Amazon MWS API and load into SQL Server. We will also use <a href="//zappysys.com/blog/call-rest-api-using-ssis-web-service-task/" target="_blank" rel="noopener">REST API Task</a> to call any API from Marketplace Web service and save output into Variable.</p>
<h2>Prerequisites</h2>
<p>This post assumes following things</p>
<ol>
<li>Basic knowledge of SSIS and XML format.</li>
<li>Amazon MWS Account and and valid AWSAccessKeyId and Secret Key to call Amazon MWS API <a href="https://zappysys.com/blog/import-amazon-mws-data-power-bi/#Obtain_MWS_API_Access_Key_Secret_and_Seller_ID" target="_blank" rel="noopener">(How to obtain Key / Secret and SellerId ? )</a>.</li>
<li>You have tested few API calls using <a href="https://mws.amazonservices.com/scratchpad/index.html" target="_blank" rel="noopener">Amazon MWS Scratchpad</a> this will give you idea about various API you can call and parameters you need to pass.</li>
</ol>
<h2>Testing MWS Requests using ScratchPad</h2>
<p>Very first step we recommend before you call MWS API in SSIS is to get familiar with <a href="https://mws.amazonservices.com/scratchpad/index.html" target="_blank" rel="noopener">Amazon MWS Scratchpad</a> tool. Check this article for <a href="https://zappysys.com/blog/import-amazon-mws-data-power-bi/#About_Amazon_MWS_API">detailed steps</a>.  You can also use <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/">Fiddler</a> to debug some requests.</p>
<div id="attachment_4847" style="width: 933px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-response-scratchpad-listmatchingproducts-example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4847" class="size-full wp-image-4847" src="https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-response-scratchpad-listmatchingproducts-example.png" alt="Calling Amazon MWS API in Scratchpad Testing Tool (Response Details Tab) - ListMatchingProducts Example" width="923" height="527" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-response-scratchpad-listmatchingproducts-example.png 923w, https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-response-scratchpad-listmatchingproducts-example-300x171.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-response-scratchpad-listmatchingproducts-example-768x439.png 768w" sizes="(max-width: 923px) 100vw, 923px" /></a><p id="caption-attachment-4847" class="wp-caption-text">Calling Amazon MWS API in Scratchpad Testing Tool (Response Details Tab) &#8211; ListMatchingProducts Example</p></div>
<h2>Call Amazon MWS API using SSIS</h2>
<p>To consume data from any XML Source (File, SOAP Web Service or XML API) you can use  <a href="//zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener">ZappySys XML Source<br />
connector.</a> or <a href="//zappysys.com/blog/call-rest-api-using-ssis-web-service-task/" target="_blank" rel="noopener">REST API Task.</a> In below example you will see how to call Amazon MWS API and save output into Variable. With this approach you can call any API (GET / POST / DELETE / PUT)</p>
<ol>
<li>Download and Install SSIS PowerPack</li>
<li>Create test package</li>
<li>From SSIS toolbox drag <a href="//zappysys.com/blog/call-rest-api-using-ssis-web-service-task/" target="_blank" rel="noopener">ZS REST API Task</a>  and double click on the task to configure it</li>
<li>Select Request URL Access Mode = [Url from Connection]</li>
<li>Enter URL as below<br />
<pre class="crayon-plain-tag">https://mws.amazonservices.com/Orders/2013-09-01</pre>
In above URL<br />
** mws.amazonservices.com =&gt; This is your endpoint. If you are not in USA then <a href="http://docs.developer.amazonservices.com/en_UK/dev_guide/DG_Endpoints.html" target="_blank" rel="noopener">Click here</a> to find correct endpoint<br />
** /Orders =&gt; That&#8217;s your API you want to call<br />
** /2013-09-01 =&gt; That&#8217;s your API version (You have to add this same version in your POST Body too (see next section).</li>
<li>In Select Url Connection dropdown select New OAUTH connection option.</li>
<li>When prompted on OAuth connection UI select Provider=Amazon MWS, Enter AWSAccessKey and Secret key and Click OK (If you have MWSAuthToken then enter in Access Token field else leave it empty). Do not test because it may not work yet.
<div id="attachment_825" style="width: 685px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-api-marketplace-web-service-connection-manager.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-825" class="size-full wp-image-825" src="//zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-api-marketplace-web-service-connection-manager.png" alt="SSIS OAuth Connection - Call Amazon MWS API (Marketplace Web service API) " width="675" height="475" srcset="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-api-marketplace-web-service-connection-manager.png 675w, https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-api-marketplace-web-service-connection-manager-300x211.png 300w" sizes="(max-width: 675px) 100vw, 675px" /></a><p id="caption-attachment-825" class="wp-caption-text">SSIS OAuth Connection &#8211; Call Amazon MWS API (Marketplace Web service API)</p></div></li>
<li>Another Setting you may turn on is Retry Handling. This allows to over come ThresholdLimitReached error when we <a href="https://docs.developer.amazonservices.com/en_UK/dev_guide/DG_Throttling.html" target="_blank" rel="noopener">call API too fast</a>.
<div id="attachment_7156" style="width: 599px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/http-retry-settings-oauth-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7156" class="size-full wp-image-7156" src="https://zappysys.com/blog/wp-content/uploads/2018/09/http-retry-settings-oauth-connection.png" alt="Retry Options" width="589" height="429" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/http-retry-settings-oauth-connection.png 589w, https://zappysys.com/blog/wp-content/uploads/2018/09/http-retry-settings-oauth-connection-300x219.png 300w" sizes="(max-width: 589px) 100vw, 589px" /></a><p id="caption-attachment-7156" class="wp-caption-text">Retry Options</p></div></li>
<li>Now select Method=POST, and in the body enter following<br />
<pre class="crayon-plain-tag">Action=GetServiceStatus&amp;SellerId=A77XXXXXXX&amp;Version=2013-09-01</pre>
If your API requires pagination (more than 100 records from response) then refer next section (Sample Package). In the case of Pagination your second request may look like below<br />
<pre class="crayon-plain-tag">Action=YourActionNameWithNextToken&amp;SellerId=A77XXXXXXX&amp;Version=2013-09-01&amp;NextToken={{User::vNextToken,FUN_URLENC}}</pre>
<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>NOTE:</strong> Enter all required parameters in the following format, as shown below. All values need to be URL-encoded. If you use SSIS variable, use it along with <strong>FUN_URLENC</strong> format specifier, e.g. <strong>{{User::myVariable,FUN_URLENC}}</strong>. If you use a hard-coded value, and not sure if it is URL-encoded, then encode it with the same <strong>FUN_URLENC</strong> format specifier/function, e.g. <strong>&lt;&lt;myValue,FUN_URLENC&gt;&gt;</strong>. Always check if SSIS configuration matches the one you see in <em>MWS ScratchPad Request</em> <em>Details</em>.<br />
<strong>Format:</strong><br />
<code>param1=value1&amp;param2=&lt;&lt;value2,FUN_URLENC&gt;&gt;&amp;param3={{User::myVar,FUN_URLENC}}</code></div></div></li>
<li>Now click Test and see content in the Preview window.
<div id="attachment_826" style="width: 786px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/10/ssis-call-amazon-mws-api-marketplace-webservice-use-rest-api-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-826" class="size-full wp-image-826" src="//zappysys.com/blog/wp-content/uploads/2016/10/ssis-call-amazon-mws-api-marketplace-webservice-use-rest-api-task.png" alt="SSIS REST API Task - Call Amazon MWS API - Get XML data save into SSIS variable" width="776" height="652" srcset="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-call-amazon-mws-api-marketplace-webservice-use-rest-api-task.png 776w, https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-call-amazon-mws-api-marketplace-webservice-use-rest-api-task-300x252.png 300w" sizes="(max-width: 776px) 100vw, 776px" /></a><p id="caption-attachment-826" class="wp-caption-text">SSIS REST API Task &#8211; Call Amazon MWS API &#8211; Get XML data save into SSIS variable</p></div></li>
<li>If you wish to save response data into SSIS variable then goto response Tab and check save option and select variable name.</li>
</ol>
<h2>Amazon MWS API Pagination</h2>
<p>Many Amazon MWS API calls by default don&#8217;t return all records (Explained <a href="https://docs.developer.amazonservices.com/en_US/dev_guide/DG_NextToken.html" target="_blank" rel="noopener">here</a>). Rather than returning all rows you may get partial response (e.g. Max 50 or 100 rows). If you want to get all records then you have to use NextToken  found in your XML. For API which requires pagination, in that case your POST body may be different for 2nd or higher requests. Notice how we changed Action and appended NextToken=xxxxxxxxxxx in the second request. Also notice we used encoded token (URL encoded). This is very important because as per Amazon Specs this value has to be Url Encoded.</p>
<p>We also documented similar use case of <a href="https://zappysys.com/blog/import-amazon-mws-data-power-bi/#Using_Pagination_in_Amazon_MWS_API_calls" target="_blank" rel="noopener">Amazon MWS Pagination for Power BI (Check this one)</a> its mostly same setup except 2-3 properties might be named different way.</p>
<p>Now lets look at sample request / response for paginated MWS requests (For clarity we have removed many common Parameters which are automatically added at runtime e.g. Signature, Timestamp). We use <a href="https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_ListOrders.html" target="_blank" rel="noopener">ListOrders</a> (First Request) and <a href="https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_ListOrdersByNextToken.html" target="_blank" rel="noopener">ListOrderByNextToken</a> (Second+ requests)</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;">NOTE: Most of Amazon MWS API calls are heavily throttled means you cannot call more than X calls per minute or hour. So Refer to <a href="https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Throttling.html" target="_blank" rel="noopener">Throttling Limits</a> for each API Endpoint.</div></div>
<p><strong>First Request</strong></p><pre class="crayon-plain-tag">POST https://mws.amazonservices.com/Orders/2013-09-01

Action=ListOrders&amp;SellerId=A10zzzzzzz&amp;CreatedAfter=2018-09-01T04%3A00%3A00Z</pre><p>
<strong>First Response</strong></p><pre class="crayon-plain-tag">&lt;?xml version="1.0"?&gt;
&lt;ListOrdersResponse xmlns="https://mws.amazonservices.com/
    Orders/2013-09-01"&gt;
    &lt;ListOrdersResult&gt;
        &lt;NextToken&gt;2YgYW55IxxxxxxxxxxxxVyZS4=&lt;/NextToken&gt;
        &lt;LastUpdatedBefore&gt;2017-02-25T18%3A10%3A21.687Z&lt;/LastUpdatedBefore&gt;
        &lt;Orders&gt;
            &lt;Order&gt; ....... &lt;/Order&gt;
            &lt;Order&gt; ....... &lt;/Order&gt;
            &lt;Order&gt; ....... &lt;/Order&gt;
        &lt;/Orders&gt;
    &lt;/ListOrdersResult&gt;
&lt;/ListOrdersResponse&gt;</pre><p>
&nbsp;</p>
<p><strong>Second Request or higher (MWS API with Pagination using NextToken)</strong></p><pre class="crayon-plain-tag">POST https://mws.amazonservices.com/Orders/2013-09-01

Action=ListOrdersByNextToken&amp;SellerId=A10zzzzzzz&amp;CreatedAfter=2018-09-01T04%3A00%3A00Z&amp;NextToken=YOUR_ENCODED_TOKEN_FROM_PREV_REQUEST</pre><p>
<strong>Second or higher Response</strong></p><pre class="crayon-plain-tag">&lt;?xml version="1.0"?&gt;
&lt;ListOrdersByNextTokenResponse xmlns="https://mws.amazonservices.com/
    Orders/2013-09-01"&gt;
    &lt;ListOrdersByNextTokenResult&gt;
        &lt;NextToken&gt;2YgYW55IxxxxxxxxxxxxVyZS4=&lt;/NextToken&gt;
        &lt;LastUpdatedBefore&gt;2017-02-25T18%3A10%3A21.687Z&lt;/LastUpdatedBefore&gt;
        &lt;Orders&gt;
            &lt;Order&gt; ....... &lt;/Order&gt;
            &lt;Order&gt; ....... &lt;/Order&gt;
            &lt;Order&gt; ....... &lt;/Order&gt;
        &lt;/Orders&gt;
    &lt;/ListOrdersResult&gt;
&lt;/ListOrdersResponse&gt;</pre><p>
<h3>Sample SSIS Package</h3>
<p>If you want to see complete working package for pagination pattern then <a href="https://zappysys.com/blog/wp-content/uploads/2016/10/Amazon_MWS_API_With_LoopEasy_2012.zip" target="_blank" rel="noopener">download from here</a>. Change AccessKey, SecretKey, SellerID and Path as needed to make this package work.</p>
<p>Here is the screenshot of example SSIS package for Amazon MWS.</p>
<div id="attachment_7144" style="width: 641px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-api-pagination-example-listorders-nexttoken.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7144" class="size-full wp-image-7144" src="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-api-pagination-example-listorders-nexttoken.png" alt="Amazon MWS APi Pagination (ListOrders , ListOrdersByNextToken Example)" width="631" height="761" srcset="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-api-pagination-example-listorders-nexttoken.png 631w, https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-api-pagination-example-listorders-nexttoken-249x300.png 249w" sizes="(max-width: 631px) 100vw, 631px" /></a><p id="caption-attachment-7144" class="wp-caption-text">Amazon MWS APi Pagination (ListOrders , ListOrdersByNextToken Example)</p></div>
<p>&nbsp;</p>
<h3>Copy/Paste Properties</h3>
<p>Here is copy/paste values for properties listed above.</p><pre class="crayon-plain-tag">DirectPath:  https://mws.amazonservices.com/Orders/2013-09-01
EnablePageTokenForBody: True
Filter:  $.ListOrders[$tag$]Response.ListOrders[$tag$]Result.Orders.Order[*]
HasDifferentNextPageInfo: True
HttpRequestData:  Action=ListOrders[$tag$]&amp;SellerId=A1xxxxxxxx&amp;CreatedAfter=2018-09-01T04%3A00%3A00Z&amp;MarketplaceId.Id.1=ATVPDKIKX0DER
HttpRequestMethod:  POST
NextUrlAttribute: $.ListOrders[$tag$]Response.ListOrders[$tag$]Result.NextToken
NextUrlSuffix: &amp;NextToken=&lt;%nextlink_encoded%&gt;
NetUrlWait: 10000 (ms) -- slow down to avoid throttling ... Max 6 requests per minute, increase if you get API Limit Error
PagePlaceholders:  body=|ByNextToken;filter=|ByNextToken</pre><p>
&nbsp;</p>
<h3>Understanding Pagination Properties</h3>
<p>Here are various properties you have to set for Pagination.</p>
<div class="su-table su-table-alternate">
<table style="border-collapse: collapse;width: 100%;height: 154px" border="1">
<tbody>
<tr style="height: 22px">
<td style="width: 14.5161%;height: 22px">Property</td>
<td style="width: 85.4839%;height: 22px">Description</td>
</tr>
<tr style="height: 66px">
<td style="width: 14.5161%;height: 66px">Src</td>
<td style="width: 85.4839%;height: 66px">Change this to correct URL. Look at Scratchpad Response Details Tab and Findout first line after POST and before &#8220;?&#8221; . e.g. /Orders/2013-09-01  this will be used in your URL.<br />
<strong>Example: </strong><br />
https://mws.amazonservices.com/Orders/2013-09-01</td>
</tr>
<tr style="height: 22px">
<td style="width: 14.5161%;height: 22px">Body (i.e. RequestData)</td>
<td style="width: 85.4839%;height: 22px">Scratchpad shows HTTP POST section. You can copy that and remove  System supplied parameters and then arrange all in one line to form your Body for request.</p>
<p><strong>Example:</strong></p><pre class="crayon-plain-tag">POST /Orders/2013-09-01?AWSAccessKeyId=AKxxxxxxxxxx
  &amp;Action=ListOrders
  &amp;SellerId=A10zzzzzzz
  &amp;SignatureVersion=2
  &amp;Timestamp=2018-09-17T21%3A35%3A57Z
  &amp;Version=2013-09-01
  &amp;Signature=3GigipfRsQgzzzzzzzzzzzzzs%3D
  &amp;SignatureMethod=HmacSHA256</pre><p>
Above HTTP POST can be used as below for your Body in ZappySys Driver. Rest of the parameters are automatically supplied by system. See special placeholder named [$tag$] this gets replaced at runtime when you set <strong>EnablePageTokenForBody=True</strong> and <strong>HasDifferentNextPageInfo=True</strong></p><pre class="crayon-plain-tag">Action=ListOrders[$tag$]&amp;SellerId=A10zzzzzzz&amp;CreatedAfter=2018-09-01T04%3A00%3A00Z</pre><p>
</td>
</tr>
<tr style="height: 22px">
<td style="width: 14.5161%;height: 22px">Filter</td>
<td style="width: 85.4839%;height: 22px">Change this parameter according to XML structure in the response.<br />
For example: If you see below response (first xml) in Scratchpad then your Filter will be<br />
<strong>$.ListOrdersResponse.ListOrdersResult.Orders.Order[*]</strong><br />
to enable pagination refer to <a href="https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_ListOrdersByNextToken.html" target="_blank" rel="noopener">Sample listed here</a> (click Example response at the bottom of that page). In second response and onwards your Filter should be below (See Bold Part).<br />
$ListOrders<strong>ByNextToken</strong>Response.ListOrders<strong>ByNextToken</strong>Result.Orders.Order[*]However in Driver we <strong>replace ByNextToken</strong> with <strong>[$tag$]</strong>. Like below. Using [$tag$] will automatically pick up the correct filter based on page number. You must set HasDifferentNextPageInfo=True to use [$tag$] feature.<strong>$.ListOrders[$tag$]Response.ListOrders[$tag$]Result.Orders.Order[*]</strong>Example of <strong>first page response</strong></p><pre class="crayon-plain-tag">&lt;?xml version="1.0"?&gt;
&lt;ListOrdersResponse xmlns="https://mws.amazonservices.com/
    Orders/2013-09-01"&gt;
    &lt;ListOrdersResult&gt;
        &lt;NextToken&gt;2YgYW55IxxxxxxxxxxxxVyZS4=&lt;/NextToken&gt;
        &lt;LastUpdatedBefore&gt;2017-02-25T18%3A10%3A21.687Z&lt;/LastUpdatedBefore&gt;
        &lt;Orders&gt;
            &lt;Order&gt; ....... &lt;/Order&gt;
            &lt;Order&gt; ....... &lt;/Order&gt;
            &lt;Order&gt; ....... &lt;/Order&gt;
        &lt;/Orders&gt;
    &lt;/ListOrdersResult&gt;
&lt;/ListOrdersResponse&gt;</pre><p>
Example of <strong>next page response</strong></p><pre class="crayon-plain-tag">&lt;?xml version="1.0"?&gt;
&lt;ListOrdersByNextTokenResponse xmlns="https://mws.amazonservices.com/
    Orders/2013-09-01"&gt;
    &lt;ListOrdersByNextTokenResult&gt;
        &lt;NextToken&gt;2YgYW55IxxxxxxxxxxxxVyZS4=&lt;/NextToken&gt;
        &lt;LastUpdatedBefore&gt;2017-02-25T18%3A10%3A21.687Z&lt;/LastUpdatedBefore&gt;
        &lt;Orders&gt;
            &lt;Order&gt; ....... &lt;/Order&gt;
            &lt;Order&gt; ....... &lt;/Order&gt;
            &lt;Order&gt; ....... &lt;/Order&gt;
        &lt;/Orders&gt;
    &lt;/ListOrdersResult&gt;
&lt;/ListOrdersResponse&gt;</pre><p>
</td>
</tr>
<tr style="height: 22px">
<td style="width: 14.5161%;height: 22px">NextUrlAttribute</td>
<td style="width: 85.4839%;height: 22px">This property defines which attributes indicate Token for next page. You can use this token in Body of next request (see NextUrlSuffix and EnablePageTokenForBody). You must set <strong>EnablePageTokenForBody=true</strong> to use Extracted token in Body.</td>
</tr>
<tr>
<td style="width: 14.5161%">StopIndicatorAttribute</td>
<td style="width: 85.4839%">Some APIs like  <a href="https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportRequestList.html">GetReportRequestList</a> stop pagination based on <strong>HasNext</strong> attribute value. (ListOrders doesnt need this property to be set). Use this property to extract HasNext from response by supplying correct Filter expression. You also need to set NextUrlEndIndicator property which defines static value which indicates the last page. Example properties as below.</p><pre class="crayon-plain-tag">NextUrlEndIndicator=false
StopIndicatorAttributeOrExpr= $.GetReportRequestList[$tag$]Response.GetReportRequestList[$tag$]Result.HasNext</pre><p>
</td>
</tr>
<tr>
<td style="width: 14.5161%">NextUrlSuffix</td>
<td style="width: 85.4839%">This is used to create a string for NextToken attribute for next page request. If you want to just append extracted token to Body then you dont have to set this but in our case, we have to use &amp;NextToken=EncodedValueOfExtractedToken so we have used <strong>&amp;NextToken=&lt;%nextlink_encoded%&gt;</strong> expression.</td>
</tr>
<tr>
<td style="width: 14.5161%">PagePlaceholders</td>
<td style="width: 85.4839%">This property contains [$tag$] values for first page and next pages. You can define tags for filter, body or header. Each pair must be pipe delimited. First value or pair is [$tag$]  for first request and second value of the pair is [$tag$] for any next request afterwards. Our first request use blank value for [$tag$].<br />
Example:  <strong>PagePlaceholders=&#8217;body=|ByNextToken;filter=|ByNextToken&#8217;</strong></td>
</tr>
<tr>
<td style="width: 14.5161%">HasDifferentNextPageInfo</td>
<td style="width: 85.4839%">Set to True &#8211; This enables use of [$tag$] inside body, filter, headers to use different values of first request and second onwards requests.</td>
</tr>
<tr>
<td style="width: 14.5161%">EnablePageTokenForBody</td>
<td style="width: 85.4839%">Set to True &#8211; This appends value extracted from <strong>NextUrlSuffix</strong> inside body (e.g. NextToken).</td>
</tr>
</tbody>
</table>
</div>
<h2>Amazon MWS API Pagination (For Old Version)</h2>
<p>So in previous section we saw how to achieve pagination in one step (for newer version of SSIS PowerPack). But there will be a case you cannot use latest SSIS PowerPack or you want to take complete control on each aspect of pagination. In such case use below method (Depreciated).  In newer version we added many new properties so you dont have to do Loop pattern like below.</p>
<h3>Sample SSIS Package</h3>
<p>If you want to see complete working package for pagination pattern then <a href="//zappysys.com/blog/wp-content/uploads/2016/11/SSIS_Amazon_MWS_API_With_Loop_Example.zip" target="_blank" rel="noopener">download from here</a>. Change AccessKey, SecretKey, SellerID and Path as needed to make this package work.</p>
<p>Here is the screenshot of example SSIS package for Amazon MWS.</p>
<div id="attachment_893" style="width: 730px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/10/read-amazon-mws-web-api-paginate-nexttoken-load-to-sql-server.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-893" class="wp-image-893 size-large" src="//zappysys.com/blog/wp-content/uploads/2016/10/read-amazon-mws-web-api-paginate-nexttoken-load-to-sql-server-1024x671.png" alt="SSIS Example Package - Read data from Amazon MWS Web service (API Call). Paginate API calls using NextToken" width="720" height="472" srcset="https://zappysys.com/blog/wp-content/uploads/2016/10/read-amazon-mws-web-api-paginate-nexttoken-load-to-sql-server-1024x671.png 1024w, https://zappysys.com/blog/wp-content/uploads/2016/10/read-amazon-mws-web-api-paginate-nexttoken-load-to-sql-server-300x196.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/10/read-amazon-mws-web-api-paginate-nexttoken-load-to-sql-server.png 1040w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-893" class="wp-caption-text">SSIS Example Package &#8211; Read data from Amazon MWS Web service (API Call). Paginate API calls using NextToken</p></div>
<h2>Load Amazon MWS API data into SQL Server using SSIS</h2>
<p>In this section we will see how to use <a href="//zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener">ZappySys XML Source connector</a> to read data from Amazon MWS Web Service and load into SQL Server</p>
<p>For making things simple we are calling</p>
<ol>
<li>Download and Install SSIS PowerPack</li>
<li>Create test package</li>
<li>From SSIS toolbox drag Data Flow task and double click task to go to Data Flow designer</li>
<li>Drag <a href="//zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener">ZS XML Source</a> from SSIS Toolbox</li>
<li>Configure XML Source as below
<div id="attachment_827" style="width: 704px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/10/ssis-xml-source-read-from-amazon-mws-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-827" class="size-full wp-image-827" src="//zappysys.com/blog/wp-content/uploads/2016/10/ssis-xml-source-read-from-amazon-mws-api.png" alt="SSIS XML Source - Read data from Amazon MWS API (Amazon Marketplace Web service call)" width="694" height="683" srcset="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-xml-source-read-from-amazon-mws-api.png 694w, https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-xml-source-read-from-amazon-mws-api-300x295.png 300w" sizes="(max-width: 694px) 100vw, 694px" /></a><p id="caption-attachment-827" class="wp-caption-text">SSIS XML Source &#8211; Read data from Amazon MWS API (Amazon Marketplace Web service call)</p></div></li>
<li>Drag OLEDB destination from SSIS Toolbox.</li>
<li>Connect XML Source to OLEDB Destination and map input column to target table</li>
<li>Execute dataflow
<div id="attachment_828" style="width: 791px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/10/ssis-get-data-from-amazon-mws-web-service-call.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-828" class="size-full wp-image-828" src="//zappysys.com/blog/wp-content/uploads/2016/10/ssis-get-data-from-amazon-mws-web-service-call.png" alt="Get data from Amazon MWS API - Save to File or SQL Server using SSIS" width="781" height="314" srcset="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-get-data-from-amazon-mws-web-service-call.png 781w, https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-get-data-from-amazon-mws-web-service-call-300x121.png 300w" sizes="(max-width: 781px) 100vw, 781px" /></a><p id="caption-attachment-828" class="wp-caption-text">Get data from Amazon MWS API &#8211; Save to File or SQL Server using SSIS</p></div></li>
</ol>
<h2>Working with Amazon MWS Feed API (e.g. Upload file)</h2>
<p>Amazon MWS Provides Feed APIs which has slight different requirements. Important requirement in Feed file upload is you have to supply Content MD5 Hash. If you use SSIS PowerPack then you don&#8217;t have to worry about that complexity because calculating MD5 Hash is automatically done.</p>
<h3>Upload Amazon MWS Feed File in TSV / CSV format (Tab separated)</h3>
<p>Here is the screenshot for how to upload Tab separated values in CSV file. You can specify body from Variable or Read from file. If you read from file then must check File Upload/Multi-Part option and start path with @ symbol as below.</p>
<div id="attachment_975" style="width: 965px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/10/ssis-call-amazon-mws-feed-api-submitfeed-upload-file-csv-tab-format.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-975" class="size-full wp-image-975" src="//zappysys.com/blog/wp-content/uploads/2016/10/ssis-call-amazon-mws-feed-api-submitfeed-upload-file-csv-tab-format.png" alt="Call Amazon MWS Feed API - Upload CSV file format (Tab separated values - TSV) - XML" width="955" height="623" srcset="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-call-amazon-mws-feed-api-submitfeed-upload-file-csv-tab-format.png 955w, https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-call-amazon-mws-feed-api-submitfeed-upload-file-csv-tab-format-300x196.png 300w" sizes="(max-width: 955px) 100vw, 955px" /></a><p id="caption-attachment-975" class="wp-caption-text">Call Amazon MWS Feed API &#8211; Upload CSV file format (Tab separated values &#8211; TSV)</p></div>
<h3>Upload Amazon MWS Feed File in XML format</h3>
<p>To upload feed file in XML format use same settings as above except Content Type should be XML (text/xml) (Select in the dropdown)</p>
<h2>Calling Amazon Product Advertising API</h2>
<p>If you have need to call <a href="http://docs.aws.amazon.com/AWSECommerceService/latest/GSG/Welcome.html" target="_blank" rel="noopener">Amazon Product Advertising API</a> then also you can use above techniques (Use MWS Provider on OAuth connection) to call Product Advertise API. Both API (MWS API and Product Advertise API) use same signature hashing algorithm so its possible to use MWS Provider for Hashing. You may have to change your API URL parameters as needed when you call Amazon Product Advertising API. Basically when you call any MWS or Product Advertising API using GET method then OAuth connection manager automatically appends Signature to URL at runtime.</p>
<h2>Import data from MWS Custom Reports (Inventory Report Example)</h2>
<p>Now lets look at how to extract data from <a href="https://docs.developer.amazonservices.com/en_UK/reports/Reports_ReportType.html" target="_blank" rel="noopener">Custom Report API</a> . Reading data from Custom Reports not single step process because report generation is Job style API. Which means you send report request and wait  until its done. Once Report ready you have to read in CSV format or XML. Some Reports only available in CSV format. <a href="https://docs.developer.amazonservices.com/en_UK/reports/Reports_Overview.html" target="_blank" rel="noopener">Check this post</a> to understand how complex it can be to get data. We will make it simple for you to understand this in 3 steps. Basically calling reports requires minimum 3 API calls (see below)</p>
<ol>
<li>Create a new report request &#8211; Cal <a href="https://docs.developer.amazonservices.com/en_UK/reports/Reports_RequestReport.html" target="_blank" rel="noopener">RequestReport</a> API . It returns <strong>ReportRequestId</strong> (You can use it in the next step)</li>
<li>Check Report Status see its done &#8211; Call <a href="https://docs.developer.amazonservices.com/en_UK/reports/Reports_GetReportRequestList.html" target="_blank" rel="noopener">GetReportRequestList</a> API (Pass <strong>ReportRequestId</strong> got in the previous step to get data for only one Report request we care). Keep checking Report Status every few seconds until you get <strong>_DONE_</strong> status in response.</li>
<li>Read Report Data &#8211; Call <a href="https://docs.developer.amazonservices.com/en_UK/reports/Reports_GetReport.html" target="_blank" rel="noopener">GetReport</a>. This API call returns CSV or XML data. So use correct component for this step. If CSV data is returned then we must use <a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-file-source-flat-file-web-api/" target="_blank" rel="noopener">CSV Source</a> rather than <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener">XML Driver</a>.</li>
</ol>
<p>Now lets see how to read Amazon MWS custom report in SSIS. In this example, We will get Inventory by calling <strong>_GET_MERCHANT_LISTINGS_DATA_</strong> report type.</p>
<h3>Download Sample Package for MWS Report</h3>
<p>To make things simple we have created a demo package &#8211; ready to go.<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2016/10/Amazon_MWS_API_GetReport_2012.zip">Download SSIS 2012 Demo &#8211; Amazon_MWS_API_GetReport_2012</a>.</p>
<h3>Prepare demo package for first run</h3>
<p>Once you download and extract above sample package. Import to your existing SSIS Solution. Its SSIS 2012 format so it may upgrade to higher version if you using SSIS 2014, 2016 or 2017.</p>
<p>Once package is opened perform following steps in before you can execute the package.</p>
<ol>
<li>Enter MarketplaceId, SellerId in Variables. Double click OAuth Connection and enter your MWS Account Key and Secret.</li>
<li>Create c:\temp directory (This is where we will save final report file)</li>
<li>Run this package</li>
<li>Go to Execution log and Find ReportId (This you can hardcode in Variables for Design time Preview / Metadata changes etc)</li>
</ol>
<p>See below package screenshot</p>
<div id="attachment_7128" style="width: 794px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-report-csv-xml-format.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7128" class="size-full wp-image-7128" src="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-report-csv-xml-format.png" alt="Read data from Amazon MWS Report in SSIS (Get Inventory Listing Example)" width="784" height="752" srcset="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-report-csv-xml-format.png 784w, https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-report-csv-xml-format-300x288.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-report-csv-xml-format-768x737.png 768w" sizes="(max-width: 784px) 100vw, 784px" /></a><p id="caption-attachment-7128" class="wp-caption-text">Read data from Amazon MWS Report in SSIS (Get Inventory Listing Example)</p></div>
<h3>Steps Explained</h3>
<p>Now lets see each steps in depth. We broken whole process in 3 groups.</p>
<h4>Create Report Request (Step1)</h4>
<p>This is the first step how you initiate report request.  Use <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/">REST API Task</a> to call this step. Here is raw request. Many items in body added at runtime (e.g. Signature, Timestamp).</p>
<ul>
<li>On Request tab see how we used SSIS Variables to get many values at runtime dynamically.</li>
<li>On Response Tab we have to extract RequestId and save into variable.</li>
</ul>
<pre class="crayon-plain-tag">POST 
https://mws.amazonservices.com/Reports/2009-01-01

AWSAccessKeyId=Axxxxxxxxx&amp;Action=RequestReport&amp;MarketplaceId=ATVPDKIKX0DER&amp;ReportType=_GET_MERCHANT_LISTINGS_DATA_&amp;SellerId=Axxxxxxxxx&amp;SignatureMethod=HmacSHA256&amp;SignatureVersion=2&amp;Timestamp=2019-06-05T21%3A23%3A31.090Z&amp;Signature=2AbGQQ4xxxxxxxxxxxxxxxxxxxxjJzox%2FU%3D</pre>
<div id="attachment_7129" style="width: 869px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-call-report-request.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7129" class="size-full wp-image-7129" src="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-call-report-request.png" alt="RequestReport Action - Generate Amazon MWS Custom Report" width="859" height="628" srcset="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-call-report-request.png 859w, https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-call-report-request-300x219.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-amazon-mws-call-report-request-768x561.png 768w" sizes="(max-width: 859px) 100vw, 859px" /></a><p id="caption-attachment-7129" class="wp-caption-text">RequestReport Action &#8211; Generate Amazon MWS Custom Report</p></div>
<div id="attachment_7130" style="width: 681px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-rest-api-response-extract-xml-value-xpath-expression.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7130" class="size-full wp-image-7130" src="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-rest-api-response-extract-xml-value-xpath-expression.png" alt="Extract value from XML response using XPATH and save to Variable (Get RequestId Example)" width="671" height="389" srcset="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-rest-api-response-extract-xml-value-xpath-expression.png 671w, https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-rest-api-response-extract-xml-value-xpath-expression-300x174.png 300w" sizes="(max-width: 671px) 100vw, 671px" /></a><p id="caption-attachment-7130" class="wp-caption-text">Extract value from XML response using XPATH and save to Variable (Get RequestId Example)</p></div>
<p>Here is how to configure above task</p>
<ol>
<li></li>
</ol>
<h4>Wait until data is ready (Step2)</h4>
<p>Once we send RepotRequest and we have RequestId we can call step2 using REST API Task. In this Task we can use Status Check Feature. This is pretty handy feature because we dont have to implement Loop in SSIS. Basically we have to keep checking report until we get _DONE_ status in the response (ReportProcessingStatus node in XML)</p>
<p>Here is how to configure the task.</p>
<ol>
<li>Request Tab Configuration.<br />
<strong>URL:</strong> <pre class="crayon-plain-tag">https://mws.amazonservices.com/Reports/2009-01-01</pre>
<strong>Method:</strong> POST<br />
<strong>Body:</strong> <pre class="crayon-plain-tag">Action=GetReportRequestList&amp;ReportRequestIdList.Id.1={{User::ReportRequestId}}&amp;MarketplaceId={{User::MarketplaceId}}&amp;SellerId={{User::SellerId}}</pre></li>
<li>Response Setting Tab Configuration<br />
<strong>Response content type:</strong> Xml<br />
<strong>Filter Expression:</strong>  <pre class="crayon-plain-tag">//*[local-name() = 'ReportProcessingStatus']  </pre></li>
<li>Status Check Tab<br />
<strong>Check Enable Status</strong><br />
<strong>Success Value:</strong>  <pre class="crayon-plain-tag">_DONE_</pre>
Check Every <strong>5</strong> Seconds</li>
</ol>
<div id="attachment_7131" style="width: 678px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-rest-api-task-status-check-wait-until-ready-loop.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7131" class="size-full wp-image-7131" src="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-rest-api-task-status-check-wait-until-ready-loop.png" alt="REST API Task - Status Check Feature (Wait until data is ready loop)" width="668" height="610" srcset="https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-rest-api-task-status-check-wait-until-ready-loop.png 668w, https://zappysys.com/blog/wp-content/uploads/2016/10/ssis-rest-api-task-status-check-wait-until-ready-loop-300x274.png 300w" sizes="(max-width: 668px) 100vw, 668px" /></a><p id="caption-attachment-7131" class="wp-caption-text">REST API Task &#8211; Status Check Feature (Wait until data is ready loop)</p></div>
<h4>GetReportId (Step3)</h4>
<p>Once above task finished we can call same request again but this time we have to configure slightly different way.</p>
<p>Here is how to configure the task.</p>
<ol>
<li>Request Tab Configuration.<br />
<strong>URL:</strong> <pre class="crayon-plain-tag">https://mws.amazonservices.com/Reports/2009-01-01</pre>
<strong>Method:</strong> POST<br />
<strong>Body:</strong> <pre class="crayon-plain-tag">Action=GetReportRequestList&amp;ReportRequestIdList.Id.1={{User::ReportRequestId}}&amp;MarketplaceId={{User::MarketplaceId}}&amp;SellerId={{User::SellerId}}</pre></li>
<li>Response Setting Tab Configuration<br />
<strong>Response content type:</strong> Xml<br />
<strong>Filter Expression:</strong>  <pre class="crayon-plain-tag">//*[local-name() = 'GeneratedReportId']  </pre>
<strong>Check Save to Variable: </strong>Save to <strong>User::ReportId</strong></li>
<li>Status Check Tab<br />
<strong>Make Enable Status is unchecked</strong></li>
</ol>
<h4>Get Report Data  (Step4,Step5 or Step6)</h4>
<p>Now we are ready to ready our report. There are two ways we can do in SSIS.</p>
<ul>
<li>First approach (step 4,5) is download the report and save to local disk and then in the next step we can use data flow (CSV Source) to parse the saved file.</li>
<li>Second approach (step6) is rather than saving to disk we can directly call API using CSV File source and parse content that way. Lets talk each approach briefly.</li>
</ul>
<h5>Step4,5 &#8211; Load Report From File</h5>
<p>If you wish to save Report on disk then you can use REST API Task and call request like below.</p>
<p>Here is how to configure the task to download the file.</p>
<ol>
<li>Request Tab Configuration.<br />
<strong>URL:</strong> <pre class="crayon-plain-tag">https://mws.amazonservices.com/Reports/2009-01-01</pre>
<strong>Method:</strong> POST<br />
<strong>Body:</strong> Action=GetReport&amp;ReportId={{User::ReportId}}&amp;MarketplaceId={{User::MarketplaceId}}&amp;SellerId={{User::SellerId}}</li>
<li>Response Setting Tab Configuration<br />
<strong>Response content type:</strong> Xml<br />
<strong>Filter Expression:</strong>  <pre class="crayon-plain-tag">//*[local-name() = 'GeneratedReportId']  </pre>
<strong>Check Save to Variable: </strong>Save to <strong>User::ReportId<br />
</strong></li>
<li>On Response Settings Tab : Set Response charset to <strong>Western European [Windows 1252]</strong>  (or directly set via Properties Grid to <strong>Windows-1252</strong> under ResponseCharset Property)<strong><br />
</strong></li>
<li>Status Check Tab<br />
<strong>Make Enable Status is unchecked</strong></li>
</ol>
<p>To read download CSV file use settings described in below section except URL change it with local file path.</p>
<h5>Step6 &#8211; Load report from URL</h5>
<p>If you wish to load directly from URL then use same setting as above but in CSV Source inside data flow.</p>
<p>Here is how to configure CSV Source.</p>
<ol>
<li>Request Tab Configuration.<br />
<strong>URL:</strong> <pre class="crayon-plain-tag">https://mws.amazonservices.com/Reports/2009-01-01</pre>
<strong>Method:</strong> POST<br />
<strong>Body:</strong> <pre class="crayon-plain-tag">Action=GetReport&amp;ReportId={{User::ReportId}}&amp;MarketplaceId={{User::MarketplaceId}}&amp;SellerId={{User::SellerId}} </pre></li>
<li>General Tab<br />
<strong>Column Delimiter:</strong> {TAB}</li>
<li>On Encoding Tab : Set to Western European [Windows 1252]  (or directly set via Properties Grid to <strong>Windows-1252</strong> under CharacterSet Property)</li>
</ol>
<h2>Conclusion</h2>
<p>Amazon Marketplace Web service (MWS) provides great way to automate many functionality for Marketplace Seller. Using ZappySys <a href="//zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> you con consume data from any REST API or Web service without replying on SDK / coding approach (e.g. C#, Java, Python, Ruby).</p>
<p>The post <a href="https://zappysys.com/blog/call-amazon-mws-api-using-ssis-marketplace-web-service/">How to call Amazon MWS API using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
