<?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>paging Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/paging/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/paging/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Thu, 19 Mar 2026 23:09:47 +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>paging Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/paging/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<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 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 fetchpriority="high" 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>
		<item>
		<title>How to do REST API Pagination in SSIS / ODBC Drivers</title>
		<link>https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/</link>
					<comments>https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/#comments</comments>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 08 Apr 2016 15:37:55 +0000</pubDate>
				<category><![CDATA[SSIS Components]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[SSIS XML Source (File / SOAP)]]></category>
		<category><![CDATA[api pagination]]></category>
		<category><![CDATA[json source]]></category>
		<category><![CDATA[looping]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[paging]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[xml source]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=422</guid>

					<description><![CDATA[<p>Introduction In our previous blog, we saw how to call REST in SSIS including concepts of Authentication / Error Handling. Now in this post, we will cover API Pagination. You will learn concepts and patterns about REST API Pagination (for JSON / XML / SOAP or CSV API). We will describe methods and steps to implement REST API [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/">How to do REST API Pagination in SSIS / ODBC Drivers</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 blog, we saw <a href="https://zappysys.com/blog/call-rest-api-using-ssis-web-service-task/">how to call REST in SSIS</a> including concepts of Authentication / Error Handling. Now in this post, <strong>we will cover API Pagination.</strong> You will learn concepts and patterns about REST API Pagination (for JSON / XML / SOAP or CSV API).</p>
<p>We will describe methods and steps to implement REST API Pagination in SSIS PowerPack or  <a href="https://zappysys.com/products/odbc-powerpack/">ODBC PowerPack API Drivers (for apps like Excel, Power BI, Informatica&#8230;)</a> without coding. Both Products share a similar user interface with minor differences. For example purpose, we will show screenshots from SSIS PowerPack UI but concepts should remain same. You will also learn some techniques about <strong>how to implement an infinite loop in SSIS</strong>. Sometimes your REST API requires you to loop through all pages until no more data found then you can use pattern described in this article (sample package attached at the end).</p>
<p>In this article, we will use <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/">SSIS REST API Task</a> and <a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/">JSON Source Connector</a> to process data from RESTful web service. If you have to process XML (or SOAP) data from REST API then simply use <a href="//zappysys.com/products/ssis-powerpack/ssis-xml-source/">XML Source Connector for REST API, SOAP or File</a> rather than JSON Source.</p>
<h2>Debugging REST API Requests</h2>
<p>Before we look at various aspects of REST API Pagination, we highly recommend you install FREE Web Debugging Tool Fiddler. <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">Look at this article</a> to understand how to debug REST API requests.</p>
<h2>Method-1: REST API Pagination via URL Parameter</h2>
<p>If you have paging requirement by specifying page number in URL then you can loop until no more pages found. Your REST API can indicate no more page found by any of the following ways.</p>
<p><strong>Example URL: </strong> http://myserver.com/v1/api/getcustomers/?<strong>page=1</strong></p>
<p>If no more data found for specified page number then</p>
<ol>
<li>server may return an empty response</li>
<li>server may return the response with specific error and response status code</li>
</ol>
<p><a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/">JSON Source Connector</a> comes with flexible paging options to handle this scenario. See below screenshot how to configure this.</p>
<div id="attachment_10740" style="width: 777px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-1-JSON-source-Pagination-URL-parameter-mode.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10740" class="size-full wp-image-10740" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-1-JSON-source-Pagination-URL-parameter-mode.png" alt="Pagination Method 1 URL parameter mode" width="767" height="730" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-1-JSON-source-Pagination-URL-parameter-mode.png 767w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-1-JSON-source-Pagination-URL-parameter-mode-300x286.png 300w" sizes="(max-width: 767px) 100vw, 767px" /></a><p id="caption-attachment-10740" class="wp-caption-text">REST API Looping/Pagination via URL Page Number Parameter (Loop until last page detected)</p></div>
<p><strong>URL with offset and limit</strong></p>
<p>Sometimes you may have URLs with offset + limit parameters. as below. In this case, you can use the same technique as the above screenshot but just specify Page Num Indicator as <strong>offset</strong> and Increment by the same as your limit parameter (e.g. 1000 in this case). At runtime, your offset parameter will increment and generate URLs like below to fetch the next page.</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;">If you don&#8217;t specify the offset parameter in the initial URL then <strong>offset=1</strong> will be assumed as the default start. If your offset starts at 0 then refer to the next section for a workaround (i.e. Use URL Path Mode with StartAt variable = 0). Also if your increment for offset is other than the default page size then you must include the limit / pagesize parameter in the URL as below (e.g. limit=100 which is rows per page)</div></div>
<p><strong>Example URLs: </strong><br />
http://myserver.com/v1/api/getcustomers/?offset<strong>=1</strong>&amp;limit=1000<br />
http://myserver.com/v1/api/getcustomers/?offset=<strong>1001</strong>&amp;limit=1000<br />
http://myserver.com/v1/api/getcustomers/?offset=<strong>2001</strong>&amp;limit=1000</p>
<h2>Method-2: REST API Pagination via URL Path</h2>
<p>Sometimes your URL may contain a page or other identifier using path format.</p>
<p><strong>Example URLs: </strong><br />
http://myserver.com/v1/api/getcustomers/<strong>1/</strong><br />
http://myserver.com/v1/api/getcustomers/<strong>2</strong>/<br />
http://myserver.com/data/file<strong>1</strong>.json<br />
http://myserver.com/data/file<strong>2</strong>.json</p>
<p>If no more data is found for the specified page number then</p>
<ol>
<li>the server may return a 404 error (page not found)</li>
<li>server may return a response with a specific error and response status code</li>
</ol>
<p><a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/">JSON Source Connector</a> comes with flexible paging options to handle this scenario. See the below screenshot of how to configure this.</p>
<div id="attachment_10741" style="width: 785px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-2-JSON-source-Pagination-URL-path-mode-Page-number-offset-passed-as-URL-path.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10741" class="size-full wp-image-10741" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-2-JSON-source-Pagination-URL-path-mode-Page-number-offset-passed-as-URL-path.png" alt="Pagination Method 2 " width="775" height="479" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-2-JSON-source-Pagination-URL-path-mode-Page-number-offset-passed-as-URL-path.png 775w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-2-JSON-source-Pagination-URL-path-mode-Page-number-offset-passed-as-URL-path-300x185.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-2-JSON-source-Pagination-URL-path-mode-Page-number-offset-passed-as-URL-path-768x475.png 768w" sizes="(max-width: 775px) 100vw, 775px" /></a><p id="caption-attachment-10741" class="wp-caption-text">REST API Looping/Pagination via URL Path (Loop until last page detected)</p></div>
<h3>URL with Skip Parameter (Offset starts at zero)</h3>
<p>Now let&#8217;s look at another common pattern just like the offset we discussed earlier but in the Skip pattern, it starts at zero rather than offset=1. In the previous mode, we didn&#8217;t have the option to supply the initial value to start the counter but if you use Path mode then you can start the counter at some custom value. See the below screen to show how we can setup pagination with the skip method with custom increment.</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;">If your increment for offset is other than the default page size then you must include page size parameter in the URL as below (e.g. pagesize=100 which is rows per page. Some APIs name this parameter in different way e.g. count=1000 or limit=100. Refer to the API documentation to know exact names)</div></div>
<p><strong>Example URLs</strong></p><pre class="crayon-plain-tag">http://mysite.com/api/getorders?skip=0&amp;pagesize=100
http://mysite.com/api/getorders?skip=100&amp;pagesize=100
http://mysite.com/api/getorders?skip=200&amp;pagesize=100
http://mysite.com/api/getorders?skip=300&amp;pagesize=100
....</pre><p>
<div id="attachment_10742" style="width: 1098px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-2-Pagination-URL-with-Skip-Parameter.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10742" class="size-full wp-image-10742" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-2-Pagination-URL-with-Skip-Parameter.png" alt="Pagination method 2 URL with Skip Parameter" width="1088" height="481" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-2-Pagination-URL-with-Skip-Parameter.png 1088w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-2-Pagination-URL-with-Skip-Parameter-300x133.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-2-Pagination-URL-with-Skip-Parameter-768x340.png 768w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-2-Pagination-URL-with-Skip-Parameter-1024x453.png 1024w" sizes="(max-width: 1088px) 100vw, 1088px" /></a><p id="caption-attachment-10742" class="wp-caption-text">REST API Pagination with Custom Skip / Increment Settings (Offset Starts from 0)</p></div>
<p>&nbsp;</p>
<h2>Method-3 : REST API Pagination via Response Attribute (Next Link or Cursor)</h2>
<p>This method is not discussed in this article but <a href="https://zappysys.com/blog/odata-paging-rest-api-paging-using-ssis-json-source/" target="_blank" rel="noopener">click here to read more</a></p>
<p>There are mainly 3 ways you can get next link or cursor.</p>
<ol>
<li>Full Link (e.g. nextPage : &#8220;https://mysite.com/api/v1/1/?filter=AAAA&#8221; )</li>
<li>Partial Link  (e.g. nextPage : &#8220;/api/v1/getcustomer/1/?filter=AAAA&#8221; )</li>
<li>Cursor Continuation Token (e.g.   nextCursor : &#8220;xxxxAAAbbbbCccc112233==&#8221; )</li>
</ol>
<h3>Next Link Method (Partial or Full URL)</h3>
<p>Example response with next URL would be</p><pre class="crayon-plain-tag">{ 
  "value" : [....], 
  "odata.nextLink" : "http://abc.com/customers/2/" 
}</pre><p>
In this method you don&#8217;t specify page number in URL. If response include many records then you will get partial response along with indicator of next link.</p>
<p>For more information about this <em>REST API Pagination</em> please check below links. It explains in depth how to paginate REST API response with next page link found in response.</p>
<p><a title="Permalink to OData Paging using SSIS – REST API Paging Example" href="//zappysys.com/blog/odata-paging-rest-api-paging-using-ssis-json-source/" rel="bookmark">OData Paging using SSIS – REST API Paging Example</a></p>
<p><a title="Permalink to Read Twitter data in SSIS using REST API Task and JSON Source – OAuth2 Protocol" href="//zappysys.com/blog/read-twitter-data-in-ssis-using-rest-api-task-json-source-oauth2/#Handling_paging_of_large_REST_API_result_set_with_twitter_data_8211_loopingcursoring" rel="bookmark">Read Twitter data in SSIS using REST API Task and JSON Source – OAuth2 Protocol</a></p>
<div id="attachment_10743" style="width: 706px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-3-Pagination-via-Response-Attribute-Next-Link-or-Cursor.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10743" class="size-full wp-image-10743" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-3-Pagination-via-Response-Attribute-Next-Link-or-Cursor.png" alt="Method-3: Next Link Method (Partial or Full URL)" width="696" height="557" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-3-Pagination-via-Response-Attribute-Next-Link-or-Cursor.png 696w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-3-Pagination-via-Response-Attribute-Next-Link-or-Cursor-300x240.png 300w" sizes="(max-width: 696px) 100vw, 696px" /></a><p id="caption-attachment-10743" class="wp-caption-text">SSIS API Pagination – Next Link from Response Attribute</p></div>
<h3>Next Link &#8211; Detect the last page based on empty rows (Regular Expression)</h3>
<p>Now let&#8217;s look at a little bit different scenario where the Next Link is never empty even on the last page. This can cause an infinite loop if we configure it like the last section. So in such a case (see below example) when the last page still has the next link URL but the data row array is empty then use settings like the screenshot below.</p>
<p><strong>First Page Example</strong></p><pre class="crayon-plain-tag">{ 
  "value" : [....], 
  "odata.nextLink" : "http://abc.com/customers/2/" 
}</pre><p>
<strong>Last Page Example</strong></p><pre class="crayon-plain-tag">{ 
  "value" : [], 
  "odata.nextLink" : "http://abc.com/customers/NNNN/" 
}</pre><p>
<strong>Example: Last Page</strong></p>
<p>Basically, configure the following options</p>
<ul>
<li>Set <b>Stop indicator attribute</b> to the same node which contains data rows (without array brackets). E.g. <strong>$.items</strong></li>
<li>Set <b>Stop indicator value / Regular Expression </b>to something like <pre class="crayon-plain-tag">[]</pre>  assuming the last page has the same way. <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">Check Fiddler Trace</a> for exact text on the last page.</li>
</ul>
<div id="attachment_10744" style="width: 678px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-3-Pagination-Detect-the-last-page-based-on-empty-rows.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10744" class="size-full wp-image-10744" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-3-Pagination-Detect-the-last-page-based-on-empty-rows.png" alt="Method-3 Detect the last page based on empty rows " width="668" height="399" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-3-Pagination-Detect-the-last-page-based-on-empty-rows.png 668w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-3-Pagination-Detect-the-last-page-based-on-empty-rows-300x179.png 300w" sizes="(max-width: 668px) 100vw, 668px" /></a><p id="caption-attachment-10744" class="wp-caption-text">Last Page with non empty next link and empty data array (Detect Last Page based on zero row count)</p></div>
<h3>Cursor Method</h3>
<p>Many API returns cursor rather than link. Cursor method usually used to support a large number of records. Cursor is opened at server side with initial query information you submit and if cursor has more records you may get next cursor indicator in your response. In cursor method you have to supply Suffix for Next URL so after First URL your next URL will contain extra attribute which will include pagination information.</p>
<p><strong>Suffix for next URL</strong></p>
<p>Suffix for next URL can include special placeholders. There are two placeholders allowed. If you wish to append Next URL value in raw text then use <strong>&lt;%nextlink%&gt;</strong> but if your API needs value in encoded format e.g. A%20B rather than A+B then you have to use <strong>&lt;%nextlink_encoded%&gt;</strong></p>
<p><strong>Example URLs for Cursor:</strong></p>
<p>Below is few sample URLs in the log when pagination occurs via Cursor method. As you see the first URL has Cursor=* means its first call, after first request server may send next cursor in the response body (see example)</p><pre class="crayon-plain-tag">{ 
&nbsp; data: [....], 
&nbsp; nextCursor: &quot;Aooo/MxxxxxxxxxxxtdA==&quot; 
}</pre><p>
First URL: http://api.crossref.org/members/311/works?filter=type:journal-article&amp;rows=100&amp;cursor=*<br />
Second URL: http://api.crossref.org/members/311/works?filter=type:journal-article&amp;rows=100&amp;cursor=Aooo/MxxxxxxxxxxxtdA==<br />
Third URL: http://api.crossref.org/members/311/works?filter=type:journal-article&amp;rows=100&amp;cursor=Booo/MxxxxxxxxxxxtdA==<br />
&#8230;..<br />
&#8230;..</p>
<h2>Method-4: Pass Page Number in Body Attribute</h2>
<p>Some API allows you to pass your PageSize and Page number inside Request Body (i.e. POST data) in that case you may configure your options like below (We used Google AdWords Api as an example)</p>
<div id="attachment_10745" style="width: 838px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-4-pagination.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10745" class="size-full wp-image-10745" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-4-pagination.png" alt="Method-4 Pass Page Number in Body Attribute" width="828" height="735" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-4-pagination.png 828w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-4-pagination-300x266.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-4-pagination-768x682.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-10745" class="wp-caption-text">Configure REST API Pagination – using Page Number via POST Body Method</p></div>
<div id="attachment_10746" style="width: 838px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-4-Settings.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10746" class="size-full wp-image-10746" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-4-Settings.png" alt="Method-4: Pass Page Number in Body Attribute example" width="828" height="735" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-4-Settings.png 828w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-4-Settings-300x266.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-4-Settings-768x682.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-10746" class="wp-caption-text">REST API Pagination – Passing PageNumber inside POST Body (Example: Google AdWords SOAP API)</p></div>
<h2>Method-5: REST API Pagination via multiple URL parameters (e.g. Start and End)</h2>
<p>In the previous section, you saw how to pass page numbers via URL (Single Parameter: http://abc.com/?page=1). However, sometimes you have a pagination requirement where you have to specify multiple parameters that need increment. See below example URL.</p><pre class="crayon-plain-tag">http://abc.com/?startRow=1&amp;endRow=100
http://abc.com/?startRow=101&amp;endRow=200
http://abc.com/?startRow=201&amp;endRow=300
...</pre><p>
<div id="attachment_10747" style="width: 838px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-5-pagination.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10747" class="size-full wp-image-10747" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-5-pagination.png" alt="Method-5: REST API Pagination via multiple URL parameters (e.g. Start and End)" width="828" height="478" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-5-pagination.png 828w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-5-pagination-300x173.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-5-pagination-768x443.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-10747" class="wp-caption-text">Pagination via Multiple URL Parameters</p></div>
<h2>Method-6: REST API Pagination via Header (Next Link in Header)</h2>
<p>Another popular pagination method is paginate via Header. In this method, each API response includes special Header which indicates next link for your response. In header method there are two approaches. [1] Custom Method [2] RFC 5988 Method. Lets look at both.</p>
<h3>Next Link in Custom Header</h3>
<p>In this method you have to specify which response header contains next URL. When no more NEXT url found in response reader stops.</p>
<div id="attachment_10749" style="width: 650px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-6-REST-API-Pagination-via-Header.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10749" class="size-full wp-image-10749" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-6-REST-API-Pagination-via-Header.png" alt="Method 6 REST API Pagination via Headers" width="640" height="213" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-6-REST-API-Pagination-via-Header.png 640w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-6-REST-API-Pagination-via-Header-300x100.png 300w" sizes="(max-width: 640px) 100vw, 640px" /></a><p id="caption-attachment-10749" class="wp-caption-text">Custom Header Pagination Method</p></div>
<h3>Next Link in Header as per RFC 5988</h3>
<p>In this method, HTTP response contains a special header (Link) which contains next link for our response. If no link found to read more data then reader stops. This method is described well here in <a href="https://tools.ietf.org/html/rfc5988" target="_blank" rel="noopener">RFC 5988</a>. Check this <a href="https://developer.github.com/v3/guides/traversing-with-pagination/" target="_blank" rel="noopener">GitHub API Example</a> to understand more on this pagination method.</p>
<div id="attachment_10751" style="width: 696px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-6-Next-Link-in-Header-as-per-RFC-5988.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10751" class="size-full wp-image-10751" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-6-Next-Link-in-Header-as-per-RFC-5988.png" alt="Method 6 Next Link in Header as per RFC 5988" width="686" height="144" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-6-Next-Link-in-Header-as-per-RFC-5988.png 686w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-6-Next-Link-in-Header-as-per-RFC-5988-300x63.png 300w" sizes="(max-width: 686px) 100vw, 686px" /></a><p id="caption-attachment-10751" class="wp-caption-text">Link Header Pagination Method (RFC 5988)</p></div>
<h2>Method-7: REST API Pagination using Cursor / Continuation Token from Response Header</h2>
<p>There will be a time when your API sends some sort of Continuation Token in Response Header and you have to use that token to call next request. Some API needs this token passed as query string in Next URL and in some API you have to pass as request header. We will cover both cases in the following section.</p>
<p>Your API might call these tokens as &#8220;Cursor&#8221; too so we will use these both terms in the following section (They both mean same thing).</p>
<p>There are few ways these APIs pass Cursor to the next request</p>
<ol>
<li>Pass Cursor via Request Header with <strong>same header name</strong></li>
<li>Pass Cursor via Request Header with <strong>different header name (introduced in v4.2.3)</strong></li>
<li>Pass multiple Response Headers via Request Headers (Azure DocumentDB style usecase)</li>
<li>Pass Cursor via URL Query String Parameter (<strong>introduced in v3.0 or later</strong>)</li>
</ol>
<p>Lets see all approaches.</p>
<h3>Pass Token via Request Header (Same header name)</h3>
<p>Consider the API pagination use case in which you get some sort of continuation token in the response header and you take it and pass in the next request via request header (same header name).</p>
<p>Example:</p>
<p><strong>First Request / Response:</strong></p><pre class="crayon-plain-tag">------- Request ------
GET https://abc.com/api/getdata

------- Response ------
x-token: Nxdfabcd11111

{ some response data }</pre><p>
<strong>Second Request / Response:</strong></p><pre class="crayon-plain-tag">------- Request ------
GET https://abc.com/api/getdata
x-token: Nxdfabcd11111

------- Response ------
x-token: Nxdfabcd22222

{ some response data }</pre><p>
&#8230;&#8230;</p>
<p>&#8230;&#8230;</p>
<p><strong>Last Request / Response:</strong></p><pre class="crayon-plain-tag">------- Request ------
GET https://abc.com/api/getdata
x-token: Nxdfabcd22222

------- Response ------

{ some response data }</pre><p>
For above pagination pattern  that just enter the response header name in <strong>Page Num Indicator</strong> field as below</p>
<div id="attachment_10752" style="width: 697px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Pass-Token-via-Request-Header.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10752" class="size-full wp-image-10752" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Pass-Token-via-Request-Header.png" alt="Method 7 Pass Token via Request Header" width="687" height="126" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Pass-Token-via-Request-Header.png 687w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Pass-Token-via-Request-Header-300x55.png 300w" sizes="(max-width: 687px) 100vw, 687px" /></a><p id="caption-attachment-10752" class="wp-caption-text">Pagination using response header continuation token – Pass as Request Header</p></div>
<p>All possible formats for Page Num Indicator is below</p>
<p>x-page-token<br />
x-token1, x-token2<br />
RequestUrlQueryName=ResponseHeaderName<br />
header::RequestHeaderName=ResponseHeaderName<br />
RequestUrlQueryName=ResponseHeaderName(regular-expression)</p>
<h3>Pass Token via Request Header (Different header name)</h3>
<p>Consider the API pagination use case just like previous one but only different is request header name is not same as response header name. For example rather than x-token in request we need to call it x-next-token.</p>
<p>Example:</p>
<p><strong>First Request / Response:</strong></p><pre class="crayon-plain-tag">------- Request ------
GET https://abc.com/api/getdata

------- Response ------
x-token: Nxdfabcd11111

{ some response data }</pre><p>
<strong>Second Request / Response:</strong></p><pre class="crayon-plain-tag">------- Request ------
GET https://abc.com/api/getdata
x-next-token: Nxdfabcd11111

------- Response ------
x-token: Nxdfabcd22222

{ some response data }</pre><p>
&#8230;&#8230;</p>
<p>&#8230;&#8230;</p>
<p><strong>Last Request / Response:</strong></p><pre class="crayon-plain-tag">------- Request ------
GET https://abc.com/api/getdata
x-next-token: Nxdfabcd22222

------- Response ------

{ some response data }</pre><p>
For above pagination pattern  that just enter the response header name in <strong>Page Num Indicator</strong> field as below</p>
<div id="attachment_10753" style="width: 702px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-6-Pass-Token-via-Request-Header.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10753" class="size-full wp-image-10753" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-6-Pass-Token-via-Request-Header.png" alt="Method 7 Pass Token via Request Header " width="692" height="197" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-6-Pass-Token-via-Request-Header.png 692w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-6-Pass-Token-via-Request-Header-300x85.png 300w" sizes="(max-width: 692px) 100vw, 692px" /></a><p id="caption-attachment-10753" class="wp-caption-text">Pagination using response header continuation token – Pass as Request Header (Different name)</p></div>
<h3>Pass multiple Response Headers via Request Headers (Azure DocumentDB style usecase)</h3>
<p>Some API like <a href="https://docs.microsoft.com/en-us/rest/api/cosmos-db/list-documents" target="_blank" rel="noopener">Azure Cosmos DB</a> uses Continuation Token via Header approach. In that case you can enter single header name or multiple headers like below (For multiple headers use comma)</p>
<div id="attachment_10754" style="width: 687px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Pass-multiple-Response-Headers-via-Request-Headers-Azure-DocumentDB-style-usecase.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10754" class="size-full wp-image-10754" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Pass-multiple-Response-Headers-via-Request-Headers-Azure-DocumentDB-style-usecase.png" alt="Method 7 Pass multiple Response Headers via Request Headers" width="677" height="207" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Pass-multiple-Response-Headers-via-Request-Headers-Azure-DocumentDB-style-usecase.png 677w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Pass-multiple-Response-Headers-via-Request-Headers-Azure-DocumentDB-style-usecase-300x92.png 300w" sizes="(max-width: 677px) 100vw, 677px" /></a><p id="caption-attachment-10754" class="wp-caption-text">REST API Pagination using Continuation Token via Header (Azure CosmosDB / DocumentDB API Example )</p></div>
<p>You can use use tools <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">like Fiddler</a> to see paginated requests as below.</p>
<p><strong>First Request</strong></p>
<div id="attachment_10755" style="width: 953px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Fiddler-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10755" class="size-full wp-image-10755" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Fiddler-1.png" alt="Method 7 fiddler example 1" width="943" height="777" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Fiddler-1.png 943w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Fiddler-1-300x247.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Fiddler-1-768x633.png 768w" sizes="(max-width: 943px) 100vw, 943px" /></a><p id="caption-attachment-10755" class="wp-caption-text">View Paginated Requests in Fiddler (Azure CosmosDB API Example)</p></div>
<p><strong>Second Request</strong></p>
<div id="attachment_10756" style="width: 1044px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Fiddler-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10756" class="size-full wp-image-10756" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Fiddler-2.png" alt="Method 7 fiddler reuqest 2 " width="1034" height="785" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Fiddler-2.png 1034w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Fiddler-2-300x228.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Fiddler-2-768x583.png 768w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-Fiddler-2-1024x777.png 1024w" sizes="(max-width: 1034px) 100vw, 1034px" /></a><p id="caption-attachment-10756" class="wp-caption-text">Pass Next Page Token via Header (View Paginated Requests in Fiddler – Azure CosmosDB API Example)</p></div>
<h3>Pass Token via URL Parameter (Query String)</h3>
<p>In the new version we added a feature where you can actually read Continuation Token (i.e. Cursor) from Response Header and then pass to next request in the URL rather than Request Header. Here is the <a href="https://api.rosnet.com/#tag/Checks" target="_blank" rel="noopener">example API</a> which uses such method.</p>
<p><strong>First Request</strong></p><pre class="crayon-plain-tag">--------- Request ---------
GET
http://test.com/api/getdata

--------- Response ---------
X-RESPONSE-TOKEN : Pg2xxxxxxxxxxxxxxxxx

{ data : [ 1,2,3.... 10 ] }</pre><p>
<strong>Second Request </strong></p><pre class="crayon-plain-tag">--------- Request ---------
GET
http://test.com/api/getdata?cursor=Pg2xxxxxxxxxxxxxxxxx

--------- Response ---------
X-RESPONSE-TOKEN : Pg3xxxxxxxxxxxxxxxxx

{ data : [ 11,12,13.... 20 ] }</pre><p>
Here is how to configure above pagination pattern</p>
<div id="attachment_10759" style="width: 706px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-6-Pass-Token-via-URL-Parameter.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10759" class="size-full wp-image-10759" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-6-Pass-Token-via-URL-Parameter.png" alt="Method 7 Pass Token via URL Parameter (Query String)" width="696" height="148" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-6-Pass-Token-via-URL-Parameter.png 696w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-6-Pass-Token-via-URL-Parameter-300x64.png 300w" sizes="(max-width: 696px) 100vw, 696px" /></a><p id="caption-attachment-10759" class="wp-caption-text">Pass Response Header value to URL (Cursor)</p></div>
<h3>Pass Token via URL Parameter (Query String) &#8211; with custom Regular expression (Usecase: Salesforce BULK query API)</h3>
<p>Now consider previous scenario but with slightly different requirement. By default previous pagination pattern stops when specified response header is missing or response header value is blank. However is some cases header value contains custom string to indicate last page. For example x-token: NULL. In such case we need to use <strong>Page Num Indicator</strong> like below (must use v4.2.3 or higher in SSIS PowerPack / 1.5.2 or higher in ODBC PowerPack)</p><pre class="crayon-plain-tag">nextUrlParameterName=responseHeadername(Some_Regular_Expression)</pre><p>
For example to stop pagination in below case you have to enter Page Num Indicator as below. It says stop pagination when  &#8220;NULL&#8221; word is detected</p><pre class="crayon-plain-tag">cursor=X-RESPONSE-TOKEN(^((?!NULL\b).)*$)</pre><p>
&nbsp;</p>
<p><strong>First Request</strong></p><pre class="crayon-plain-tag">--------- Request ---------
GET
http://test.com/api/getdata

--------- Response ---------
X-RESPONSE-TOKEN : Pg2xxxxxxxxxxxxxxxxx

{ data : [ 1,2,3.... 10 ] }</pre><p>
<strong>Second Request </strong></p><pre class="crayon-plain-tag">--------- Request ---------
GET
http://test.com/api/getdata?cursor=Pg2xxxxxxxxxxxxxxxxx

--------- Response ---------
X-RESPONSE-TOKEN : Pg3xxxxxxxxxxxxxxxxx

{ data : [ 11,12,13.... 20 ] }</pre><p>
&#8230;&#8230;</p>
<p>&#8230;&#8230;</p>
<p><strong>Last Request </strong></p><pre class="crayon-plain-tag">--------- Request ---------
GET
http://test.com/api/getdata?cursor=Pg3xxxxxxxxxxxxxxxxx

--------- Response ---------
X-RESPONSE-TOKEN : NULL

{ data : [ 21,22,23.... 30 ] }</pre><p>
Here is how to configure above pagination pattern</p>
<div id="attachment_10761" style="width: 706px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-with-custom-Regular-expression.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10761" class="size-full wp-image-10761" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-with-custom-Regular-expression.png" alt="Method 7 with custom Regular expression" width="696" height="156" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-with-custom-Regular-expression.png 696w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-7-with-custom-Regular-expression-300x67.png 300w" sizes="(max-width: 696px) 100vw, 696px" /></a><p id="caption-attachment-10761" class="wp-caption-text">Pass Response Header value to URL (Cursor)</p></div>
<h2>Method-8: Pass Pagination Token in Request Body</h2>
<p>In previous section (Method-4: Pass Page Number in Body Attribute ) we saw how to pass simple numeric page counter in Body. This is fine for some API but if your API has base64 style text token then counter based method doesn&#8217;t work. Also if you have requirement to hide page attribute node in first request and send page counter node in second request body (Changing Request Body Pattern for First vs Next)  then check next two sections.</p>
<p>Next two sections covers two API Pagination patterns to fetch 100 rows (1000 in each page) . Both requires to send token in Body but second section is more complex need (Different Body Attributes in first vs next requests )</p>
<h3>Passing Page Token in Body (Blank Token in first request allowed)</h3>
<p>Lets look at simple pattern where first request has blank token in Body but all other requests until we find last page we keep sending non-empty token. This approach works as long as API Provider doesn&#8217;t mind having Blank Token in first request. If you get error then check next section to handle more complex way.</p>
<p>Here is the example of API which needs token in body</p>
<p><strong>First API call</strong></p><pre class="crayon-plain-tag">--------- Request ---------
POST http://test.com/api/getdata

{ searchFor: "Account", continueToken:"" }

--------- Response ---------
{recordsFound: 5000, data: ["Acct1", "Acct2"..., "Acct1000"], nextToken:"AxBxCx112233001==" }</pre><p>
<strong>Second API call</strong></p><pre class="crayon-plain-tag">--------- Request ---------
POST http://test.com/api/getdata

{ searchFor: "Account", continueToken:"AxBxCx112233001==" }

--------- Response ---------
{data: ["Acct1001", "Acct1002"..., "Acct2000"], nextToken:"AxBxCx112233002==" }</pre><p>
&#8230;.. many more calls &#8230;</p>
<p>&#8230;. many more calls &#8230;.</p>
<p><strong>Last API call (no more nextToken in response so STOP pagination)</strong></p><pre class="crayon-plain-tag">--------- Request ---------
POST http://test.com/api/getdata

{ searchFor: "Account", continueToken:"AxBxCx112233009==" }

--------- Response ---------
{data: ["Acct9001", "Acct9002"..., "Acct10000"] }</pre><p>
So if you have such pattern then you can set few properties</p>
<p>For such issue you can use Changing few properties like below. Use Property Grid if you cant find on UI</p>
<ul>
<li>Set EnablePageTokenForBody  = <pre class="crayon-plain-tag">True</pre></li>
<li>Set PagePlaceholders = <pre class="crayon-plain-tag">header=|;filter=|;</pre></li>
<li>Set HttpRequestData = <pre class="crayon-plain-tag">{ searchFor: "Account", continueToken:"[$pagetoken$]" }</pre></li>
</ul>
<div id="attachment_10762" style="width: 838px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Pass-Passing-Page-Token-in-Body-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10762" class="size-full wp-image-10762" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Pass-Passing-Page-Token-in-Body-1.png" alt="Method 8 Pass Passing Page Token in Body 1" width="828" height="488" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Pass-Passing-Page-Token-in-Body-1.png 828w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Pass-Passing-Page-Token-in-Body-1-300x177.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Pass-Passing-Page-Token-in-Body-1-768x453.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-10762" class="wp-caption-text">Setting Body with [$pagetoken$] to implement dynamic pagination</p></div>
<div id="attachment_10763" style="width: 838px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Pass-Passing-Page-Token-in-Body-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10763" class="size-full wp-image-10763" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Pass-Passing-Page-Token-in-Body-2.png" alt="Method 8 advanced pagination tab" width="828" height="437" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Pass-Passing-Page-Token-in-Body-2.png 828w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Pass-Passing-Page-Token-in-Body-2-300x158.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Pass-Passing-Page-Token-in-Body-2-768x405.png 768w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Pass-Passing-Page-Token-in-Body-2-720x380.png 720w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-10763" class="wp-caption-text">Setting Page Placeholders in Advanced Pagination tab.</p></div>
<h3>Passing Page Token in Body (Blank Token in first request)</h3>
<p>Now let&#8217;s look at more complex pattern. Here our first request body is different than other requests.</p>
<p><strong>First API call</strong></p><pre class="crayon-plain-tag">--------- Request ---------
POST http://test.com/api/getdata

{ searchFor: "Account" }

--------- Response ---------
{recordsFound: 5000, data: ["Acct1", "Acct2"..., "Acct1000"], nextToken:"AxBxCx112233001==" }</pre><p>
<strong>Second API call</strong></p><pre class="crayon-plain-tag">--------- Request ---------
POST http://test.com/api/getdataNext

{ continueToken:"AxBxCx112233001==" }

--------- Response ---------
{data: ["Acct1001", "Acct1002"..., "Acct2000"], nextToken:"AxBxCx112233002==" }</pre><p>
&#8230;.. many more calls &#8230;</p>
<p>&#8230;. many more calls &#8230;.</p>
<p><strong>Last API call (no more nextToken)</strong></p><pre class="crayon-plain-tag">--------- Request ---------
POST http://test.com/api/getdataNext

{ continueToken:"AxBxCx112233009==" }

--------- Response ---------
{data: ["Acct9001", "Acct9002"..., "Acct10000"] }</pre><p>
So notice few things</p>
<ul>
<li>First Request Body / URL is different than second / third and Nth API call</li>
<li>For first request we do not have token attribute but after first request we do have token attribute</li>
</ul>
<p>We have <a href="https://zappysys.com/blog/call-amazon-mws-api-using-ssis-marketplace-web-service/" target="_blank" rel="noopener">this article</a> and <a href="https://zappysys.com/blog/read-data-netsuite-ssis-simpletalk-soap-api/" target="_blank" rel="noopener">this article</a> which describes similar pattern.</p>
<p>Now lets look at how to solve both problems</p>
<h3>Passing PageToken or Counter in Next API Call Body</h3>
<p>For such issue you can use Changing few properties like below. Use Property Grid if you cant find on UI</p>
<ul>
<li>Set EnablePageTokenForBody  = <pre class="crayon-plain-tag">True</pre></li>
<li>Set PagePlaceholders = <pre class="crayon-plain-tag">header=|;filter=|;</pre></li>
<li>Set HttpRequestData = <pre class="crayon-plain-tag">[$tag$]</pre></li>
<li>Set HasDifferentNextPageInfo = <pre class="crayon-plain-tag">True</pre></li>
<li>Set FirstPageBodyPart = <pre class="crayon-plain-tag">{ searchFor: "Account"}</pre></li>
<li>Set NextPageBodyPart = <pre class="crayon-plain-tag">{ token:"[$pagetoken$]" }</pre></li>
</ul>
<p>So notice how we defined Body in two different properies as template. And in HttpRequestData we used <pre class="crayon-plain-tag">[$tag$]</pre>
<h2>Output Page Number as column</h2>
<p>Sometimes you have use case where you want to Start Page Number from the last page loaded successfully. By default, you will see one additional column __FileName in the output. This column contains PageNumber  from URL for each row. You can save this into database so when next time you run your SSIS you can start at MAX(PageNumber) + 1.</p>
<p>Outputting PageNumber option is not visible by default so Use Property Grid and look for <strong>OutputFileName</strong> property (Default=true)</p>
<h2>Last Page Detection</h2>
<p>Every API may have different way of telling you that you reached last page or no more data found so you should stop looping. SSIS PowerPack comes with many options so you can implement desired logic for last page detection.</p>
<p>Following approaches supported by last page detection. Below options are not applicable if you are using Method#3 (Response contains Next Link / Cursor)</p>
<ol>
<li>Detect the last page by row count</li>
<li>Detect the last page by response status code</li>
<li>Detect the last page by error message (substring search)</li>
<li>Detect the last page by response size</li>
<li>Detect the last page based on response value or regular expression pattern</li>
</ol>
<p>Now lets look at each setting. You should choose correct one based on your API behavior</p>
<h3>Detect the last page by row count</h3>
<p>If your API returns blank document or blank Array (if its JSON) then you can use this method to detect the last page. So when no content found in Response document it will stop pagination.</p>
<p>See below example of JSON API .. It shows sample first page and Sample last page (Assuming you entered Filter as $.Records[*] to extract data from Records array.</p>
<p><strong>First Page</strong></p><pre class="crayon-plain-tag">{&nbsp;
&nbsp; Records : [ {...}, {...}, {...} .........&nbsp;]
}</pre><p>
<strong>Last Page</strong></p><pre class="crayon-plain-tag">{&nbsp;
&nbsp; Records : [&nbsp;&nbsp;]
}</pre><p>
<div id="attachment_10769" style="width: 654px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-by-row-count.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10769" class="size-full wp-image-10769" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-by-row-count.png" alt="Method 8 Detect the last page by row count" width="644" height="222" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-by-row-count.png 644w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-by-row-count-300x103.png 300w" sizes="(max-width: 644px) 100vw, 644px" /></a><p id="caption-attachment-10769" class="wp-caption-text">SSIS API Pagination – Detect the last page by row count (Blank document or array)</p></div>
<h3>Detect the last page by response status code</h3>
<p>Sometimes you get error with status code when the last page is reached (Most common is 404). So rather than failure, you can treat that status code as last page indicator using this option (see below).</p>
<div id="attachment_10766" style="width: 644px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-by-response-status-code.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10766" class="size-full wp-image-10766" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-by-response-status-code.png" alt="Method 8 Detect the last page by response status code" width="634" height="245" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-by-response-status-code.png 634w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-by-response-status-code-300x116.png 300w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-10766" class="wp-caption-text">SSIS API Pagination – Detect last page by response status code</p></div>
<h3>Detect the last page by the error message</h3>
<p>If you cant use above two methods and want to detect the last page based on a certain error string in the response then use below approach.</p>
<div id="attachment_10767" style="width: 647px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-by-the-error-message.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10767" class="size-full wp-image-10767" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-by-the-error-message.png" alt="Method 8 Detect the last page by the error message" width="637" height="249" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-by-the-error-message.png 637w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-by-the-error-message-300x117.png 300w" sizes="(max-width: 637px) 100vw, 637px" /></a><p id="caption-attachment-10767" class="wp-caption-text">SSIS API Pagination – Detect the last page by error/response string search</p></div>
<h3>Detect the last page by response size</h3>
<p>Sometimes you can detect the last page by response size. For example, your response contains &#8220;&#8211;&#8221; only if no more data is found then you cannot use any of the above approaches and you have to detect based on response size (e.g. less than 3 bytes). See below</p>
<div id="attachment_10768" style="width: 654px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-by-response-size-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10768" class="size-full wp-image-10768" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-by-response-size-1.png" alt="Method 8 Detect the last page by response size" width="644" height="243" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-by-response-size-1.png 644w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-by-response-size-1-300x113.png 300w" sizes="(max-width: 644px) 100vw, 644px" /></a><p id="caption-attachment-10768" class="wp-caption-text">SSIS API Pagination – Detect last page by response size</p></div>
<h3>Detect the last page based on the response attribute value</h3>
<p>There will be a time when you want to detect the last page based on some indicator value from your response. In that case, you can use the following settings to detect the last page.</p>
<ul>
<li>Select Paging mode =Response Attribute Mode</li>
<li>Select Next Link Attribute (Example: <strong>$.next_page</strong> )</li>
<li>Select Stop Indicator Attribute (Example: <strong>$.hasMorePages</strong> )</li>
<li>Enter a value for Stop Indicator (Example: <strong>false</strong> )</li>
</ul>
<p>If you don&#8217;t want to use Hardcoded value for stop indicator and want to use expression then see next section.</p>
<h3>Detect the last page based on regular expression pattern</h3>
<p>There will be a time when you want to detect the last page based on some indicator value from your response. In that case, you can use the following settings to detect the last page.</p>
<ul>
<li>Select Paging mode =Response Attribute Mode</li>
<li>Select Next Link Attribute (Example: <strong>$.next_page</strong> )</li>
<li>Select Stop Indicator Attribute (Example: <strong>$.count</strong> )</li>
<li>Enter regex pattern (regular expression) for Stop Indicator (Example: <strong>regex=^\d{1,3}$</strong> ). Stop when count attribute is less than 1000 in other word less than 4 digits.</li>
</ul>
<p>Here is an example from <a href="https://zappysys.com/blog/read-zendesk-data-in-ssis-call-rest-api/" target="_blank" rel="noopener">Zendesk API</a> (Stop pagination when count attribute from the response is less than 1000)</p>
<div id="attachment_10770" style="width: 687px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-based-on-regular-expression-pattern.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10770" class="size-full wp-image-10770" src="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-based-on-regular-expression-pattern.png" alt="Method 8 Detect the last page based on regular expression pattern" width="677" height="418" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-based-on-regular-expression-pattern.png 677w, https://zappysys.com/blog/wp-content/uploads/2016/04/Method-8-Detect-the-last-page-based-on-regular-expression-pattern-300x185.png 300w" sizes="(max-width: 677px) 100vw, 677px" /></a><p id="caption-attachment-10770" class="wp-caption-text">Pagination for Zendesk Incremental API – Next Link and Last Page detection using Stop Indicator Regular Expression</p></div>
<div class="content_block" id="custom_post_widget-9862"><h2>Handling API Rate Limit - Retry on too many API requests</h2>
<p>Many API restricts you from calling too many API calls too soon (just to save their servers from being overwhelmed) - <a href="https://shopify.dev/api/usage/rate-limits" target="_blank" rel="noopener">Example</a>. Let's think this way if you fetching a million rows via paginated response and the very last page fails then you won't be happy because now you have to fetch everything again. To solve this ZappySys provides retry options on HTTP / OAuth and REST API connection managers.</p>

<p>Generally, when you exceed the rate limit, the server sends you <strong>error code 429</strong> but it can be something else too or multiple codes are returned. In the below example, we use 503. Check your API documentation to know the exact code you should retry.</p>

<p>To set the retry options go to connection settings (e.g. HTTP / OAuth / REST connection). The below example is for OAuth connection.</p>

<p>To retry on multiple codes use Pipe as a delimiter. Example: <strong>429|503</strong></p>


<div class="wp-caption alignnone">
 <a href="https://zappysys.com/blog/wp-content/uploads/2018/09/http-retry-settings-oauth-connection.png">
   <img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/09/http-retry-settings-oauth-connection.png" alt="Retry Settings for API Rate Limit Exceeded Error (Status code 429)" />
 </a>
<p class="wp-caption-text">Retry Settings for API Rate Limit Exceeded Error (Status code 429 or other)</p>
</div></div>
<h2>Performance Tips</h2>
<p>You can improve performance of your API calls by doing a few changes (again not every API may support this)</p>
<ul>
<li>Use the maximum page size possible (e.g. if you doing pagination you can set max possible page size &#8211; refer to your API documentation whats the default size and what is the max page size you can supply)<br />
e.g.  /myapi?pagesize=100  (parameter name can be something else like limit=100)</li>
</ul>
<p>&nbsp;</p>
<h2>SSIS Infinite Loop</h2>
<p>So now you know how to paginate automatically in <a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/">JSON Source Connector</a> but what if you want to use <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/">REST API Task</a> for pagination? Some custom scenarios like web scraping require you to download all HTML pages until no more results found? In that case, you most likely need infinite looping pattern (Loop until the last page detected). To loop through pages until the last page is reached you can perform the following logic.</p>
<p>The last page can be detected based on any of the following ways<br />
1. Check Response StatusCode<br />
2. Check Error Message<br />
3. Check Response Size (If less than X bytes then consider as the last page)</p>
<p>REST API Task support #1 and #2 scenarios. If you want to check bytes then use the expression in Expression Task or Script Task<br />
(e.g. @exitloop = LEN(@responseData) &lt;= 3 )</p>
<p><b>URL for Rest API Task (On Request Settings Tab)</b><br />
When you configure REST API Task enter URL as below so its dynamic. You can use PageCounter variable anywhere in the URL.</p><pre class="crayon-plain-tag">//zappysys.com/downloads/files/test/cust-{{User::pagecounter}}.json</pre><p>
<div id="attachment_10771" style="width: 755px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/SSIS-Infinite-Loop-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10771" class="size-full wp-image-10771" src="https://zappysys.com/blog/wp-content/uploads/2016/04/SSIS-Infinite-Loop-1.png" alt="SSIS Infinite Loop part 1 " width="745" height="957" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/SSIS-Infinite-Loop-1.png 745w, https://zappysys.com/blog/wp-content/uploads/2016/04/SSIS-Infinite-Loop-1-234x300.png 234w" sizes="(max-width: 745px) 100vw, 745px" /></a><p id="caption-attachment-10771" class="wp-caption-text">SSIS REST API Looping – Pass Page number in URL, SSIS Infinite Loop</p></div>
<div id="attachment_10772" style="width: 729px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/04/SSIS-Infinite-Loop-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10772" class="size-full wp-image-10772" src="https://zappysys.com/blog/wp-content/uploads/2016/04/SSIS-Infinite-Loop-2.png" alt="SSIS Infinite Loop part 2" width="719" height="504" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/SSIS-Infinite-Loop-2.png 719w, https://zappysys.com/blog/wp-content/uploads/2016/04/SSIS-Infinite-Loop-2-300x210.png 300w" sizes="(max-width: 719px) 100vw, 719px" /></a><p id="caption-attachment-10772" class="wp-caption-text">Configure For Loop Task for Infinite Looping (Loop until last page found)</p></div>
<h2>Download Sample SSIS Package</h2>
<p><a href="//zappysys.com/blog/wp-content/uploads/2016/04/SSIS-Loop-Rest-API-2012.dtsx.zip">SSIS-Loop-Rest-API-2012.dtsx (Zip file)</a></p>
<h2>Video Tutorial &#8211; Reading data from API in SSIS</h2>
<p>In case you missed our previous article about <a href="https://zappysys.com/blog/call-rest-api-using-ssis-web-service-task/" target="_blank" rel="noopener">calling REST API is SSIS</a> then check below video.</p>
<a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/"><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 /></p>
<p>&nbsp;</p>
<h2>Conclusion</h2>
<p>It can be time consuming and steep learning curve to write C#/JAVA code to handle your rest api integration but using some Tasks and Connectors listed below can help you to solve big headache and provide clean drag and drop REST API integration in SSIS for virtually any REST API Source (e.g. Twitter, Facebook, Salesforce, office 365). <a href="//zappysys.com/products/ssis-powerpack/">Download SSIS PowerPack</a> and try it out by yourself.</p>
<h2 class="su-box-title">SSIS Components for REST API/JSON/XML/SOAP</h2>
<div class="su-box-content su-clearfix">
<table>
<tbody>
<tr>
<td width="36"><img decoding="async" src="//zappysys.com/images/ssis-powerpack/SSIS-Json-Source-Adapter.png" alt="Custom SSIS Components - JSON Source (File and REST API Connector)" width="32" /></td>
<td><a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener"><span style="color: #248cc8;">JSON Source Connector (File, REST API)</span></a></td>
</tr>
<tr>
<td width="36"><span style="color: #248cc8;"><img decoding="async" src="//zappysys.com/images/ssis-powerpack/ssis-export-json-file-task.png" alt="Custom SSIS Tasks - Export JSON File Task" width="32" /></span></td>
<td><a href="//zappysys.com/products/ssis-powerpack/ssis-export-json-file-task/" target="_blank" rel="noopener"><span style="color: #248cc8;">Export JSON File Task</span></a></td>
</tr>
<tr>
<td width="36"><span style="color: #248cc8;"><img decoding="async" src="//zappysys.com/images/ssis-powerpack/ssis-json-parser-task.png" alt="Custom SSIS Tasks - JSON Parser Task" width="32" /></span></td>
<td><a href="//zappysys.com/products/ssis-powerpack/ssis-json-parser-task-free/" target="_blank" rel="noopener"><span style="color: #248cc8;">JSON Parser Task</span></a></td>
</tr>
<tr>
<td width="36"><span style="color: #248cc8;"><img decoding="async" src="//zappysys.com/images/ssis-powerpack/ssis-xml-source.png" alt="Custom SSIS Tasks - XML Source Connector (File, SOAP, REST API)" width="32" /></span></td>
<td><a href="//zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener"><span style="color: #248cc8;">XML Source Connector (File, SOAP, REST API)</span></a></td>
</tr>
</tbody>
</table>
</div>
<p>The post <a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/">How to do REST API Pagination in SSIS / ODBC Drivers</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How to get data from Facebook in SSIS using REST API</title>
		<link>https://zappysys.com/blog/get-data-from-facebook-in-ssis-using-rest-api/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 11 Jan 2016 15:41:54 +0000</pubDate>
				<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[API Integration]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebook graph api]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[paging]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=320</guid>

					<description><![CDATA[<p>Introduction In this article you will learn how to get data from Facebook using Graph API (OAuth 2.0) using SSIS PowerPack REST api Connectors. Facebook provides rich set of REST API to access data. Their REST API is also known as Facebook Graph API and it uses OAuth 2.0 Authorization. Traditionally any REST API Integration scenarios [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/get-data-from-facebook-in-ssis-using-rest-api/">How to get data from Facebook in SSIS using REST API</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="//zappysys.com/blog/wp-content/uploads/2016/01/facebook-api-integration.png"><img loading="lazy" decoding="async" class="size-full wp-image-1667 alignleft" src="//zappysys.com/blog/wp-content/uploads/2016/01/facebook-api-integration.png" alt="" width="123" height="123" /></a>In this article you will learn how to get data from Facebook using Graph API (OAuth 2.0) using <a href="//zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> REST api Connectors. Facebook provides rich set of REST API to access data. Their REST API is also known as <strong>Facebook Graph API</strong> and it uses <strong>OAuth 2.0</strong> Authorization. Traditionally any REST API Integration scenarios in <strong>SSIS</strong> requires you to use some sort of SDKs using popular programming languages (e.g. C#, Java, Ruby, Python). If you are DBA or SSIS Developer and you prefer to use clean drag and drop approach rather complex programming then this article will show you how to achieve it.</p>
<p><a href="//zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> REST API Connectors can be used to consume/manage Facebook data using REST API. Following connectors will be used in this article.</p>
<div class="su-table su-table-alternate">
<table>
<tbody>
<tr>
<td width="36"><img decoding="async" src="//zappysys.com/images/ssis-powerpack/ssis-rest-api-web-service-task.png" alt="Custom SSIS Tasks - Call REST API Webservice (GET, POST, DELETE etc)" width="32" /></td>
<td><u><a href="//zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">REST API Task</a></u></td>
</tr>
<tr>
<td width="36"><img decoding="async" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/oauth-connection/ssis-oauth-connection-manager.png" alt="SSIS OAuth Connection Manager" width="32" /></td>
<td><a href="//zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-oauth-connection-manager.htm" target="_blank" rel="noopener">OAuth Connection Manager</a></td>
</tr>
<tr>
<td width="36"><img decoding="async" src="//zappysys.com/images/SSIS-PowerPack/SSIS-Json-Source-Adapter.png" alt="Custom SSIS Components - JSON Source (File, REST, OData)" width="32" /></td>
<td><a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">JSON Source (File, REST, OData)</a></td>
</tr>
</tbody>
</table>
</div>
<h2>Register Facebook OAuth App for Graph API access</h2>
<p>Very first step to access Facebook API is register your custom OAuth App under Facebook developer portal. <a href="//zappysys.com/blog/register-facebook-oauth-app-graph-api/" target="_blank" rel="noopener">Check this article for more information on this topic</a>.</p>
<h2>Consume data from Facebook using REST API in SSIS</h2>
<p>In this section we will guide you how to create OAuth connection and consume data from Facebook in few clicks using <a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">JSON Source (File, REST, OData)</a> . We will load Facebook data into SQL Server.</p>
<h3>Find Facebook PageID from its Name</h3>
<p>In our case for example we want to Extract Page Insights for some page (e.g. facebook.com/MyPage ). To findout pageid perform following steps</p>
<ol>
<li>Navigate to <a href="https://developers.facebook.com/tools/explorer" target="_blank" rel="noopener">https://developers.facebook.com/tools/explorer</a></li>
<li>Click Get Token button, select permission you really care (To get PageID you don&#8217;t need to check anything).</li>
<li>Type /YourPageName in the API Url bar</li>
<li>Now click Submit. You will see response json which will have pagename and pageID
<div id="attachment_603" style="width: 610px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/01/using-facebook-graph-api-explorer-ssis-get-page-id.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-603" class="wp-image-603" src="//zappysys.com/blog/wp-content/uploads/2016/01/using-facebook-graph-api-explorer-ssis-get-page-id.png" alt="Using Facebook Graph API Explorer, Test API, Find Object ID / PageID from Name" width="600" height="231" srcset="https://zappysys.com/blog/wp-content/uploads/2016/01/using-facebook-graph-api-explorer-ssis-get-page-id.png 709w, https://zappysys.com/blog/wp-content/uploads/2016/01/using-facebook-graph-api-explorer-ssis-get-page-id-300x116.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><p id="caption-attachment-603" class="wp-caption-text">Using Facebook Graph API Explorer, Test API, Find Object ID / PageID from Name</p></div></li>
</ol>
<h3>Create Facebook OAuth Connection</h3>
<p>You can create SSIS OAuth connection manager two ways. 1) From Add Connection manager option from designer or Click Add ZS-OAuth from Component UI. Lets use first method.</p>
<ol>
<li>In the SSIS Designer in connection manager pane .. right click and new connection &#8230; select ZS-OAUTH Connection from list</li>
<li>Select Facebook provider from dropdown</li>
<li>Select Custom OAuth App option</li>
<li>Enter Facebook OAuth App ID and OAuth App Secret</li>
<li>Select Permission (i.e. Scope) or type by hand (1 per each line)</li>
<li>Click generate Token. You will be redirected to login page and then it will show Authorize App confirmation. Click Accept.</li>
<li>Test Connection (If things go well it will show green success)
<div id="attachment_588" style="width: 610px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/06/ssis-facebook-test-oauth-connection-graph-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-588" class="wp-image-588" src="//zappysys.com/blog/wp-content/uploads/2016/06/ssis-facebook-test-oauth-connection-graph-api.png" alt="Testing Facebook OAuth Connectivity in SSIS (Use Graph API)" width="600" height="384" srcset="https://zappysys.com/blog/wp-content/uploads/2016/06/ssis-facebook-test-oauth-connection-graph-api.png 957w, https://zappysys.com/blog/wp-content/uploads/2016/06/ssis-facebook-test-oauth-connection-graph-api-300x192.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><p id="caption-attachment-588" class="wp-caption-text">Testing Facebook OAuth Connectivity in SSIS (Use Graph API)</p></div></li>
</ol>
<h3>Get Page Access Token (optional)</h3>
<p>Accessing data of your Facebook page requires to generate a <em>Page Access Token</em>, follow the steps below to get it. If you are using non-page API methods, then you can freely skip this step. In SSIS Designer drag and drop REST API Task.</p>
<ol>
<li>Then use the same OAuth connection we created in the previous step.</li>
<li>Proceed with setting the URL using this format:<br />
<code>https://graph.facebook.com/v2.5/<strong>REPLACE_WITH_PAGE_ID</strong>?fields=access_token</code></li>
<li>Click <strong>Test Request/Response</strong> button and then copy the <strong>Page Access Token</strong> to a Notepad.</li>
</ol>
<div id="attachment_8730" style="width: 825px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/01/001-get-data-from-facebook-in-ssis-using-rest-api-getting-page-access-token.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8730" class="wp-image-8730 size-full" src="https://zappysys.com/blog/wp-content/uploads/2016/01/001-get-data-from-facebook-in-ssis-using-rest-api-getting-page-access-token.png" alt="Getting Facebook Page Access Token using Facebook Graph API and SSIS" width="815" height="752" srcset="https://zappysys.com/blog/wp-content/uploads/2016/01/001-get-data-from-facebook-in-ssis-using-rest-api-getting-page-access-token.png 815w, https://zappysys.com/blog/wp-content/uploads/2016/01/001-get-data-from-facebook-in-ssis-using-rest-api-getting-page-access-token-300x277.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/01/001-get-data-from-facebook-in-ssis-using-rest-api-getting-page-access-token-768x709.png 768w" sizes="(max-width: 815px) 100vw, 815px" /></a><p id="caption-attachment-8730" class="wp-caption-text">Getting Facebook Page Access Token using Facebook Graph API and SSIS</p></div>
<h3>Get Long-Lived Access Token</h3>
<p>Most likely, once finished, you will deploy the SSIS package to your SQL Server and then set a schedule to run it daily or hourly. With ordinary Access Tokens you will run into a problem after 30 or 60 days because these tokens will expire after a similar time and your SQL Job will fail. To avoid that, we can generate a Long-Lived Access Token which will live for 60 days, as long as you use that token (and running the package <em>is</em> using it). Perform these steps to generate a Long-Lived Access Token:</p>
<ol>
<li>Firstly, you will need to find out your Facebook User ID. To do that, call this URL in Facebook Graph Explorer or using REST API Task with configured OAuth Connection Manager:<br />
<code>https://graph.facebook.com/v2.5/me</code></li>
<li>Copy the ID from the response.</li>
<li>Then drag and drop another REST API Task and configure it like this, if you want to generate a Long-Lived <span style="text-decoration: underline;"><em>Page</em></span> Access Token:
<div id="attachment_8731" style="width: 800px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/01/002-get-data-from-facebook-in-ssis-using-rest-api-getting-long-lived-page-access-token.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8731" class="wp-image-8731 size-full" src="https://zappysys.com/blog/wp-content/uploads/2016/01/002-get-data-from-facebook-in-ssis-using-rest-api-getting-long-lived-page-access-token.png" alt="Getting Facebook Long-Lived Page Access Token using Facebook Graph API and SSIS" width="790" height="709" srcset="https://zappysys.com/blog/wp-content/uploads/2016/01/002-get-data-from-facebook-in-ssis-using-rest-api-getting-long-lived-page-access-token.png 790w, https://zappysys.com/blog/wp-content/uploads/2016/01/002-get-data-from-facebook-in-ssis-using-rest-api-getting-long-lived-page-access-token-300x269.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/01/002-get-data-from-facebook-in-ssis-using-rest-api-getting-long-lived-page-access-token-768x689.png 768w" sizes="(max-width: 790px) 100vw, 790px" /></a><p id="caption-attachment-8731" class="wp-caption-text">Getting Facebook Long-Lived Page Access Token using Facebook Graph API and SSIS</p></div>
<p>Otherwise, if you want to generate a <em><span style="text-decoration: underline;">non-page</span></em> Long-Lived Access Token, use this configuration:</p>
<div id="attachment_8732" style="width: 696px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/01/003-get-data-from-facebook-in-ssis-using-rest-api-getting-long-lived-access-token.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8732" class="wp-image-8732 size-full" src="https://zappysys.com/blog/wp-content/uploads/2016/01/003-get-data-from-facebook-in-ssis-using-rest-api-getting-long-lived-access-token.png" alt="Getting Facebook Long-Lived Access Token using Facebook Graph API and SSIS" width="686" height="356" srcset="https://zappysys.com/blog/wp-content/uploads/2016/01/003-get-data-from-facebook-in-ssis-using-rest-api-getting-long-lived-access-token.png 686w, https://zappysys.com/blog/wp-content/uploads/2016/01/003-get-data-from-facebook-in-ssis-using-rest-api-getting-long-lived-access-token-300x156.png 300w" sizes="(max-width: 686px) 100vw, 686px" /></a><p id="caption-attachment-8732" class="wp-caption-text">Getting Facebook Long-Lived Access Token using Facebook Graph API and SSIS</p></div></li>
</ol>
<h3>Use JSON/REST API Source to read from Graph API</h3>
<p>Once you have OAuth connection manager. You can perform following steps to Extract data from Graph API Url. Facebook Graph API uses ObjectID in the URL so make sure you have that handy for whatever resource you want to access.</p>
<h3>Configure JSON/REST API Source</h3>
<p>Once you know pageid we can build our API URL. Lets assume your pageid is 12345678 and you want to extract page insight data via API call. In that case you may build your URL following way. You can change v2.5 to something else depending on API version you wish to use. If you omit version number from URL then default version will be used by Facebook API (Default API version can be found on Dashboard of your OAuth App).</p><pre class="crayon-plain-tag">https://graph.facebook.com/v2.5/<strong>YOUR_PAGE_ID</strong>/insights/page_impressions_organic_unique</pre><p>
Now perform the following steps to configure JSON Source to extract data from Facebook API.</p>
<p><strong>NOTE:</strong> Below steps assume that you already Downloaded and Installed <a href="//zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a></p>
<ol>
<li>Drag Data Flow Task from SSIS Toolbox and double click to view Dataflow designer</li>
<li>Drag <strong>ZS JSON Source</strong> from SSIS Toolbox. Double click to configure.</li>
<li>In the AccessMode select &#8220;File Path or Web URL&#8221;</li>
<li>Enter URL:<br />
<code>https://graph.facebook.com/v2.5/<strong>YOUR_PAGE_ID</strong>/insights/page_impressions_organic_unique?access_token=<strong>REPLACE_WITH_LONG_LIVED_ACCESS_TOKEN</strong></code><br />
<strong>NOTE:</strong> <a href="https://zappysys.com/blog/get-api-data-with-dynamic-url-and-load-into-sql-server/" target="_blank" rel="noopener">You may use variables and parameters in the URL</a> e.g. http://mydomain/{{User::MyPath}}:</p>
<div id="attachment_8733" style="width: 698px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/01/004-get-data-from-facebook-in-ssis-using-rest-api-getting-page-data.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8733" class="wp-image-8733 size-full" src="https://zappysys.com/blog/wp-content/uploads/2016/01/004-get-data-from-facebook-in-ssis-using-rest-api-getting-page-data.png" alt="Getting Facebook Page data using Facebook Graph API and SSIS" width="688" height="680" srcset="https://zappysys.com/blog/wp-content/uploads/2016/01/004-get-data-from-facebook-in-ssis-using-rest-api-getting-page-data.png 688w, https://zappysys.com/blog/wp-content/uploads/2016/01/004-get-data-from-facebook-in-ssis-using-rest-api-getting-page-data-300x297.png 300w" sizes="(max-width: 688px) 100vw, 688px" /></a><p id="caption-attachment-8733" class="wp-caption-text">Getting Facebook Page data using Facebook Graph API and SSIS</p></div></li>
<li>Click on Select Filter and select values node and click OK. It may produce filter expression like below.</li>
<li>You can set <strong>Max Rows</strong> option to desired value if you don&#8217;t want to extract all rows (0=Unlimited)</li>
<li>Goto Paging Tab and enter <strong>$.paging.next</strong> in the &#8220;Next Cursor&#8221; field as below
<div id="attachment_8734" style="width: 646px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/01/005-get-data-from-facebook-in-ssis-using-rest-api-paging-through-the-results.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8734" class="wp-image-8734 size-full" src="https://zappysys.com/blog/wp-content/uploads/2016/01/005-get-data-from-facebook-in-ssis-using-rest-api-paging-through-the-results.png" alt="Getting page data from Facebook and paginating through the results using SSIS" width="636" height="449" srcset="https://zappysys.com/blog/wp-content/uploads/2016/01/005-get-data-from-facebook-in-ssis-using-rest-api-paging-through-the-results.png 636w, https://zappysys.com/blog/wp-content/uploads/2016/01/005-get-data-from-facebook-in-ssis-using-rest-api-paging-through-the-results-300x212.png 300w" sizes="(max-width: 636px) 100vw, 636px" /></a><p id="caption-attachment-8734" class="wp-caption-text">Getting page data from Facebook and paginating through the results using SSIS</p></div></li>
<li>Click on Columns tab if you wish to see/change metadata (You can change size / datatype there and Lock metadata to prevent auto refresh)</li>
<li>Now click Preview to see sample data and then exit preview and click OK to save UI changes</li>
</ol>
<h3>Load Facebook data into SQL Server</h3>
<p>If you wish to save Facebook data into SQL Server or any other target like Oracle, MySQL, FlatFile, Excel, etc., then you can use some native SSIS Connectors (e.g. OLEDB Destination, ADO.net Destination). Connect JSON Source to Destination and map source columns to target.</p>
<h2>Facebook API Paging through dataset (i.e. Loop, Cursor)</h2>
<p>In the previous section, you saw how to adjust few attributes so JSON Source can paginate through Facebook API response. To learn more about <a href="//zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/" target="_blank" rel="noopener">REST API Paging Methods &#8211; Click this link</a></p>
<p>Here is <a href="https://developers.facebook.com/docs/graph-api/using-graph-api#paging" target="_blank" rel="noopener">another link</a> from Facebook Documentation for Paging</p>
<h2>Manage/Write/Update Facebook data using REST API</h2>
<p>If you wish to create new POST  or manage data using REST API then you most likely need to use <a href="//zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">REST API Task</a> rather than JSON Source. REST API Task also supports uploading media files.</p>
<p>&nbsp;</p>
<h2>Deployment to Production</h2>
<div class="content_block" id="custom_post_widget-1932"><p style="text-align: justify;">In SSIS package <a href="https://docs.microsoft.com/en-us/sql/integration-services/security/access-control-for-sensitive-data-in-packages" target="_blank" rel="noopener">sensitive data such as tokens and passwords are by default encrypted by SSIS</a> with your Windows account which you use to create a package. So SSIS will fail to decrypt tokens/passwords when you run it from another machine using another Windows account. To circumvent this when you are creating an SSIS package which uses authentication components (e.g. an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-oauth-connection-manager.htm" target="_blank" rel="noopener">OAuth Connection Manager</a> or an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-http-connection-manager.htm" target="_blank" rel="noopener">HTTP Connection Manager</a> with credentials, etc.), consider using parameters/variables to pass tokens/passwords. In this way, you won’t face authentication related errors when a package is deployed to a production server.</p>
<p style="text-align: justify;">Check our article on <a href="https://zappysys.com/blog/how-to-run-an-ssis-package-with-sensitive-data-on-sql-server/" target="_blank" rel="noopener">how to configure packages with sensitive data on your production or development server</a>.</p></div>
<p>You may also check the article on <a href="https://zappysys.com/blog/get-api-data-with-dynamic-url-and-load-into-sql-server/" target="_blank" rel="noopener">how to make URL dynamic/parametric</a>, so that you can pass Long-Lived Access Token as an argument in a SQL Job.</p>
<h2>Conclusion</h2>
<p>Facebook data integration can be quite challenging without right set of tools. <a href="//zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> provides complete toolset for any REST API integration related scenarios. Try it yourself and find out all hidden features not discussed in this article.</p>
<h2>References</h2>
<p><a href="https://developers.facebook.com/docs/graph-api" target="_blank" rel="noopener">Facebook Graph REST API reference link</a></p>
<p><a href="https://developers.facebook.com/tools/explorer" target="_blank" rel="noopener">https://developers.facebook.com/tools/explorer</a></p>
<p><a href="https://developers.facebook.com/docs/facebook-login/access-tokens/refreshing/" target="_blank" rel="noopener">https://developers.facebook.com/docs/facebook-login/access-tokens/refreshing/</a></p>
<h2>Similar articles</h2>
<p><a title="Permalink to Read Twitter data in SSIS using REST API Task and JSON Source – OAuth2 Protocol" href="//zappysys.com/blog/read-twitter-data-in-ssis-using-rest-api-task-json-source-oauth2/" rel="bookmark">Read Twitter data in SSIS using REST API Task and JSON Source – OAuth2 Protocol</a></p>
<p><a title="Permalink to How to get data from Google AdWords using SSIS" href="//zappysys.com/blog/get-data-from-google-adwords-using-ssis/" rel="bookmark">How to get data from Google AdWords using SSIS</a></p>
<p>The post <a href="https://zappysys.com/blog/get-data-from-facebook-in-ssis-using-rest-api/">How to get data from Facebook in SSIS using REST API</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to read OData in SSIS &#8211; REST API Example</title>
		<link>https://zappysys.com/blog/odata-paging-rest-api-paging-using-ssis-json-source/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Thu, 10 Sep 2015 14:07:04 +0000</pubDate>
				<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[odata]]></category>
		<category><![CDATA[paging]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[twitter]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=39</guid>

					<description><![CDATA[<p>Introduction In this article, we will learn how to utilize the SSIS JSON Source Component to retrieve JSON data from an OData service and perform OData pagination on significant results. According to the OData specification, data can be presented in either JSON or XML format. For the XML format, refer to this article. This article primarily [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/odata-paging-rest-api-paging-using-ssis-json-source/">How to read OData in SSIS &#8211; REST API Example</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In this article, we will learn how to utilize the SSIS JSON Source Component to retrieve JSON data from an OData service and perform OData pagination on significant results. <span style="box-sizing: border-box; margin: 0px; padding: 0px;">According to the OData specification, data can be presented in either JSON or XML format. For the XML format, refer to <a href="https://zappysys.com/blog/read-sap-s4-hana-data-ssis-cloud-odata-rest-api/" target="_blank" rel="noopener">this article</a>.</span> This article primarily covers the OData JSON API example.</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>REST API Pagination concept</h2>
<p>Most of the REST API Services limit the size of the dataset returned in a single request. When more data is found, it simply includes a pointer to the following result set. If you wish to fetch all data (e.g., loop through), you must check the following result set indicator. If it is not null, you can continue fetching until all data is retrieved. <span style="box-sizing: border-box; margin: 0px; padding: 0px;">This article covers several pagination methods</span>.</p>
<h2>Reading OData API in SSIS using JSON Source</h2>
<p>Let&#8217;s discuss how to read the OData API and Paginate Automatically. Below is a typical OData service Response (JSON Format). Notice how it includes the nextLink attribute, which points to the following URL to fetch more data. When you set <strong>Data </strong><span style="box-sizing: border-box; margin: 0px; padding: 0px;"><strong>Format to OData</strong> in the JSON Source, it will handle</span> pagination for you.</p>
<p><strong>Request URL: </strong></p><pre class="crayon-plain-tag">https://services.odata.org/V3/Northwind/Northwind.svc/Order_Details?$format=json</pre><p>
<b>Response:</b></p><pre class="crayon-plain-tag">{
  &quot;odata.metadata&quot;: &quot;https://services.odata.org/V3/Northwind/Northwind.svc/$metadata#Order_Details&quot;,
  &quot;value&quot;: [
    {
      &quot;OrderID&quot;: 10248,
      &quot;ProductID&quot;: 11,
      &quot;Discount&quot;: 0
    },
 ........
 ........
  ],
  &quot;odata.nextLink&quot;: &quot;Order_Details?$skiptoken=10436,75&quot;
}</pre><p>
<h3>Step-By-Step</h3>
<p>In this section, you will learn how to use the JSON Source Adapter to extract data from the OData API.</p>
<ol>
<li><span style="box-sizing: border-box; margin: 0px; padding: 0px;">Firstly, you need to <strong>download and install</strong> SSIS <a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">ZappySys PowerPack.</a></span></li>
<li>Once you have finished the first step, Open Visual Studio and create a New SSIS Package Project.</li>
<li>Now, Drag and Drop the SSIS <strong>Data Flow Task</strong> from the SSIS Toolbox.
<div id="attachment_11529" style="width: 472px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/09/drag-and-drop-data-flow-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11529" class="size-full wp-image-11529" src="https://zappysys.com/blog/wp-content/uploads/2015/09/drag-and-drop-data-flow-task.png" alt="" width="462" height="157" srcset="https://zappysys.com/blog/wp-content/uploads/2015/09/drag-and-drop-data-flow-task.png 462w, https://zappysys.com/blog/wp-content/uploads/2015/09/drag-and-drop-data-flow-task-300x102.png 300w" sizes="(max-width: 462px) 100vw, 462px" /></a><p id="caption-attachment-11529" class="wp-caption-text">SSIS Data Flow Task &#8211; Drag and Drop</p></div></li>
<li>Double-click on the Data Flow task to see the Data Flow designer surface.</li>
<li>From the SSIS toolbox, drag and drop the JSON Source onto the Data Flow Designer surface.
<div id="attachment_11533" style="width: 553px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/09/ssis-json-source-adapter-drag.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11533" class="size-full wp-image-11533" src="https://zappysys.com/blog/wp-content/uploads/2015/09/ssis-json-source-adapter-drag.png" alt="" width="543" height="146" srcset="https://zappysys.com/blog/wp-content/uploads/2015/09/ssis-json-source-adapter-drag.png 543w, https://zappysys.com/blog/wp-content/uploads/2015/09/ssis-json-source-adapter-drag-300x81.png 300w" sizes="(max-width: 543px) 100vw, 543px" /></a><p id="caption-attachment-11533" class="wp-caption-text">SSIS JSON Source &#8211; Drag and Drop</p></div></li>
<li>Double-click JSON Source and enter URL for OData API (You may use the below example URL for demo)<br />
<pre class="crayon-plain-tag">https://services.odata.org/V3/Northwind/Northwind.svc/Order_Details?$format=json</pre>
&nbsp;</li>
<li>Now configure Array Filter as below (you may see <strong>$.value[*]</strong> or some other node if URL is different)
<div id="attachment_11531" style="width: 838px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/09/OData-Paging-using-SSIS-JSON-Source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11531" class="size-full wp-image-11531" src="https://zappysys.com/blog/wp-content/uploads/2015/09/OData-Paging-using-SSIS-JSON-Source.png" alt="" width="828" height="745" srcset="https://zappysys.com/blog/wp-content/uploads/2015/09/OData-Paging-using-SSIS-JSON-Source.png 828w, https://zappysys.com/blog/wp-content/uploads/2015/09/OData-Paging-using-SSIS-JSON-Source-300x270.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/09/OData-Paging-using-SSIS-JSON-Source-768x691.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-11531" class="wp-caption-text">OData Paging using SSIS JSON Source</p></div></li>
<li>Click Preview data and OK to save
<div id="attachment_11532" style="width: 838px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/09/Read-JSON-File-data-from-Web-Url-Example-in-SSIS.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11532" class="size-full wp-image-11532" src="https://zappysys.com/blog/wp-content/uploads/2015/09/Read-JSON-File-data-from-Web-Url-Example-in-SSIS.png" alt="" width="828" height="745" srcset="https://zappysys.com/blog/wp-content/uploads/2015/09/Read-JSON-File-data-from-Web-Url-Example-in-SSIS.png 828w, https://zappysys.com/blog/wp-content/uploads/2015/09/Read-JSON-File-data-from-Web-Url-Example-in-SSIS-300x270.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/09/Read-JSON-File-data-from-Web-Url-Example-in-SSIS-768x691.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-11532" class="wp-caption-text">Read JSON File data from Web URL Example in SSIS</p></div></li>
<li>Now click OK to save.</li>
<li>Connect Your Source with a target like ZS Trash destination and execute the package. You will notice in the log that it paginates to return all rows
<div id="attachment_11530" style="width: 932px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/09/Fetch-OData-in-SSIS-REST-API-Example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11530" class="size-full wp-image-11530" src="https://zappysys.com/blog/wp-content/uploads/2015/09/Fetch-OData-in-SSIS-REST-API-Example.png" alt="" width="922" height="148" srcset="https://zappysys.com/blog/wp-content/uploads/2015/09/Fetch-OData-in-SSIS-REST-API-Example.png 922w, https://zappysys.com/blog/wp-content/uploads/2015/09/Fetch-OData-in-SSIS-REST-API-Example-300x48.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/09/Fetch-OData-in-SSIS-REST-API-Example-768x123.png 768w" sizes="(max-width: 922px) 100vw, 922px" /></a><p id="caption-attachment-11530" class="wp-caption-text">Fetch OData in SSIS (REST API Example)</p></div></li>
</ol>
<h2>Loading OData API into SQL Server / Other Target using SSIS</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>Twitter(Now X) REST API Paging Example using SSIS JSON Source</h2>
<p>The Twitter (Now X) REST API is not an OData format, but you can see a similar concept there as well. On Twitter, you don&#8217;t have a partial URL like OData for the following link, but it provides a unique identifier for some sort of record. <a href="https://developer.x.com/en/docs/x-api/v1/pagination" target="_blank" rel="noopener">Read here</a> for more information on the Twitter REST API Paging technique.</p>
<p>In our case, <a target="_blank" rel="noopener">SSIS JSON Source</a> Supports Paging very well, so we are covered. To loop through multiple result sets of Twitter data, simply configure the following four properties. See the screenshot below.</p>
<div class="mceTemp"></div>
<div id="attachment_11536" style="width: 869px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/09/TwitterX-REST-API-Paging-Example-Loop-through-resultset-using-cursor.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11536" class="size-full wp-image-11536" src="https://zappysys.com/blog/wp-content/uploads/2015/09/TwitterX-REST-API-Paging-Example-Loop-through-resultset-using-cursor.png" alt="" width="859" height="578" srcset="https://zappysys.com/blog/wp-content/uploads/2015/09/TwitterX-REST-API-Paging-Example-Loop-through-resultset-using-cursor.png 859w, https://zappysys.com/blog/wp-content/uploads/2015/09/TwitterX-REST-API-Paging-Example-Loop-through-resultset-using-cursor-300x202.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/09/TwitterX-REST-API-Paging-Example-Loop-through-resultset-using-cursor-768x517.png 768w, https://zappysys.com/blog/wp-content/uploads/2015/09/TwitterX-REST-API-Paging-Example-Loop-through-resultset-using-cursor-272x182.png 272w" sizes="(max-width: 859px) 100vw, 859px" /></a><p id="caption-attachment-11536" class="wp-caption-text">Twitter(X) REST API &#8211; Paging Example -Loop through resultset using cursor</p></div>
<h2>Conclusion</h2>
<p><span style="box-sizing: border-box; margin: 0px; padding: 0px;">Based on the above examples, you can see that handling Raging in REST API calls is not straightforward, but using Components like <a target="_blank" rel="noopener">SSIS JSON Source</a> can take some work off your plate.</span></p>
<p>The post <a href="https://zappysys.com/blog/odata-paging-rest-api-paging-using-ssis-json-source/">How to read OData in SSIS &#8211; REST API Example</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Call REST API in SSIS &#8211; Read JSON / XML / CSV</title>
		<link>https://zappysys.com/blog/call-rest-api-using-ssis-web-service-task/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 03 Aug 2015 04:41:10 +0000</pubDate>
				<category><![CDATA[SSIS REST API Task]]></category>
		<category><![CDATA[client certificate]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[http post]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[json source]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[odata]]></category>
		<category><![CDATA[paging]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[rest api task]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[web service]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=22</guid>

					<description><![CDATA[<p>Introduction The REST API is becoming increasingly popular in the Data Integration landscape. If you are an SSIS Developer (not a coder) and stumbled upon a question What is REST API and how to consume API inside an SSIS package?&#8221; then you are at the right place :). We encourage you to read this article carefully and [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/call-rest-api-using-ssis-web-service-task/">How to Call REST API in SSIS &#8211; Read JSON / XML / CSV</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/06/REST-API-icon.jpg"><img loading="lazy" decoding="async" class=" wp-image-4254 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/06/REST-API-icon.jpg" alt="Logo REST API" width="122" height="130" /></a>The REST API is becoming increasingly popular in the Data Integration landscape. <span style="box-sizing: border-box; margin: 0px; padding: 0px;">If you are an SSIS Developer (not a coder) and stumbled upon a question What is REST API and <em>how to consume API inside an SSIS package?</em>&#8221; then you are at the right place :).</span> We encourage you to read this article carefully and follow the various links we provided.</p>
<p>In this article, you will learn about many REST API Tips / Tools on the topic <em>of how to call a REST API using </em><a target="_blank" rel="noopener"><em>the SSIS REST API Task</em></a><em>, </em><a target="_blank" rel="noopener"><em>JSON Source,</em></a><em> or </em><a target="_blank" rel="noopener"><em>XML Source</em></a>. You will also learn how to perform <em>HTTP GET </em>and <em>HTTP POST Requests</em> without needing to know any programming languages (e.g., C#, Java, Python) &#8211; simply do a drag-and-drop operation in SSIS.</p>
<h2></h2>
<h2>What is REST API / RESTful Web Service</h2>
<p>Let&#8217;s first understand <strong>what a REST API</strong> is, also sometimes referred to as a <strong>RESTful Web Service</strong>. This is a new buzzword that you will likely hear frequently. More and more services are available in the Cloud, which makes it obvious to come up with some way for you to access data in a more firewall-friendly manner. What can be a better option than accessing it using a several-decade-old HTTP protocol, so no additional configuration is required for anybody accessing Cloud Services?</p>
<p>So, in short highlights for <em>REST Web Service</em></p>
<ul>
<li><em>REST Web Service</em> is a stateless client-server service model</li>
<li>By passing an <strong>HTTP verb,</strong> you can perform server-side action over the standard HTTP protocol (e.g., GET, POST, LIST, DELETE, HEAD)</li>
<li>You can pass <strong>parameters via URL</strong> query string and via <strong>HTTP Headers</strong></li>
<li>If you are doing HTTP POST, then you can <strong>pass additional data in the Request Body</strong> along with the other two methods described above</li>
<li><i>REST API</i> works by sending an HTTP Request and getting an <strong>HTTP Response</strong></li>
<li>The HTTP Response of a web service can contain Headers and Response Data, which can be in binary, text, JSON, XML, or other formats.</li>
<li>You can secure your data by simply sending it over the <strong>HTTPS (Secure HTTP) protocol</strong> or encrypting values passed along with your request.</li>
</ul>
<h2>Tasks/Components in SSIS for Consuming RESTful API / WebService</h2>
<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 target="_blank" rel="noopener">JSON Source</a> (Read from REST API, JSON file or OData Service): Use this dataflow component when you have to <strong>fetch data from a REST API web service like a table</strong>. This component enables you to extract JSON data from web services and de-normalize nested structures, allowing you to save the data to a Relational database, such as SQL Server, or any other target (Oracle, FlatFile, Excel, MySQL). This component also supports reading local JSON files or direct JavaScript strings (Wildcard pattern support, e.g., c:\data\file*.json).</td>
</tr>
<tr>
<td><img decoding="async" style="width: 72px;height: 72px" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/web-api-destination/ssis-web-api-destination.png" alt="SSIS Custom Target Adapter - Web API Destination" /></td>
<td style="vertical-align: top"><a href="//zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/">Web API Destination</a> (POST data to API URL): Use this data flow component when you need to load data into a target system via API calls (<a href="https://zappysys.com/blog/http-post-in-ssis-send-data-to-web-api-url-json-xml/" target="_blank" rel="noopener">POST to URL</a>). E.g., Loading Contacts into a Marketing System like <a href="//zappysys.com/blog/get-data-from-mailchimp-in-ssis-using-rest-api-call/" target="_blank" rel="noopener">MailChimp</a> for email campaigns. Loading documents into CRM or document storage systems, e.g,. Couchbase or <a href="//zappysys.com/blog/call-elasticsearch-api-using-ssis/" target="_blank" rel="noopener">ElasticSearch</a>.</td>
</tr>
<tr>
<td><img decoding="async" style="width: 72px;height: 72px" src="//zappysys.com/images/ssis-powerpack/ssis-rest-api-web-service-task.png" alt="Custom SSIS Tasks - SSIS Rest Api Web Service Task" /></td>
<td style="vertical-align: top"><a target="_blank" rel="noopener">REST API Tak</a>: Use this task when you don’t want to pull REST API data in tabular format but want to call the REST API for POST data to the server, DELETE data from the server, or things like download an HTML page, extract Authentication tokens, etc, where you are not necessarily dealing with data in tabular format. This task also allows you many other options, such as saving the RAW response into a variable or a file.</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 target="_blank" rel="noopener">XML Source</a> (SOAP, File, REST): Use this dataflow component when you have to fetch data from an XML or SOAP web service and consume data like a table. This component allows you to extract data from a web service and save it to SQL Server or any other target (Oracle, FlatFile, Excel, MySQL). This component also supports reading local XML files or a 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</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 a web service and save it 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>
<h2>Using SSIS JSON Source to read from REST API and load into SQL Server</h2>
<div>
<p>If you need to consume a REST API Service and store the result into SQL Server or any other RDBMS/FLAT File, then you can check this <a target="_blank" rel="noopener">SSIS JSON Source</a>. The JSON Source can deserialize your nested JSON (it also supports JSONPath filter expressions).</p>
<table>
<tbody>
<tr>
<td><a href="https://zappysys.com/blog/call-rest-api-using-ssis-web-service-task/"><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 /></td>
</tr>
</tbody>
</table>
</div>
<h2>REST API Task &#8211; Ad-hoc web requests &#8211; Call REST API (POST, DELETE)</h2>
<table>
<tbody>
<tr>
<td><a href="https://zappysys.com/blog/call-rest-api-using-ssis-web-service-task/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FjPdcQlWOBZA%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></td>
</tr>
</tbody>
</table>
<h2>HTTP GET Request using SSIS Web Service Task or JSON/XML Source</h2>
<div>Calling the REST API from the <strong>SQL Server BI Stack</strong> usually requires programming skills. <span style="box-sizing: border-box; margin: 0px; padding: 0px;">However, in this section, we will learn how easy it is to call <strong>a RESTful Web Service</strong> using the SSIS Web Service Task, JSON Source, or XML Source (all of which are drag-and-drop components</span>).</div>
<p>In this example, we will retrieve JSON data from an OData web service.</p>
<ul>
<li><a title="Download - SSIS REST API Web Service Task" href="//zappysys.com/products/ssis-powerpack/download/">Download and Install SSIS PowerPack</a></li>
<li>Create a new sample SSIS package in BIDS/SSDT</li>
<li>From the SSIS Toolbox, look for items starting with &#8220;ZS&#8221;. Drag and Drop [ZS Rest API Web Service Task] to Designer Surface</li>
<li>Configure HTTP Request properties as below</li>
<li>Configure HTTP Response properties as below</li>
<li>Run SSIS Package</li>
</ul>
<h3>Pass values in HTTP Headers</h3>
<div>
<p>You can pass a value in HTTP Headers using a direct approach or a dynamic approach. If you wish to pass a value from an SSIS variable, then use a variable placeholder, e.g., {{User::varSomeVariable}}. You can also use a variable format specifier, e.g.</p>
<ul>
<li><strong>Format Date:</strong> {{User::varSomeVariable,yyyy-MM-dd}}</li>
<li><strong>Encode into BASE64:</strong> {{User::varSomeVariable,BASE64ENC}}</li>
<li><strong>Decode into plain text from BASE64:</strong> {{User::varSomeVariable,BASE64DEC}}</li>
</ul>
</div>
<div>
<div id="attachment_11523" style="width: 848px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/08/SSIS-REST-Api-Task-HTTP-POST-SSIS-Call-Web-Service.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11523" class="size-full wp-image-11523" src="https://zappysys.com/blog/wp-content/uploads/2015/08/SSIS-REST-Api-Task-HTTP-POST-SSIS-Call-Web-Service.png" alt="" width="838" height="735" srcset="https://zappysys.com/blog/wp-content/uploads/2015/08/SSIS-REST-Api-Task-HTTP-POST-SSIS-Call-Web-Service.png 838w, https://zappysys.com/blog/wp-content/uploads/2015/08/SSIS-REST-Api-Task-HTTP-POST-SSIS-Call-Web-Service-300x263.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/08/SSIS-REST-Api-Task-HTTP-POST-SSIS-Call-Web-Service-768x674.png 768w" sizes="(max-width: 838px) 100vw, 838px" /></a><p id="caption-attachment-11523" class="wp-caption-text">Calling REST API in SSIS using REST API Task, Pass headers, Body, Url Parameters</p></div>
<div class="mceTemp"></div>
</div>
<div>
<div id="attachment_11522" style="width: 848px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/08/SSIS-REST-Api-Task-HTTP-GET-Test-SSIS-Web-Service-Call-Pass-Custom-Header.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11522" class="size-full wp-image-11522" src="https://zappysys.com/blog/wp-content/uploads/2015/08/SSIS-REST-Api-Task-HTTP-GET-Test-SSIS-Web-Service-Call-Pass-Custom-Header.png" alt="" width="838" height="735" srcset="https://zappysys.com/blog/wp-content/uploads/2015/08/SSIS-REST-Api-Task-HTTP-GET-Test-SSIS-Web-Service-Call-Pass-Custom-Header.png 838w, https://zappysys.com/blog/wp-content/uploads/2015/08/SSIS-REST-Api-Task-HTTP-GET-Test-SSIS-Web-Service-Call-Pass-Custom-Header-300x263.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/08/SSIS-REST-Api-Task-HTTP-GET-Test-SSIS-Web-Service-Call-Pass-Custom-Header-768x674.png 768w" sizes="(max-width: 838px) 100vw, 838px" /></a><p id="caption-attachment-11522" class="wp-caption-text">SSIS REST Api Task &#8211; HTTP GET, Test SSIS Web Service Call, Pass Custom Header</p></div>
</div>
<div>
<div class="mceTemp"></div>
<div id="attachment_11524" style="width: 848px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/08/SSIS-REST-Api-Task-Validate-Status-Code-Content-and-Header.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11524" class="size-full wp-image-11524" src="https://zappysys.com/blog/wp-content/uploads/2015/08/SSIS-REST-Api-Task-Validate-Status-Code-Content-and-Header.png" alt="" width="838" height="735" srcset="https://zappysys.com/blog/wp-content/uploads/2015/08/SSIS-REST-Api-Task-Validate-Status-Code-Content-and-Header.png 838w, https://zappysys.com/blog/wp-content/uploads/2015/08/SSIS-REST-Api-Task-Validate-Status-Code-Content-and-Header-300x263.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/08/SSIS-REST-Api-Task-Validate-Status-Code-Content-and-Header-768x674.png 768w" sizes="(max-width: 838px) 100vw, 838px" /></a><p id="caption-attachment-11524" class="wp-caption-text">REST API response validation ( By status code, content, header)</p></div>
</div>
<div></div>
<h3>Pass values in the Query String dynamically</h3>
<div>Most web services usually accept parameters via the query string. You can also use variable placeholders to make your URL with Querystring dynamic (e.g., https://mysite.com/orderservice/?startrow={{User::varStart}}&amp;endrow={{User::varEnd}}</div>
<h2>HTTP POST Request using SSIS Web Service Task or JSON/XML Source</h2>
<div>
<p>When you select the HTTP POST <span style="box-sizing: border-box; margin: 0px; padding: 0px;">method, the content-type is set to <em>application/x-www-form-urlencoded by default</em></span>. With the POST method, you can send POST data. When the POST method is selected, the data textbox becomes editable. You can also use variable place holders in POST data to make it dynamic.</p>
<p>POST data is usually in key/value format (e.g., user=abcd&amp;pass=mypass123), but sometimes the service requires data in JSON format or XML format. In that case, you can submit that way. Depending on the service requirements, you must set additional headers to indicate the content type (please refer to your service documentation).</p>
<h3>Uploading files using HTTP Multipart/form-data POST Request</h3>
<p>Many API support uploading files along with your POST request. Refer to <a href="//zappysys.com/blog/rest-api-file-upload-using-ssis-multi-part-post/" target="_blank" rel="noopener">this article</a> to learn more about how to upload files using REST API calls.</p>
</div>
<h2>Passing Credentials to your Web Service</h2>
<div>
<p>If your service requires authentication, ensure that you pass the credentials needed in the correct format. Below is a list of some of the most common authentication techniques.</p>
<p>There are mainly three connections:</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>
<li>Salesforce Connection</li>
</ol>
<h3><strong>Using HTTP Connection</strong></h3>
<p>HTTP Connection supports multiple methods for authenticating to your API. Here are some popular modes.</p>
<ul>
<li><a href="//zappysys.com/blog/how-to-set-base64-encoded-authorization-header-for-http-web-request/" target="_blank" rel="noopener">Basic Authentication</a> (UserID and Password Approach)</li>
<li><a href="https://zappysys.com/blog/call-soap-rest-api-using-dynamic-token-ssis/" target="_blank" rel="noopener">Dynamic Token approach</a> (Two-step process &#8211; First get Token and then Call API (Pass the token extracted in the first step)</li>
<li>Static Token</li>
<li><a href="https://zappysys.com/blog/using-hmac-authentication-api-ssis-odbc-drivers/" target="_blank" rel="noopener">HMAC / Hash Signature Authentication</a></li>
<li><a href="https://zappysys.com/blog/get-data-from-workday-in-ssis-using-soap-or-rest-api/" target="_blank" rel="noopener">SOAP WSS Security</a></li>
<li>Windows Authentication (NTLM)</li>
<li>Client Certificate</li>
</ul>
<h3>OAuth Connection</h3>
<p>Many modern APIs now support OAuth Standard (i.e. v2.0, v1.0, v1.0a). ZappySys offers out-of-the-box support for this standard using <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-oauth-connection-manager.htm" target="_blank" rel="noopener">OAuth Connection Manager</a></p>
<ul>
<li><a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">OAuth authorization</a>
<ul>
<li>Authorize Code Grant (3-legged &#8211; using Login Popup)</li>
<li>Client Credentials Grant (Simple key/secret &#8211; No login Popup)</li>
<li>Password Grant (Use of userid /password rather than only key/secret)</li>
</ul>
</li>
</ul>
</div>
<h3>Basic Authentication &#8211; Set Authorization Header (Base64 Encoding)</h3>
<div>The HTTP Standard supports BASIC Authorization mode, in which you can pass the username and password as a base64-encoded string. Check this article for more <span style="box-sizing: border-box; margin: 0px; padding: 0px;">information <a target="_blank" rel="noopener">on how</a></span><a href="//zappysys.com/blog/how-to-set-base64-encoded-authorization-header-for-http-web-request/"> to pass a BASE64 Encoded Authorization Header</a></div>
<h3>Token-based approach &#8211; such as OAuth</h3>
<div>This is becoming the most common approach, utilizing protocols such as OAuth, where the user first authenticates to the service using an AccountKey and SecretKey. Once authenticated, you receive a token that can be valid for a certain duration (or an infinite duration). After you receive the token, you can call services (each service call will include this token). Parsing a token from the initial response can be achieved through the REST API Response Filter Expression (e.g., $.token) or using the <a href="//zappysys.com/products/ssis-powerpack/ssis-json-parser-task-free/">JSON Parser Task</a>.</div>
<div>
<h3>OAuth Authorization</h3>
<div>All REST API Tasks/Components in Zappysys SSIS PowerPack support <strong>OAuth</strong> Authorization. OAuth is gaining popularity, and many larger companies have already adopted this standard (e.g., Facebook, Twitter, Google, Salesforce). With this method, you can connect to the REST API Service without storing your User ID/Password. Only the first time, you need to log in using your credentials to obtain an initial Token, and after that, the service will continue to use the Access Token rather than your username and password. Once the Token expires, it can automatically renew.  <a href="//zappysys.com/blog/tag/oauth/">Check this for more information about using OAuth</a>.</div>
</div>
<h3>Windows Authentication (NTLM)</h3>
<p>By default, ZappySys REST API Tasks/Components use your default credentials. You can also use the HTTP Connection Manager with the &#8220;Use Credentials&#8221;&gt; &#8220;Use Windows Authentication&#8221; option. <a href="//zappysys.com/blog/how-to-set-base64-encoded-authorization-header-for-http-web-request/" target="_blank" rel="noopener">See this article</a></p>
<h3>Pass Client Certificate</h3>
<p>Sometimes you may have to pass a client certificate along with your web request. The server checks the certificate passed along with your request and, if it matches, proceeds with your request. Here is the real-world use case <a href="https://azure.microsoft.com/en-us/documentation/articles/cloud-services-certs-create/" target="_blank" rel="noopener">How Azure Management Api uses Client Certificate</a>.</p>
<p><span style="box-sizing: border-box; margin: 0px; padding: 0px;">ZappySys <a target="_blank" rel="noopener">HTTP Connection Manager</a> and <a target="_blank" rel="noopener">OAuth Connection Manager</a> both support passing a Client certificate.</span></p>
<h2>Saving HTTP Web Service Response to a File or Variable</h2>
<div class="d-editor-preview">
<p>Let’s break down how to save the response from a ZappySys REST API Task into either an SSIS variable or a file within your SSIS package.</p>
<p><strong>Scenario:</strong> Imagine you’re using the ZappySys REST API Task to retrieve JSON data from a URL. You want to store this data for further processing within your SSIS package.</p>
<h3>1. Saving the REST API Response to an SSIS Variable</h3>
<p>This is ideal when you need to manipulate the data within your SSIS package.</p>
<ol>
<li><strong>Add a ZappySys REST API Task to your Control Flow:</strong><br />
Drag and drop the task onto your SSIS package’s Control Flow.</li>
<li><strong>Configure the REST API Task:</strong>
<ul>
<li>Set the <code>Connection</code> Property to your REST API Connection Manager. (Optional)</li>
<li>Specify the <code>URL</code> of the API endpoint.</li>
<li>Configure any necessary headers, query parameters, or request body.</li>
<li>Go to the &#8220;Response Settings&#8221; tab.</li>
</ul>
</li>
<li><strong>Configure the Output Variable:</strong>
<ul>
<li>Check-mark Save Response content</li>
<li>Select Save Mode as &#8220;Save to Variable&#8221;</li>
<li>Select or create an SSIS variable of type <code>String</code>. This variable, named <code>User::WeatherResponse</code> will store the REST API response.</li>
</ul>
<div class="mceTemp"></div>
<div id="attachment_11521" style="width: 848px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/08/Saving-the-REST-API-Response-to-an-SSIS-Variable.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11521" class="size-full wp-image-11521" src="https://zappysys.com/blog/wp-content/uploads/2015/08/Saving-the-REST-API-Response-to-an-SSIS-Variable.png" alt="" width="838" height="735" srcset="https://zappysys.com/blog/wp-content/uploads/2015/08/Saving-the-REST-API-Response-to-an-SSIS-Variable.png 838w, https://zappysys.com/blog/wp-content/uploads/2015/08/Saving-the-REST-API-Response-to-an-SSIS-Variable-300x263.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/08/Saving-the-REST-API-Response-to-an-SSIS-Variable-768x674.png 768w" sizes="(max-width: 838px) 100vw, 838px" /></a><p id="caption-attachment-11521" class="wp-caption-text">Saving the REST API Response to an SSIS Variable</p></div></li>
</ol>
<h3>2. Saving the REST API Response to a File</h3>
<p>This is useful for archiving the response or when you need to process the data outside of SSIS.</p>
<ol>
<li><strong>Add a ZappySys REST API Task to your Control Flow:</strong><br />
Drag and drop the task onto your SSIS package’s Control Flow.</li>
<li><strong>Configure the REST API Task:</strong>
<ul>
<li>Set the <code>Connection</code> Property to your REST API Connection Manager. (Optional)</li>
<li>Specify the <code>URL</code> of the API endpoint.</li>
<li>Configure any necessary headers, query parameters, or request body.</li>
<li>Go to the &#8220;Response Settings&#8221; tab.</li>
</ul>
</li>
<li><strong>Configure the Output File:</strong>
<ul>
<li>Check-mark Save Response content</li>
<li>Select Save Mode as &#8220;Save to File&#8221;</li>
<li>In the “Enter File Path” property, specify the path and filename where you want to save the REST API response. For example, if you are fetching JSON data from a product API, you can save it to the following file: <code>C:\Data\Products.json</code>.
<div class="mceTemp"></div>
</li>
</ul>
</li>
</ol>
<div id="attachment_11520" style="width: 848px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/08/Saving-the-REST-API-Response-to-a-File.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11520" class="size-full wp-image-11520" src="https://zappysys.com/blog/wp-content/uploads/2015/08/Saving-the-REST-API-Response-to-a-File.png" alt="" width="838" height="735" srcset="https://zappysys.com/blog/wp-content/uploads/2015/08/Saving-the-REST-API-Response-to-a-File.png 838w, https://zappysys.com/blog/wp-content/uploads/2015/08/Saving-the-REST-API-Response-to-a-File-300x263.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/08/Saving-the-REST-API-Response-to-a-File-768x674.png 768w" sizes="(max-width: 838px) 100vw, 838px" /></a><p id="caption-attachment-11520" class="wp-caption-text">Saving the REST API Response to a File</p></div>
<p>REST APIs enable array filtering to extract specific data from JSON or XML responses. This is achieved through techniques such as query parameters, JSONPath (for JSON), and XPath (for XML), allowing for the precise selection of elements. Additionally, regular expressions can be employed for string-based filtering and data validation.</p>
<div id="attachment_11519" style="width: 848px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/08/REST-APIs-enable-array-filtering-to-extract-specific-data-from-JSON-or-XML-responses.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11519" class="size-full wp-image-11519" src="https://zappysys.com/blog/wp-content/uploads/2015/08/REST-APIs-enable-array-filtering-to-extract-specific-data-from-JSON-or-XML-responses.png" alt="" width="838" height="275" srcset="https://zappysys.com/blog/wp-content/uploads/2015/08/REST-APIs-enable-array-filtering-to-extract-specific-data-from-JSON-or-XML-responses.png 838w, https://zappysys.com/blog/wp-content/uploads/2015/08/REST-APIs-enable-array-filtering-to-extract-specific-data-from-JSON-or-XML-responses-300x98.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/08/REST-APIs-enable-array-filtering-to-extract-specific-data-from-JSON-or-XML-responses-768x252.png 768w" sizes="(max-width: 838px) 100vw, 838px" /></a><p id="caption-attachment-11519" class="wp-caption-text">REST APIs enable array filtering to extract specific data from JSON or XML responses.</p></div>
<h4>Key Setting: “Treat response as binary”</h4>
<p>As highlighted in the steps, the <strong>“Treat response as binary”</strong> option in the “Response” tab is the most important setting for correctly saving binary files. If you don’t check this, the task might try to interpret the binary data as text.</p>
<p><strong>Example Scenario:</strong></p>
<p>Let’s say you want to download a ZIP file from a REST API or a Public URL:</p>
<ul>
<li><strong>API URL:</strong> <code>https://example.com/api/download/archive.zip</code></li>
<li><strong>File Path:</strong> <code>C:\Downloads\archive.zip</code></li>
<li>In the ZS Rest API Task’s “Response” tab, you would:
<ul>
<li>Check-mark Save Response content</li>
<li>Select Save Mode as &#8220;Save to File&#8221;</li>
<li><strong>Check “Treat response as binary”.</strong></li>
<li>In the “Enter File Path” property, specify the path and filename where you want to save the REST API response. <code>C:\Downloads\archive.zip</code>.</li>
</ul>
<div class="mceTemp"></div>
<div id="attachment_11518" style="width: 848px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/08/REST-API-Task-Download-File.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11518" class="size-full wp-image-11518" src="https://zappysys.com/blog/wp-content/uploads/2015/08/REST-API-Task-Download-File.png" alt="" width="838" height="280" srcset="https://zappysys.com/blog/wp-content/uploads/2015/08/REST-API-Task-Download-File.png 838w, https://zappysys.com/blog/wp-content/uploads/2015/08/REST-API-Task-Download-File-300x100.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/08/REST-API-Task-Download-File-768x257.png 768w" sizes="(max-width: 838px) 100vw, 838px" /></a><p id="caption-attachment-11518" class="wp-caption-text">REST API Task &#8211; Download File</p></div></li>
</ul>
<p>By following these steps, you can effectively use the ZappySys Rest API Task to download and save binary content from REST APIs to files within your SSIS workflows.</p>
</div>
<h2>Save HTTP Web Response Headers / StatusCode</h2>
<div>If you wish to save the response to a file, then go to the response tab of the REST API Task and check the &#8220;Save Response&#8221; option, and you can select Save to File option from the dropdown</div>
<h2>HTTP Web Response Validation</h2>
<p><a target="_blank" rel="noopener">REST API Task</a> supports validating your response for a specific header, status code, or content value. See the Validation tab for more information. Using this feature, you can throw an error if a certain header is missing from the response or reject the response if the StatusCode is other than 200.</p>
<div>
<h2>REST API Pagination (Loop through multiple requests)</h2>
<p>Another popular concept in REST API is paging. If your response is significant, the server often returns a partial response. You must then ensure that you consume the remaining data by requesting all subsequent URLs until the last page is returned.</p>
<p><a href="//zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/" target="_blank" rel="noopener">Read this article to learn more about rest api paging</a></p>
<h2>HTTP Web Response Error Handling</h2>
<p><a href="//zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/">REST API Task</a> supports rich error handling. You can ignore specific errors and save the error flag into a variable based on any of the following criteria.</p>
<ul>
<li>Continue on any error</li>
<li>Continue on error with specific Response Code (e.g. 404)</li>
<li>Continue on error with a specific string in the message</li>
</ul>
<h2>Read/Write and Parse Cookies for HTTP Web Request/Response</h2>
<p>Many times, you need to supply an authentication token via cookies, or any other information must be passed via cookies. In such cases, the REST API Task provides complete support for reading, writing, or parsing individual values from a cookie string. Look at the Cookies tab for more information. The Cookie Mapping grid can help you to map a cookie value to an SSIS variable (Write Cookie value to a variable).</p>
<p><a href="//zappysys.com/blog/ssis-rest-api-task-pass-cookies-to-web-request/" target="_blank" rel="noopener">Read this article to learn more about passing cookies with your web request</a></p>
<h2>Changing Headers/URL or POST data Dynamically</h2>
<p>Most of the fields on the REST API Task, JSON Source, and XML Source support placeholders.</p>
<p>Use a placeholder anywhere in the following fields using {{User::yourVariable}} format. If you edit the value, you may see the Insert PlaceHolder option.</p>
<ul>
<li>Url</li>
<li>Body</li>
<li>Headers</li>
</ul>
<p>You may format datetime using special syntax like this {{User::myDate,yyyy-MM-dd HHmmss.fff}}</p>
</div>
<h2>Extract a single value from JSON/XML Web Response (e.g., Token)</h2>
<div>If your web response is in JSON or XML format, then you can filter it using Expression (e.g., <a target="_blank" rel="noopener">JSONPath </a>or <a href="https://en.wikipedia.org/wiki/XPath" target="_blank" rel="noopener">XPath</a>). Go to the Response Tab and select Content Type Format from the dropdown. Enter an expression to select a nested sub-document or a value from your response. If you want to save individual properties from the response into multiple variables, then use <a href="//zappysys.com/products/ssis-powerpack/ssis-json-parser-task-free/">JSON Parser Task</a></div>
<p>The most common use case is if you are getting a token from your JSON REST API service. Assume that Service sends you a response in the following format, but you only care about the access_token property from the response below. In that case you can use JSON Path expression like this <strong>$.data.access_token</strong></p><pre class="crayon-plain-tag">{
&nbsp;&nbsp;&nbsp; data: {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; access_token: 111223344444,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; expires_in: 3600
&nbsp;&nbsp;&nbsp; }
}</pre><p>
<h2>REST API Testing / Debugging Tools (3rd party)</h2>
<p>Now, let&#8217;s look at a few popular tools that you will need to test/debug REST API calls during your development cycle.</p>
<h3>Testing Rest API</h3>
<p>There are a  few ways to test REST APIs, and each tool has its pros and cons, but the most popular tool to test REST API is Postman, so we will start from there</p>
<ol>
<li><a href="https://www.postman.com/downloads/" target="_blank" rel="noopener">Postman</a> &#8211; GUI<br />
Postman offers an excellent User interface to test the API. You can edit URLs, methods, and parameters, and add authentication with ease. See our article on how to <a href="https://zappysys.com/blog/postman-to-ssis-odbc-powerpack/" target="_blank" rel="noopener">migrate Postman settings to zappysys UI</a>. Many API Providers offer easy-to-use Postman settings files for Testing API in Postman. If your API offers such a file, simply import it into Postman and start testing before using the ZappySys UI.</li>
<li><a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI</a> &#8211; GUI<br />
SoapUI is another tool to test SOAP or REST APIs. They are primarily known for SOAP API Testing, but in recent versions, they have enhanced REST API Testing capability.</li>
<li><a href="https://curl.haxx.se/" target="_blank" rel="noopener">cURL</a> &#8211; Command line<br />
If you want to call/test the API via the command line, then this is the most popular tool. Many API vendors use cURL syntax in their API documentation. Here is how to <a href="https://zappysys.com/blog/using-ssis-curl-syntax-to-ssis-api-task/">migrate cURL syntax to ZappySys UI</a>.</li>
<li>Fiddler- GUI<br />
Fiddler has limited capability to test API call &#8211; <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/#How_to_Test_API_using_Fiddler_Call_REST_API_for_without_Postman" target="_blank" rel="noopener">See Replay in Composer option</a></li>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">ZappySys REST API Task</a><br />
You can use the ZappySys REST API Task to <a href="https://i0.wp.com/zappysys.com/blog/wp-content/uploads/2019/04/ssis-call-freshdesk-rest-api.png?ssl=1" target="_blank" rel="noopener">test the API inside Visual Studio</a>. Edit URL / Headers / Body, etc, and click the <strong>Test Request Response</strong> option</li>
</ol>
<h3>Debugging REST API &#8211; Proxy</h3>
<p>So far, we have seen client tools to test Request/Response for the URL you entered in the UI, but what if you want to Sniff Requests sent by some applications for which you have no way to know what Request Data / URL, or Body is sent behind the scenes? What response is it getting back and so on? Well, not to worry&#8230; Telerik Fiddler is the most popular tool at your fingertips and it&#8217;s FREE.</p>
<ol>
<li><a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">Fiddler</a> &#8211; HTTP /  HTTPS Proxy / Debugger</li>
<li><a href="https://www.wireshark.org/">Wireshark</a> &#8211; Low-level Network Packet Sniffer</li>
</ol>
<h2>Conclusion</h2>
<p>The REST API is becoming increasingly popular every day. With that, Data integration from RESTful services is going to be a challenge. <span style="box-sizing: border-box; margin: 0px; padding: 0px;"><a target="_blank" rel="noopener">The SSIS REST API Task </a>and <a target="_blank" rel="noopener">SSIS JSON Source</a> can help resolve some of the issues you may encounter</span> with SSIS. Use JSON Source if you need to store data into a SQL Table. Use REST API Task if you need to make an ad-hoc HTTP/REST request (such as get token, Delete Record, etc). ZappySys REST API Components gives you total control over your REST API Integration challenges without learning a programming language (e.g., Python, Ruby, C#, Java).</p>
<p>The post <a href="https://zappysys.com/blog/call-rest-api-using-ssis-web-service-task/">How to Call REST API in SSIS &#8211; Read JSON / XML / CSV</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
