<?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>ec2 Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/ec2/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/ec2/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Mon, 07 Apr 2025 13:01:41 +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>ec2 Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/ec2/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Read Amazon S3 data in Power BI or Call AWS REST API (JSON / XML)</title>
		<link>https://zappysys.com/blog/read-amazon-s3-data-power-bi-aws-json-xml-api/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 15 Jun 2018 23:03:05 +0000</pubDate>
				<category><![CDATA[Amazon S3 CSV Driver]]></category>
		<category><![CDATA[Amazon S3 JSON Driver]]></category>
		<category><![CDATA[Amazon S3 XML Driver]]></category>
		<category><![CDATA[JSON File / REST API Driver]]></category>
		<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[Reporting - Microsoft Power BI]]></category>
		<category><![CDATA[XML File / SOAP API Driver]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[lambda]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[s3]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=3974</guid>

					<description><![CDATA[<p>Introduction If you are looking around to find connectivity options to get Amazon AWS data in Power BI (e.g. Read from Amazon S3 files (CSV, JSON, XML) or get AWS API data such as Billing Data by calling REST API) then unfortunately as of now Power BI doesn&#8217;t support it natively. In this article, you will [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-amazon-s3-data-power-bi-aws-json-xml-api/">Read Amazon S3 data in Power BI or Call AWS REST API (JSON / XML)</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/power-bi-logo-310x310.png"><img decoding="async" class=" wp-image-3951 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-logo-310x310.png" alt="Power BI Integration" width="131" height="131" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-logo-310x310.png 310w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-logo-310x310-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-logo-310x310-300x300.png 300w" sizes="(max-width: 131px) 100vw, 131px" /></a>If you are looking around to find connectivity options to get Amazon AWS data in Power BI (e.g. Read from Amazon S3 files (CSV, JSON, XML) or get AWS API data such as Billing Data by calling REST API) then unfortunately as of now Power BI doesn&#8217;t support it natively.</p>
<p>In this article, you will learn  <strong>How to read Amazon S3 data in Power BI</strong> (Using <a href="https://zappysys.com/products/odbc-powerpack/amazon-s3-odbc-driver-csv-files/" target="_blank" rel="noopener">S3 CSV Driver</a>) and in later section we will also learn <strong>How to import data from AWS API Calls (e.g. Billing, EC2, S3, DynamoDB)</strong>. We will use <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys REST / JSON Driver</a> to access AWS data without any ETL or Programming.</p>
<p>In our previous article, we discussed how to <a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/">access REST API data in Power BI (Read JSON / XML Web API)</a>. Now let&#8217;s learn <strong>how to connect to AWS in Power BI</strong>.</p>
<p>In this article, We will explore interesting scenarios such as below. It will help you to connect Amazon AWS in Power BI and import data from AWS <strong>without doing any ETL or programming</strong>.</p>
<ul>
<li>Import JSON file from S3 bucket in Power BI (Using <a href="https://zappysys.com/products/odbc-powerpack/amazon-s3-odbc-driver-json-files/" target="_blank" rel="noopener">Amazon S3 Driver for JSON Files</a>).</li>
<li>Read CSV file from S3 bucket in Power BI (Using <a href="https://zappysys.com/products/odbc-powerpack/amazon-s3-odbc-driver-csv-files/" target="_blank" rel="noopener">Amazon S3 Driver for CSV Files</a>).</li>
<li>Read XML file from S3 bucket in Power BI (Using <a href="https://zappysys.com/products/odbc-powerpack/amazon-s3-odbc-driver-xml-files/" target="_blank" rel="noopener">Amazon S3 Driver for XML Files</a>).</li>
<li>Call Amazon AWS REST API (JSON or XML) and get data in Power BI. Some examples of API calls.
<ul>
<li>Get <strong>EC2 VM</strong> count and their Status in Power BI Dashboard</li>
<li>Read data from <strong>AWS Athena</strong> Service</li>
<li>Use <strong>AWS Cost / Billing API</strong> to display monthly Cost by Service</li>
<li>Display summary of <strong>Redshift</strong> Clusters</li>
<li>Extract response from <strong>Lambda</strong> function and display in Power BI</li>
</ul>
</li>
</ul>
<p>So let&#8217;s get started&#8230;</p>
<h2><span id="Requirements">Requirements</span></h2>
<ol>
<li>First, you will need to have <a href="https://powerbi.microsoft.com/en-us/desktop/" target="_blank" rel="noopener">Power BI Desktop (FREE)</a> installed</li>
<li>Make sure you have <strong>AWS Access Key</strong> and <strong>Secret Key</strong> to access AWS data or call API for the desired service</li>
<li>On third place, our <a href="https://zappysys.com/products/odbc-powerpack/">ZappySys ODBC Power Pack</a></li>
</ol>
<h2>Import Amazon S3 data in Power BI (CSV, JSON or XML Files)</h2>
<p>In this section we will look at step by step approach to load Amazon S3 data in Power BI. Your file can be compressed  (GZip, Zip) or un-compressed. We will use ZappySys <a href="https://zappysys.com/products/odbc-powerpack/amazon-s3-odbc-driver-csv-files/" target="_blank" rel="noopener">Amazon S3 driver for CSV Files</a> for demo but you can also use <a href="https://zappysys.com/products/odbc-powerpack/amazon-s3-odbc-driver-json-files/" target="_blank" rel="noopener">Amazon S3 JSON Driver</a> or <a href="https://zappysys.com/products/odbc-powerpack/amazon-s3-odbc-driver-xml-files/" target="_blank" rel="noopener">Amazon S3 Driver for XML Files</a> same way for reading different file formats.</p>
<h3><span id="Step-by-Step_Import_REST_API_into_Power_BI">Configure ODBC DSN for Amazon S3 Files ( JSON / XML / CSV )</span></h3>
<p>&nbsp;</p>
<ol>
<li>Type odbcad32.exe in your search box and launch the DSN Config utility.<img decoding="async" class="figureimage" src="https://zappysys.com/blog/wp-content/uploads/2018/03/odbc-data-source-64-bits.png" /></li>
<li>you want access for yourself then stay of User DSN Tab. If you want grant access other users then go to System DSN tab. For <a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/odbc-integration-programming-tsql.htm">SQL Server Integration</a> go to System Tab and add new System DSN rather than User DSN. Click New button.<br />
<img decoding="async" class="figureimage" title="ZappySys ODBC Driver - Open UI" src="https://zappysys.com/onlinehelp/odbc-powerpack/scr/images/zappysys-odbc-driver-open-ui.png" alt="ZappySys ODBC Driver - Open UI" /></li>
<li>From the Driver list Select ZappySys ODBC Driver. For this example select [<strong>ZappySys Amazon S3 CSV Driver</strong>].<br />
<img decoding="async" class="figureimage" title="ZappySys ODBC Driver - Create Amazon S3 CSV Driver" src="https://zappysys.com/onlinehelp/odbc-powerpack/scr/images/amazon-s3-csv-driver/amazon-s3-csv-driver-create.png" alt="ZappySys ODBC Driver - Create Amazon S3 CSV Driver" /></li>
<li>Now, we need Amazon S3 Storage Connection. Lets create it.<br />
<img decoding="async" class="figureimage" title="ODBC Amazon S3 Driver - Create Connection" src="https://zappysys.com/onlinehelp/odbc-powerpack/scr/images/amazon-s3-json-driver/amazon-s3-json-driver-create-connection.png" alt="ODBC Amazon S3 Driver - Create Connection" /></li>
<li>Now, When you see DSN Config Editor with zappysys logo first thing you need to do is change default DSN Name at the top and Select your bucket and file from it.<br />
<img decoding="async" class="figureimage" title="ODBC Amazon S3 Driver - Select File" src="https://zappysys.com/onlinehelp/odbc-powerpack/scr/images/amazon-s3-csv-driver/amazon-s3-csv-driver-select-file.png" alt="ODBC Amazon S3 Driver - Select File" /></li>
<li>Here, in the Compression (Zip/GZip) tab set suitable file format.<br />
<img decoding="async" class="figureimage" title="ZappySys ODBC Driver - Configure Amazon S3 CSV Driver" src="https://zappysys.com/onlinehelp/odbc-powerpack/scr/images/amazon-s3-csv-driver/amazon-s3-csv-driver-set-compression-file-format.png" alt="ZappySys ODBC Driver - Configure Amazon CSV Driver" /></li>
<li>Click on Preview Tab, Select Table from Tables Dropdown and select [value] and click Preview.<br />
<img decoding="async" class="figureimage" title="ZappySys ODBC Driver - Preview Data" src="https://zappysys.com/onlinehelp/odbc-powerpack/scr/images/json-driver/odbc-json-driver-preview-data.png" alt="ZappySys ODBC Driver - Preview Data" /></li>
<li>If you are using DSN method then Click OK to save our DSN Configuration.</li>
</ol>
<p>&nbsp;</p>
<h3>Load Amazon S3 Data in Power BI &#8211; using ODBC Driver Connection</h3>
<p>In the previous section, we configured ODBC DSN for AWS API call and added the ZappySys drivers in the ODBC Driver Administrator with information to connect to AWS S3 Files. We queried S3 File using ZappySys Amazon S3 Driver for CSV Files. Now we will open Power BI and import the information from ODBC  DSN we defined earlier.</p>
<ol>
<li>Open Power BI Desktop and select the option <strong>Get data</strong>
<div id="attachment_2830" style="width: 802px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/Get-data-Power-bi-desktop.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2830" class="wp-image-2830 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/03/Get-data-Power-bi-desktop.png" alt="Get data using power bi" width="792" height="335" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/Get-data-Power-bi-desktop.png 792w, https://zappysys.com/blog/wp-content/uploads/2018/03/Get-data-Power-bi-desktop-300x127.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/03/Get-data-Power-bi-desktop-768x325.png 768w" sizes="(max-width: 792px) 100vw, 792px" /></a><p id="caption-attachment-2830" class="wp-caption-text">Get data in power bi</p></div></li>
<li>Get Data will allow adding the ZappySys ODBC driver. Go to <strong>Other</strong> and select <strong>ODBC.</strong>
<div id="attachment_2835" style="width: 617px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-odbc-other-data-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2835" class="size-full wp-image-2835" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-odbc-other-data-source.png" alt="select odbc using power bi" width="607" height="635" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-odbc-other-data-source.png 607w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-odbc-other-data-source-287x300.png 287w" sizes="(max-width: 607px) 100vw, 607px" /></a><p id="caption-attachment-2835" class="wp-caption-text">Select odbc in Power BI</p></div></li>
<li>Select ODBC DSN name from the DSN dropdown</li>
<li>Now its time to import data. Basically, there are two modes to import data. <strong>Table Mode</strong> and <strong>Query Mode</strong>. We will <strong>Import using Power BI Query Mode</strong></li>
<li>Select your DSN and click <strong>Advanced Option</strong> to enter custom SQL Query to Import your REST API data. You can use ODBC DSN Data sources Preview tool to generate SQL Query. For example, you can enter a query like below. WITH clause is optional but you can supply many options to override DSN UI settings (e.g. Path, Credentials ).<br />
<pre class="crayon-plain-tag">/*--------- Amazon S3 Driver - Read CSV File Example - Override UI credentials in WITH clause ----------*/  
SELECT * FROM $  
WITH (  
  Src='Northwind-Bucket/Orders*.csv' --use wildcard * for pattern search
  -- ,AccessKey='AKIAxxxx' --not needed if you set in DSN connection
  -- ,SecretKey='a1wxxxxxxxxxxxxxx' --not needed if you set in DSN connection
  -- ,RegionName='us-west-1'
  -- ,ColumnDelimiter='|'
  -- ,HasColumnHeaderRow='False'
)</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-from-rest-api-url-odbc-json-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3861" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-from-rest-api-url-odbc-json-driver.png" alt="Import JSON / REST API data in Power BI using SQL Query Mode" width="518" height="581" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-from-rest-api-url-odbc-json-driver.png 518w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-from-rest-api-url-odbc-json-driver-267x300.png 267w" sizes="(max-width: 518px) 100vw, 518px" /></a></li>
<li>On the next screen select <strong>Windows Authentication</strong> to continue (No userid and password).
<div id="attachment_2853" style="width: 710px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/select-credentials-zappysys.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2853" class="size-full wp-image-2853" src="https://zappysys.com/blog/wp-content/uploads/2018/03/select-credentials-zappysys.png" alt="Select credentials" width="700" height="346" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/select-credentials-zappysys.png 700w, https://zappysys.com/blog/wp-content/uploads/2018/03/select-credentials-zappysys-300x148.png 300w" sizes="(max-width: 700px) 100vw, 700px" /></a><p id="caption-attachment-2853" class="wp-caption-text">Select Windows Credentials to connect to zappysys driver</p></div></li>
<li>Click OK to import data in Power BI</li>
<li>Now you can create custom Dashboard from imported Dataset.</li>
</ol>
<h2>AWS API Example &#8211;  <span id="Step-by-Step_Import_REST_API_into_Power_BI">Call Amazon S3 API in Power BI</span></h2>
<p>In our previous section we saw how to read Amazon S3 data using native ZappySys S3 Drivers (For CSV , JSON and XML Files), this approach is preferred way to read S3 Files for sure because it gives you UI to browse files, it gives you ability to read from multiple files and many more S3 specific features.</p>
<p>However in some cases you have to call REST API in a manual way using REST API driver rather than S3 Driver. In next section we will see more interesting use case of calling AWS API (e.g. Billing / Cost API).</p>
<p>Now lets look at steps &#8211; How to import Amazon S3 data Power BI by calling REST API manually. Steps listed below are almost identical for XML or JSON data format except for selecting Driver Type (i.e. JSON, XML, CSV).</p>
<h3><span id="Step-by-Step_Import_REST_API_into_Power_BI">Configure ODBC DSN for REST API ( JSON / XML / CSV )</span></h3>
<p>To consume S3 data in Power BI, first we have to create ODBC DSN using ZappySys Driver (XML or JSON). Perform the following steps.</p>
<ol>
<li>To do this, we will first open the ODBC Data Source (32 bit):
<div id="attachment_2827" style="width: 403px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/open-ODBC-Data-souce-administrator.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2827" class="wp-image-2827 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/03/open-ODBC-Data-souce-administrator.png" alt="Open odbc" width="393" height="531" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/open-ODBC-Data-souce-administrator.png 393w, https://zappysys.com/blog/wp-content/uploads/2018/03/open-ODBC-Data-souce-administrator-222x300.png 222w" sizes="(max-width: 393px) 100vw, 393px" /></a><p id="caption-attachment-2827" class="wp-caption-text">Open odbc data source</p></div></li>
<li>Use the User DSN page and press<strong> Add</strong>
<div id="attachment_2765" style="width: 600px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/add-new-data-source-odbc-administrator.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2765" class="wp-image-2765 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/03/add-new-data-source-odbc-administrator.png" alt="New Data source" width="590" height="423" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/add-new-data-source-odbc-administrator.png 590w, https://zappysys.com/blog/wp-content/uploads/2018/03/add-new-data-source-odbc-administrator-300x215.png 300w" sizes="(max-width: 590px) 100vw, 590px" /></a><p id="caption-attachment-2765" class="wp-caption-text">Add new data source</p></div></li>
<li>Add the ZappySys XML Driver if you are accessing XML files from S3 Bucket or calling any AWS API which returns data in XML format. Select JSON driver for JSON data (or API Access in JSON Format)
<div id="attachment_3875" style="width: 603px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-odbc-xml-soap-api-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3875" class="size-full wp-image-3875" src="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-odbc-xml-soap-api-driver.png" alt="ZappySys ODBC Driver for XML / SOAP API" width="593" height="459" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-odbc-xml-soap-api-driver.png 593w, https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-odbc-xml-soap-api-driver-300x232.png 300w" sizes="(max-width: 593px) 100vw, 593px" /></a><p id="caption-attachment-3875" class="wp-caption-text">Create DSN using ZappySys ODBC Driver for XML / SOAP API</p></div></li>
<li>It is time to connect with <strong>Amazon S3 File</strong> and read data. In <strong>Data Source (URL or File Path),</strong> we will use XML file URL as below. Notice that S3 URL has 3 parts (<strong>zs-dump1</strong> is bucket name, <strong>s3.us-east-1.amazonaws.com</strong> is service endpoint for S3 (some service doesn&#8217;t require region) and <strong>store_001.xml</strong> is our file name. After you specify URL select Connection as per the screenshot.<strong>Syntax for URL :  BucketName</strong> + <strong>ServiceURL</strong> + <strong>FilePath.</strong>If you are not sure what can be your service endpoint then check <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html" target="_blank" rel="noopener">this table</a>.<br />
<pre class="crayon-plain-tag">https://zs-dump1.s3.amazonaws.com/store_001.xml
--OR--
https://zs-dump1.s3.amazonaws.com/mysubfolder/store_001.xml
--OR--
https://zs-dump1.s3.us-east-1.amazonaws.com/mysubfolder/store_001.xml</pre>
<div id="attachment_3982" style="width: 773px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/xml-file-amazon-aws-api-connection-for-power-bi-tableau-informatica.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3982" class="size-full wp-image-3982" src="https://zappysys.com/blog/wp-content/uploads/2018/06/xml-file-amazon-aws-api-connection-for-power-bi-tableau-informatica.png" alt="Configure Amazon S3 Connection - Read from XML / JSON File" width="763" height="572" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/xml-file-amazon-aws-api-connection-for-power-bi-tableau-informatica.png 763w, https://zappysys.com/blog/wp-content/uploads/2018/06/xml-file-amazon-aws-api-connection-for-power-bi-tableau-informatica-300x225.png 300w" sizes="(max-width: 763px) 100vw, 763px" /></a><p id="caption-attachment-3982" class="wp-caption-text">Configure Amazon S3 Connection &#8211; Read from XML File or JSON File</p></div>
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff8b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>NOTE:</strong> If a filename contains a space, e.g. &#8220;<em>store abc.xml</em>&#8220;, make sure to replace space with <em>&#8220;%20&#8221;</em> (&#8220;+&#8221; will <strong>not</strong> work). So &#8220;store abc.xml&#8221; should become &#8220;<em>store%20abc.xml</em>&#8220;. </div></div></li>
<li>Once you specify the URL and Credentials, Next select Filter (This helps to flatten the nested hierarchy of your Data). If you don&#8217;t have nested Hierarchy then skip this step.
<div id="attachment_3983" style="width: 817px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-driver-read-amazon-s3-xml-file-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3983" class="size-full wp-image-3983" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-driver-read-amazon-s3-xml-file-1.png" alt="Select Filter (Flatten the hierarchy to extract data from nested structure)" width="807" height="701" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-driver-read-amazon-s3-xml-file-1.png 807w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-driver-read-amazon-s3-xml-file-1-300x261.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-driver-read-amazon-s3-xml-file-1-768x667.png 768w" sizes="(max-width: 807px) 100vw, 807px" /></a><p id="caption-attachment-3983" class="wp-caption-text">Select Filter (Flatten the hierarchy to extract data from nested structure)</p></div>
<p>&nbsp;</li>
<li>Now go to Preview Tab and click Preview button in the toolbar. You can remove attributes in the query to use default attributes from Previous Tab. You can always override DSN level setting inside WITH clause of SQL.
<div id="attachment_3984" style="width: 618px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/read-xml-json-from-amazon-s3-bucket-power-bi-tableau-reports-etl-informatica.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3984" class="size-full wp-image-3984" src="https://zappysys.com/blog/wp-content/uploads/2018/06/read-xml-json-from-amazon-s3-bucket-power-bi-tableau-reports-etl-informatica.png" alt="Preview data from AWS S3 File (XML Data) - Use ZappySys XML Driver to Connect to AWS API" width="608" height="701" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/read-xml-json-from-amazon-s3-bucket-power-bi-tableau-reports-etl-informatica.png 608w, https://zappysys.com/blog/wp-content/uploads/2018/06/read-xml-json-from-amazon-s3-bucket-power-bi-tableau-reports-etl-informatica-260x300.png 260w" sizes="(max-width: 608px) 100vw, 608px" /></a><p id="caption-attachment-3984" class="wp-caption-text">Preview data from AWS S3 File (XML Data) &#8211; Use ZappySys XML Driver to Connect to AWS API</p></div></li>
<li>To learn more about query language click on View Examples</li>
<li>Click OK to save your ODBC DSN settings.</li>
</ol>
<p>&nbsp;</p>
<h3>Import AWS S3 File or AWS API data in Power BI dataset</h3>
<p>Now let&#8217;s look at how to import Amazon S3 data in Power BI using ZappySys XML driver.</p>
<p>In the previous section, we configured ODBC DSN for AWS API call and added the ZappySys drivers in the ODBC Driver Administrator with information to connect to AWS REST API. We queried S3 File using ZappySys XML Driver. Now we will open Power BI and import the information from ZappySys JSON Driver via ODBC connectivity option in Power BI.</p>
<ol>
<li>Open Power BI Desktop and select the option <strong>Get data</strong>
<div id="attachment_2830" style="width: 802px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/Get-data-Power-bi-desktop.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2830" class="wp-image-2830 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/03/Get-data-Power-bi-desktop.png" alt="Get data using power bi" width="792" height="335" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/Get-data-Power-bi-desktop.png 792w, https://zappysys.com/blog/wp-content/uploads/2018/03/Get-data-Power-bi-desktop-300x127.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/03/Get-data-Power-bi-desktop-768x325.png 768w" sizes="(max-width: 792px) 100vw, 792px" /></a><p id="caption-attachment-2830" class="wp-caption-text">Get data in power bi</p></div></li>
<li>Get Data will allow adding the ZappySys ODBC driver. Go to <strong>Other</strong> and select <strong>ODBC.</strong>
<div id="attachment_2835" style="width: 617px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-odbc-other-data-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2835" class="size-full wp-image-2835" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-odbc-other-data-source.png" alt="select odbc using power bi" width="607" height="635" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-odbc-other-data-source.png 607w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-odbc-other-data-source-287x300.png 287w" sizes="(max-width: 607px) 100vw, 607px" /></a><p id="caption-attachment-2835" class="wp-caption-text">Select odbc in Power BI</p></div></li>
<li>Select ODBC DSN name from the DSN dropdown</li>
<li>Now its time to import data. Basically, there are two modes to import data. <strong>Table Mode</strong> and <strong>Query Mode</strong>. We will <strong>Import using Power BI Query Mode</strong></li>
<li>Select your DSN and click Advanced Option to enter custom SQL Query to Import your REST API data. You can use ODBC DSN Data sources Preview tool to generate SQL Query. For example, you can enter a query like below.<br />
<pre class="crayon-plain-tag">SELECT "author", "title",  "genre", "price",  "publish_date", "description", "tag"
FROM $
WITH(
	 Src='https://zs-dump1.s3.amazonaws.com/store_001.xml'
	,Filter='$.store.book[*]'
	,ElementsToTreatAsArray='book'
)</pre>
<div id="attachment_3861" style="width: 528px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-from-rest-api-url-odbc-json-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3861" class="size-full wp-image-3861" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-from-rest-api-url-odbc-json-driver.png" alt="Import JSON / REST API data in Power BI using SQL Query Mode" width="518" height="581" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-from-rest-api-url-odbc-json-driver.png 518w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-from-rest-api-url-odbc-json-driver-267x300.png 267w" sizes="(max-width: 518px) 100vw, 518px" /></a><p id="caption-attachment-3861" class="wp-caption-text">Import JSON / REST API data in Power BI using SQL Query Mode</p></div>
<p>&nbsp;</li>
<li>On the next screen select <strong>Windows Authentication</strong> to continue (No userid and password).
<div id="attachment_2853" style="width: 710px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/select-credentials-zappysys.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2853" class="size-full wp-image-2853" src="https://zappysys.com/blog/wp-content/uploads/2018/03/select-credentials-zappysys.png" alt="Select credentials" width="700" height="346" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/select-credentials-zappysys.png 700w, https://zappysys.com/blog/wp-content/uploads/2018/03/select-credentials-zappysys-300x148.png 300w" sizes="(max-width: 700px) 100vw, 700px" /></a><p id="caption-attachment-2853" class="wp-caption-text">Select Windows Credentials to connect to zappysys driver</p></div></li>
<li>Click OK to import data in Power BI</li>
<li>Now you can create custom Dashboard from imported Dataset.</li>
</ol>
<p>&nbsp;</p>
<h2>AWS API Example &#8211; Import Amazon AWS Cost / Billing data in Power BI</h2>
<p>So far you have seen how to connect to S3 File. Now let&#8217;s look at another interesting example to call AWS API and display information in Power BI dashboard. For example purpose, we are going to call this <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_GetCostAndUsage.html" target="_blank" rel="noopener">AWS Billing and Cost Analysis API</a>. Perform following steps.</p>
<ol>
<li>Create new DSN using Zappysys JSON Driver</li>
<li>Configure ODBC DSN as below</li>
<li>Enter URL as we discussed in previous section. For example to call Billing API Service for East-1 Region we need to enter following way.<br />
<pre class="crayon-plain-tag">https://ce.us-east-1.amazonaws.com</pre>
</li>
<li>Select Connection Type as <strong>OAuth</strong> and click Configure Link.</li>
<li>Select Provider as <strong>AWS API v4</strong> and enter AWS Key and Secret. Click OK to save the connection.</li>
<li>Select Method as <strong>POST</strong></li>
<li>Enter HTTP Request Headers as below (Note each Billing Cost API action will have different Header value for X-Amz-Target so refer <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/Welcome.html" target="_blank" rel="noopener">API documentation</a>
<div id="attachment_4005" style="width: 818px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/call-aws-rest-api-example-json-driver-amazon-billing-cost-api-setup.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4005" class="size-full wp-image-4005" src="https://zappysys.com/blog/wp-content/uploads/2018/06/call-aws-rest-api-example-json-driver-amazon-billing-cost-api-setup.png" alt="Configure AWS API Connection for Cost / Billing API Data - Use ZappySys JSON Driver" width="808" height="702" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/call-aws-rest-api-example-json-driver-amazon-billing-cost-api-setup.png 808w, https://zappysys.com/blog/wp-content/uploads/2018/06/call-aws-rest-api-example-json-driver-amazon-billing-cost-api-setup-300x261.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/call-aws-rest-api-example-json-driver-amazon-billing-cost-api-setup-768x667.png 768w" sizes="(max-width: 808px) 100vw, 808px" /></a><p id="caption-attachment-4005" class="wp-caption-text">Configure AWS API Connection for Cost / Billing API Data &#8211; Use ZappySys JSON Driver</p></div></li>
<li>Enter Request Body (Modify your report parameters). As you see in below request we are requesting billing data for 3 services for Jan-1-2018 till Jun-15-2018. If you dont know service name then simply refer to your Bill and copy Service Name in Values array.<br />
<pre class="crayon-plain-tag">{
  "TimePeriod": {
    "Start":"2018-01-01",
    "End": "2018-06-15"
  },
  "Granularity": "MONTHLY",
  "Filter": {      
    "Dimensions": {
      "Key": "SERVICE",
      "Values": [
        "Amazon Simple Storage Service",
        "Amazon DynamoDB",
        "Amazon Redshift",
        "AWS Key Management Service"
      ]
    }
  },
  "GroupBy":[
    {
      "Type":"DIMENSION",
      "Key":"SERVICE"
    },
    {
      "Type":"TAG",
      "Key":"Environment"
    }
  ],
   "Metrics":["BlendedCost", "UnblendedCost", "UsageQuantity"]
}</pre>
&nbsp;</li>
<li>Select Filter as <strong>$.ResultsByTime[*].Groups[*]</strong></li>
<li>Click Test Connection button see it shows OK.</li>
<li>If the connection is OK then switch to Preview Tab to test query.</li>
<li>You can select Table name from the drop-down or type query as below<br />
<strong>Simple-Query to Extract AWS Billing / Cost Information</strong><br />
<pre class="crayon-plain-tag">SELECT  
 "p_ResultsByTime_TimePeriod_Start" as BillStartDate,
 "p_ResultsByTime_TimePeriod_End" as BillEndDate,
 json_array_first("Keys") as ServiceName,
 "Metrics_BlendedCost_Amount" as BillAmount,
 "Metrics_UsageQuantity_Amount" as Quantity
FROM [ResultsByTime_x_Groups] 
ORDER BY p_ResultsByTime_TimePeriod_Start</pre>
</li>
<li>You can also override attributes in your query using below syntax<br />
<strong>Custom-Query to Extract AWS Billing / Cost Information (WITH clause)</strong><br />
<pre class="crayon-plain-tag">SELECT 
 "p_ResultsByTime_TimePeriod_Start" as BillStartDate,
 "p_ResultsByTime_TimePeriod_End" as BillEndDate,
 json_array_first("Keys") as ServiceName,
 "Metrics_BlendedCost_Amount" as BillAmount,
 "Metrics_UsageQuantity_Amount" as Quantity
FROM $
ORDER BY p_ResultsByTime_TimePeriod_Start
WITH(
	 Src='https://ce.us-east-1.amazonaws.com'
	,DataConnectionType='OAuth'
	,ScopeSeparator='{space}'
	,ServiceProvider='AmazonAWS'
	--,ClientId='AKIAxxxxxxxxxxxxxxx'
	--,ClientSecret='lPi+XQxxxxxxxxxxxxxxxx'
	,UseCustomApp='True'
	,Filter='$.ResultsByTime[*].Groups[*]'
	,RequestData='{
  "TimePeriod": {
    "Start":"2018-01-01",
    "End": "2018-06-15"
  },
  "Granularity": "MONTHLY",
  "Filter": {      
    "Dimensions": {
      "Key": "SERVICE",
      "Values": [
        "Amazon Simple Storage Service",
        "Amazon DynamoDB",
        "Amazon Redshift",
        "AWS Key Management Service"
      ]
    }
  },
  "GroupBy":[
    {
      "Type":"DIMENSION",
      "Key":"SERVICE"
    },
    {
      "Type":"TAG",
      "Key":"Environment"
    }
  ],
   "Metrics":["BlendedCost", "UnblendedCost", "UsageQuantity"]
}'
	,Header='X-Amz-Target: AWSInsightsIndexService.GetCostAndUsage || Content-Type: application/x-amz-json-1.1'
	,RequestMethod='POST'
)</pre>
</li>
<li>Click Preview button to see the result.
<div id="attachment_4004" style="width: 773px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/get-amazon-billing-cost-using-rest-api-query-zappysys-json-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4004" class="size-full wp-image-4004" src="https://zappysys.com/blog/wp-content/uploads/2018/06/get-amazon-billing-cost-using-rest-api-query-zappysys-json-driver.png" alt="Query AWS Cost / Billing Data using API in Power BI (Use ZappySys JSON Driver)" width="763" height="884" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/get-amazon-billing-cost-using-rest-api-query-zappysys-json-driver.png 763w, https://zappysys.com/blog/wp-content/uploads/2018/06/get-amazon-billing-cost-using-rest-api-query-zappysys-json-driver-259x300.png 259w" sizes="(max-width: 763px) 100vw, 763px" /></a><p id="caption-attachment-4004" class="wp-caption-text">Query AWS Cost / Billing Data using API in Power BI (Use ZappySys JSON Driver)</p></div></li>
<li>Click OK to save Your DSN</li>
<li>Now you can Import Billing / Cost data in Power BI using same steps as previous section (Except use custom Query and DSN we just created for AWS API call)
<div id="attachment_4110" style="width: 940px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/import-aws-rest-api-billing-cost-data-power-bi.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4110" class="size-full wp-image-4110" src="https://zappysys.com/blog/wp-content/uploads/2018/06/import-aws-rest-api-billing-cost-data-power-bi.png" alt="Import AWS Billing / Cost Data in Power BI (Call AWS REST API)" width="930" height="499" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/import-aws-rest-api-billing-cost-data-power-bi.png 930w, https://zappysys.com/blog/wp-content/uploads/2018/06/import-aws-rest-api-billing-cost-data-power-bi-300x161.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/import-aws-rest-api-billing-cost-data-power-bi-768x412.png 768w" sizes="(max-width: 930px) 100vw, 930px" /></a><p id="caption-attachment-4110" class="wp-caption-text">Import AWS Billing / Cost Data in Power BI (Call AWS REST API)</p></div></li>
<li>Repeat steps to import more datasets using different queries</li>
</ol>
<p>&nbsp;</p>
<h2>AWS API Example &#8211; Import Data From AWS Lambda in Power BI</h2>
<p>Now let&#8217;s look at another scenario. Assume that someone from other team has written a Lambda Function which exposes certain data in JSON format which you want to display that in your Dashboard. Refer to this <a href="https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html" target="_blank" rel="noopener">Lambda API documentation</a> to learn more about API syntax.</p>
<p>Here is an example query to Call Lambda Function (submit input data in JSON and receive data in JSON format)</p><pre class="crayon-plain-tag">SELECT * FROM $
WITH(
	 Src='https://lambda.us-east-1.amazonaws.com/2015-03-31/functions/HelloWorld/invocations'
	,RequestMethod='POST'
	,RequestData='{"id":1}'
	,RequestContentTypeCode='ApplicationJson'
	
	/*** Uncomment to override DSN settings	  
	,DataConnectionType='OAuth'
	,ScopeSeparator='{space}'
	,ServiceProvider='AmazonAWS'
	--,ClientId='AKxxxxxxxxxxx'
	--,ClientSecret='lPi+Xxxxxxxxxxxxxxxxxxxxxxx'
	,UseCustomApp='True'
	***/
)</pre><p>
&nbsp;</p>
<h2>AWS API Example &#8211; Get EC2 VM information in Power BI</h2>
<p>Now let&#8217;s look at AWS EC2 Service API (Virtual Machine Service). This API is in XML format so you have to use ZappySys XML Driver.  Below query calls <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html" target="_blank" rel="noopener">this EC2 API</a> to get list of all instances.</p>
<p>&nbsp;</p><pre class="crayon-plain-tag">SELECT * FROM $
WITH(
	 ElementsToTreatAsArray='item'
	,Src='https://ec2.us-east-1.amazonaws.com/'
	,Filter='$.DescribeInstancesResponse.reservationSet.item[*].instancesSet.item[*]'
	,RequestData='Action=DescribeInstances&amp;Version=2016-11-15'
	,RequestMethod='POST'
	/*
	,DataConnectionType='OAuth'
	,ScopeSeparator='{space}'
	,ServiceProvider='AmazonAWS'
	,ClientId='AKIAxxxxxxxxxxxxxxxxxxx'
	,ClientSecret='lPi+XQvxxxxxxxxxxxxxxxxxxxxxxxxx'
	,UseCustomApp='True'
	*/
)</pre><p>
&nbsp;</p>
<div id="attachment_4111" style="width: 1010px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/query-aws-ec2-instances-power-bi-use-zappysys-rest-xml-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4111" class="size-full wp-image-4111" src="https://zappysys.com/blog/wp-content/uploads/2018/06/query-aws-ec2-instances-power-bi-use-zappysys-rest-xml-driver.png" alt="Get EC2 Instance List in Power BI (Use ZappySys XML Driver)" width="1000" height="658" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/query-aws-ec2-instances-power-bi-use-zappysys-rest-xml-driver.png 1000w, https://zappysys.com/blog/wp-content/uploads/2018/06/query-aws-ec2-instances-power-bi-use-zappysys-rest-xml-driver-300x197.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/query-aws-ec2-instances-power-bi-use-zappysys-rest-xml-driver-768x505.png 768w" sizes="(max-width: 1000px) 100vw, 1000px" /></a><p id="caption-attachment-4111" class="wp-caption-text">Get EC2 Instance List in Power BI (Use ZappySys XML Driver)</p></div>
<p>&nbsp;</p>
<h2>AWS API Example &#8211; Get AWS S3 Buckets and Files Count / Size in Power BI</h2>
<p>Now let&#8217;s look at how to Query S3 File System in Power BI. For example if you have to prepare dashboard to show Total Data Size and File count in a given Bucket then you can write following Query. For more information check <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/v2-RESTBucketGET.html" target="_blank" rel="noopener">Bucket List API Help</a></p>
<p><strong>Get File Size and Count for a given S3 Bucket</strong></p><pre class="crayon-plain-tag">SELECT count(*) as TotalFiles,sum(Size)/1024/1024 as TotalMB  FROM $
WITH(
	 ElementsToTreatAsArray='Contents'
	,Src='https://zs-dump1.s3.amazonaws.com/?list-type=2&amp;prefix=&amp;max-keys=1000'
	,Filter='$.ListBucketResult.Contents[*]'
	,NextUrlAttributeOrExpr='$.ListBucketResult.NextContinuationToken'
	,NextUrlSuffix='&amp;continuation-token=&lt;%nextlink_encoded%&gt;'
	
	/**** Uncomment below to use override DSN values
	,DataConnectionType='OAuth'
	,ScopeSeparator='{space}'
	,ServiceProvider='AmazonAWS'
	,ClientId='AKIAxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
	,ClientSecret='lPi+Xcxxxxxxxxxxxxxxxxxxxxxxxx'
	,UseCustomApp='True'	
	,RequestMethod='GET'
	***/
)</pre><p>
To list buckets you can use following query</p>
<p><strong>List S3 Buckets</strong></p><pre class="crayon-plain-tag">SELECT *  FROM $
WITH(	 
	 Src='https://s3.amazonaws.com'
	,Filter='$.ListAllMyBucketsResult.Buckets.Bucket[*]'
	,ElementsToTreatAsArray='Buckets'

	/**** Uncomment below to use override DSN values
	,DataConnectionType='OAuth'
	,ScopeSeparator='{space}'
	,ServiceProvider='AmazonAWS'
	,ClientId='AKIAxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
	,ClientSecret='lPi+Xcxxxxxxxxxxxxxxxxxxxxxxxx'
	,UseCustomApp='True'	
	,RequestMethod='GET'
	***/
)</pre><p>
&nbsp;</p>
<h2>Debugging / Crafting AWS API Call Request</h2>
<p>Check below article to learn various techniques to debug and craft AWS API Request Body / Headers and URL.</p>
<blockquote class="wp-embedded-content" data-secret="5AMMHunS6j"><p><a href="https://zappysys.com/blog/how-to-call-amazon-aws-api-using-ssis-ec2-lambda-api-gateway-sqs/">How to call Amazon AWS API using SSIS (EC2, Lambda, API Gateway, SQS)</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" src="https://zappysys.com/blog/how-to-call-amazon-aws-api-using-ssis-ec2-lambda-api-gateway-sqs/embed/#?secret=5AMMHunS6j" data-secret="5AMMHunS6j" width="600" height="338" title="&#8220;How to call Amazon AWS API using SSIS (EC2, Lambda, API Gateway, SQS)&#8221; &#8212; ZappySys Blog" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>&nbsp;</p>
<h2></h2>
<h2>Understanding AWS REST API Pagination in Power BI</h2>
<div class="content_block" id="custom_post_widget-3892"><div style="margin-bottom: 1em;">Even we set up ODBC Data Source to get the data, it may not be enough. Usually, if you are getting a huge data set from API provider, it won't give it to you in one HTTP response. Instead, it gives back only a subset of data and provides a mechanism for data pagination. The good news is that <em>ZappySys ODBC Driver</em> includes many options to cover virtually any pagination method.</div>
<div><span style="font-size: 16px;">Below you will find a few examples of API pagination. If you need something more sophisticated check the below link (the article was written for SSIS PowerPack but UI options and concepts apply to ODBC Driver too):</span></div>
<div style="margin-bottom: 1em;"><a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/" target="_blank" rel="noopener">https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/</a></div>
<h3>Paginate by Response Attribute</h3>
This example shows how to paginate API calls where you need to paginate until the last page detected. In this example, next page is indicated by some attribute called nextlink (found in response). If this attribute is missing or null then it stops fetching the next page.
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH(
SRC=@'https://zappysys.com/downloads/files/test/pagination_nextlink_inarray_1.json'
,NextUrlAttributeOrExpr = '$.nextlink'  --keep reading until this attribute is missing. If attribute name contains dot then use brackets like this $.['my.attr.name']
)</pre>
<h3>Paginate by URL Parameter (Loop until certain StatusCode)</h3>
This example shows how to paginate API calls where you need to pass page number via URL. The driver keeps incrementing page number and calls next URL until the last page detected (401 error). There are few ways to indicate the last page (e.g. By status code, By row count, By response size). If you don't specify end detection then it will use the default (i.e. No records found).
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH (
SRC=@'https://zappysys.com/downloads/files/test/page-xml.aspx?page=1&amp;mode=DetectBasedOnResponseStatusCode'
,PagingMode='ByUrlParameter'
,PagingByUrlAttributeName='page'
,PagingByUrlEndStrategy='DetectBasedOnResponseStatusCode'
,PagingByUrlCheckResponseStatusCode=401
,IncrementBy=1
)</pre>
<h3>Paginate by URL Path (Loop until no record)</h3>
This example shows how to paginate API calls where you need to pass page number via URL Path. The driver keeps incrementing page number and calls next URL until the last page is detected. There are few ways to indicate the last page (e.g. By status code, By row count, By response size). If you don't specify end detection then it will use the default (i.e. No records found).
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH (
SRC=@'https://zappysys.com/downloads/files/test/cust-&lt;%page%&gt;.xml'
,PagingMode='ByUrlPath'
,PagingByUrlAttributeName='&lt;%page%&gt;'
,PagingByUrlEndStrategy='DetectBasedOnRecordCount'
,IncrementBy=1
)</pre>
<h3>Paginate by Header Link (RFC 5988)</h3>
API like GitHub / Wordpress use Next link in Headers (<a href="https://tools.ietf.org/html/rfc5988" target="_blank" rel="noopener">RFC 5988</a>)
<pre class="lang:default decode:true ">SELECT * FROM $
LIMIT 25
WITH(
	 Src='https://wordpress.org/news/wp-json/wp/v2/categories?per_page=10'
	,PagingMode='ByResponseHeaderRfc5988'
	,WaitTimeMs='200' --//wait 200 ms after each request
)</pre>
&nbsp;</div>
<h2>Handling AWS Web API Error in Power BI</h2>
<div class="content_block" id="custom_post_widget-3894">Sometimes errors occur... they just do and there is nothing you can do! Or can you? Actually, in ODBC PowerPack you can handle them in two ways.
<h3>METHOD 1 - Using Error Handling Options</h3>
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-3949" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-error-handling-1.png" alt="" width="668" height="702" />
<h4>When to use?</h4>
You may want to use them when your source is a resource located on the Internet; e.g. a file on a website, a file on an FTP server or just a plain API HTTP response. By default, when a remote server returns an error, data retrieval is stopped, an error is raised and no data is given back to you. This might not be always desirable.
<h4>Scenario 1</h4>
Imagine a scenario, that there is a web server which each day at 12 AM releases a new JSON file with that day's date as filename, e.g. <span style="text-decoration: underline;"><em>http://www.some-server.com/data/2018-06-20.json</em></span>. And, of course, you want to download it and use it daily in your Power BI report. But you have a problem: Power BI report data sources are refreshed each hour and you may get <a href="https://en.wikipedia.org/wiki/HTTP_404" target="_blank" rel="noopener">HTTP 404 status code</a> (no file was found) when a file is not released yet. Which consequentially means other data sources won't be updated as well and you will see old and cached data on the report. That's where you could use <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue on any error</span></strong> or <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue when Url is invalid or missing (404 Errors)</span></strong> to avoid an error being raised and let other data sources to be updated.
<h4>Scenario 2</h4>
Another scenario is when you expect a web server to raise some kind of HTTP error when accessing a URL. You don't want ODBC Data Source to raise an error but instead, you want to get response data. That's where you can use <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue on any error</span></strong> or alike together with  <strong><span class="lang:default highlight:0 decode:true crayon-inline">Get response data on error</span></strong> to continue on an error and get the data:

<img loading="lazy" decoding="async" class="alignnone wp-image-3961 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error.png" alt="" width="547" height="235" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error.png 547w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error-300x129.png 300w" sizes="(max-width: 547px) 100vw, 547px" />
<h3>METHOD 2 - Using Connection [Retry Settings]</h3>
Another scenario you may run into is a buggy web server. You ask it to give you some file or data and it, like a snotty kid, just doesn't give it to you! You have to ask twice or thrice before it does its job. If that's the case, you have to retry HTTP requests using <em>Connection</em>:

<img loading="lazy" decoding="async" class="alignnone wp-image-3963 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-error-handling-3.png" alt="" width="671" height="572" /></div>
<h2>Other Considerations for Calling AWS API in Power BI</h2>
<div class="content_block" id="custom_post_widget-3901">There are few settings you can coder while calling Web API
<h3><strong>API Limit / Throttling</strong></h3>
While calling public API or other external web services one important aspect you have to check,  how many requests are allowed by your API. Especially when you use API pagination options to pull many records you have to slow down based on API limits. For example, your API may allow you only 5 requests per second. Use Throttling Tab on Driver UI to set delay after each request.
<h3><strong>2D Array Transformation</strong></h3>
If you are using JSON or XML API Driver then possible you may have to transform your data using 2D array transformation feature. <a href="https://zappysys.com/blog/parse-multi-dimensional-json-array-ssis/" target="_blank" rel="noopener">Check this link</a> for more information.

&nbsp;</div>
<h2>Conclusion</h2>
<p>In this article, we show how to connect to AWS API and S3 File data in Power BI. We configured ODBC DSN for AWS S3 / REST API connection and finally imported data in Power BI.  We used ZappySys driver for JSON that can be used to extract data from any REST API or a JSON file.  <a href="https://zappysys.com/products/odbc-powerpack/download/">Download ODBC PowerPack</a> to try yourself see how easy it is to consume XML / JSON / REST API and AWS data in Power BI and Say goodbye to ETL or Coding.  If you need any help with your API integration feel free to <a href="https://zappysys.com/support/">contact zappysys support</a> you will be amazed for sure how quickly your issue is resolved.</p>
<p>The post <a href="https://zappysys.com/blog/read-amazon-s3-data-power-bi-aws-json-xml-api/">Read Amazon S3 data in Power BI or Call AWS REST API (JSON / XML)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to call Amazon AWS API using SSIS (EC2, Lambda, API Gateway, SQS)</title>
		<link>https://zappysys.com/blog/how-to-call-amazon-aws-api-using-ssis-ec2-lambda-api-gateway-sqs/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 03 Nov 2017 15:25:28 +0000</pubDate>
				<category><![CDATA[AWS (Amazon Web Services)]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[S3 (Simple Storage Service)]]></category>
		<category><![CDATA[SSIS Connection Manager]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS OAuth Connection]]></category>
		<category><![CDATA[SSIS REST API Task]]></category>
		<category><![CDATA[SSIS XML Source (File / SOAP)]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[elasticsearch]]></category>
		<category><![CDATA[fiddler]]></category>
		<category><![CDATA[lambda]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[s3]]></category>
		<category><![CDATA[sqs]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=2241</guid>

					<description><![CDATA[<p>Introduction In this blog post you will learn how to call Amazon AWS API using SSIS (virtually any API) without a single line of code (No more JAVA, C#, Ruby, Python). Yes you heard it right 🙂 . If you are a SSIS / ETL Developer or even coder everyone loves drag &#38; drop interface. SSIS [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/how-to-call-amazon-aws-api-using-ssis-ec2-lambda-api-gateway-sqs/">How to call Amazon AWS API using SSIS (EC2, Lambda, API Gateway, SQS)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/amazon-web-services-logo.jpg"><img loading="lazy" decoding="async" class="wp-image-2317 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2017/11/amazon-web-services-logo.jpg" alt="" width="322" height="181" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/amazon-web-services-logo.jpg 800w, https://zappysys.com/blog/wp-content/uploads/2017/11/amazon-web-services-logo-300x169.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2017/11/amazon-web-services-logo-768x432.jpg 768w" sizes="(max-width: 322px) 100vw, 322px" /></a>In this blog post you will learn how to <strong>call Amazon AWS API using SSIS</strong> (virtually any API) without a single line of code (No more JAVA, C#, Ruby, Python). Yes you heard it right 🙂 . If you are a SSIS / ETL Developer or even coder everyone loves drag &amp; drop interface. SSIS has many advantages over other approaches such as Programming SDKs, Command Lines. Main advantage is ease of use, security and long term maintenance without learning expensive coding approach.</p>
<p>In this post we will use following components to show various possibilities to implement Amazon AWS API integration scenarios inside your ETL workflows.</p>
<div class="su-table su-table-alternate">
<div>
<table>
<colgroup>
<col width="100" />
<col /></colgroup>
<tbody>
<tr>
<td><img loading="lazy" decoding="async" src="//zappysys.com/images/ssis-powerpack/SSIS-Json-Source-Adapter.png" alt="Custom SSIS Components - Json Source" width="72" height="72" /></td>
<td><a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/">JSON / REST API Source</a> (REST API, JSON File or OData Service): Use this dataflow component when you have to <strong>fetch data from REST API webservice like a table</strong>. This component allows you to extract JSON data from webservice and de-normalize nested structure so you can save to Relational database such as SQL Server or any other target (Oracle, FlatFile, Excel, MySQL). This component also supports reading local JSON files or direct JSON string (Wildcard pattern supported too e.g. c:\data\file*.json).</td>
</tr>
<tr>
<td><img loading="lazy" decoding="async" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/web-api-destination/ssis-web-api-destination.png" alt="SSIS Custom Target Adapter - Web API Destination" width="72" height="72" /></td>
<td><a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/">Web API Destination</a> (POST data to API URL) : Use this dataflow component when you have to call API inside Dataflow (see <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>). Possible Use case: Call Lambda function with various parameters for each input record found in database.</td>
</tr>
<tr>
<td><img loading="lazy" decoding="async" src="//zappysys.com/images/ssis-powerpack/ssis-rest-api-web-service-task.png" alt="Custom SSIS Tasks - SSIS Rest Api Web Service Task" width="72" height="72" /></td>
<td><a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/">REST API Task</a> : Use this task when you don’t want to pull REST API data in tabular format but want to call rest API for POST data to server, DELETE data from server or things like download HTML page, extract Authentication tokens etc where you not necessarily dealing data in tabular format. This task also allows you many other options such as saving RAW response into variable or file.</td>
</tr>
<tr>
<td><img loading="lazy" decoding="async" src="//zappysys.com/images/ssis-powerpack/ssis-xml-source.png" alt="Custom SSIS Components - XML Source (Read File/SOAP/REST Web Service)" width="72" height="72" /></td>
<td><a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/">XML Source</a> (SOAP, File, REST) : Use this dataflow component when you have to fetch data from XML or SOAP webservice and consume data like a table. This component allows you to extract data from webservice and save to SQL Server or any other target (Oracle, FlatFile, Excel, MySQL). This component also supports reading local XML files or direct XML string.</td>
</tr>
</tbody>
</table>
</div>
</div>
<h2><span id="Prerequisites">Prerequisites</span></h2>
<p>Before we do hello world demo for calling Amazon AWS API, you will need to make sure following prerequisites are met.</p>
<ol>
<li>SSIS designer installed. Sometimes it is referred as BIDS or SSDT (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from Microsoft site</a>).</li>
<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
<li>Access to valid AWS credentials (Access Key, Secret Key for your IAM User). <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html" target="_blank" rel="noopener">Click here to learn more</a> about IAM users and Access Key/Secret Key</li>
<li>Make sure <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener"><em>SSIS PowerPack</em></a> is installed. <a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">Click here to download</a>.</li>
</ol>
<h2>Step-By-Step Example-1 (Call AWS API)</h2>
<p>Now lets call some simple GET API call using SSIS <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">REST API Task</a>.</p>
<ol>
<li>Install  <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener"><em>SSIS PowerPack</em></a> (Skip this step if you already installed SSIS PowerPack.</li>
<li>Open Visual Studio and create new Integration Services Project</li>
<li>Open SSIS Package and check your SSIS Toolbox you will see many tasks/components starting with ZS</li>
<li>From Control flow SSIS Toolbox Drag &amp; drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">ZS REST API Task</a>.</li>
<li>Double click the REST API task to configure it.</li>
<li>On REST API Task change URL Access mode drop down to <strong>URL from Connection</strong></li>
<li>Now in the connection dropdown click New <strong>ZS-OAUTH</strong> connection and configure connection as below
<ol>
<li>Once you see OAuth connection dialog box change Provider Type from Custom to <strong>Amazon AWS API</strong> (v4)</li>
<li>In the ClientId enter your AWS <strong>Access Key</strong></li>
<li>In the ClientSecret enter your AWS <strong>Secret Key</strong></li>
<li>Click OK to save connection
<div id="attachment_2258" style="width: 720px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-oauth-connection-amazon-aws-api-provider-use-signature-v4.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2258" class="size-full wp-image-2258" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-oauth-connection-amazon-aws-api-provider-use-signature-v4.png" alt="Configure SSIS OAuth Connection - Use Amazon AWS API Provider, Enter Access Key, Secret Key" width="710" height="535" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-oauth-connection-amazon-aws-api-provider-use-signature-v4.png 710w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-oauth-connection-amazon-aws-api-provider-use-signature-v4-300x226.png 300w" sizes="(max-width: 710px) 100vw, 710px" /></a><p id="caption-attachment-2258" class="wp-caption-text">Configure SSIS OAuth Connection &#8211; Use Amazon AWS API Provider, Enter Access Key, Secret Key</p></div></li>
</ol>
</li>
<li>On REST API Task change few more settings as below
<ol>
<li>Enter API URL you like to call (In our case we will use <a href="http://docs.aws.amazon.com/AmazonS3/latest/API/RESTServiceGET.html" target="_blank" rel="noopener">S3 API (Simple Storage Service)</a>. We assume you have ListBucket permission to make this call. If you dont have such permission try to get Full path of File (choose small file) . You have to tweak API url to adjust Service Type, Region,Bucket, Path<br />
<pre class="crayon-plain-tag">https://s3.us-east-1.amazonaws.com
-- OR -- Use below (list files) if you have single bucket permission---
https://s3.us-east-1.amazonaws.com/YOUR-BUCKET</pre>
</li>
<li>Click Test Request. If you have valid Permission and setup looks ok then you will see Response window like below. Using this technique you can call any API to execute AWS operations (E.g. start EC2 VM, Create SQS Queue, Call Lambda Function, Drop or Update resource)
<div id="attachment_2260" style="width: 722px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-api-without-sdk-s3-ec2-sqs-lambda-api-gateway.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2260" class="size-full wp-image-2260" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-api-without-sdk-s3-ec2-sqs-lambda-api-gateway.png" alt="Calling Amazon AWS API Using SSIS REST API Task Example. (Call any AWS API without SDK. such as EC2 API, SQS API, Lambda API, Redshift API, DynamoDB API)" width="712" height="615" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-api-without-sdk-s3-ec2-sqs-lambda-api-gateway.png 712w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-api-without-sdk-s3-ec2-sqs-lambda-api-gateway-300x259.png 300w" sizes="(max-width: 712px) 100vw, 712px" /></a><p id="caption-attachment-2260" class="wp-caption-text">Calling Amazon AWS API Using SSIS REST API Task Example. (Call any AWS API without SDK. such as EC2 API, SQS API, Lambda API, Redshift API, DynamoDB API)</p></div></li>
</ol>
</li>
</ol>
<h2>Step-By-Step Example-2 (Loading data from AWS API to SQL Server)</h2>
<p>Now lets do more interesting scenario. We will call AWS S3 API to get S3 File list from Bucket. After extract we will save that list to SQL Server Table. Since Amazon S3 API is XML based API we will use ZappySys <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener">SSIS XML Source</a>. For JSON based API use JSON Source instead. XML Source / JSON Source both can parse API response into Rows and Columns so you can easily store it into SQL Server. Now lets see how to do this.</p>
<ol>
<li>From Control flow SSIS Toolbox Drag &amp; drop Data Flow Task</li>
<li>Double click Data Flow Task. From SSIS Toolbox Drag &amp; drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener">ZS SSIS XML Source</a>.</li>
<li>Double click the XML Source to configure it.</li>
<li>In the URL text box enter API URL like below to list S3 Files for specified bucket (Change YOUR-BUCKET to your own name)<br />
<pre class="crayon-plain-tag">https://s3.us-east-1.amazonaws.com/YOUR-BUCKET</pre>
</li>
<li>Now check Use Credentials and Select same Amazon API connection we created in previous example.</li>
<li>Click on Select Filter (This step allows us to flatten the XML hierarchy. Select the node which is Array icon like below. If prompted to treat selected node as array click Yes.
<div id="attachment_2319" style="width: 958px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-read-data-amazon-aws-api-get-s3-bucket-file-list-xml-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2319" class="size-full wp-image-2319" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-read-data-amazon-aws-api-get-s3-bucket-file-list-xml-source.png" alt="Configure SSIS XML Source - Get Amazon S3 File List from specific bucket (AWS API)" width="948" height="728" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-read-data-amazon-aws-api-get-s3-bucket-file-list-xml-source.png 948w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-read-data-amazon-aws-api-get-s3-bucket-file-list-xml-source-300x230.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-read-data-amazon-aws-api-get-s3-bucket-file-list-xml-source-768x590.png 768w" sizes="(max-width: 948px) 100vw, 948px" /></a><p id="caption-attachment-2319" class="wp-caption-text">Configure SSIS XML Source &#8211; Get Amazon S3 File List from specific bucket (AWS API)</p></div></li>
<li>Click Preview to see your data. Click OK to save.
<div id="attachment_2320" style="width: 705px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-preview-data-amazon-aws-api-get-s3-bucket-file-list-xml-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2320" class="size-full wp-image-2320" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-preview-data-amazon-aws-api-get-s3-bucket-file-list-xml-source.png" alt="Preview Data in XML Source - Amazon S3 File List (Calling AWS API)" width="695" height="372" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-preview-data-amazon-aws-api-get-s3-bucket-file-list-xml-source.png 695w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-preview-data-amazon-aws-api-get-s3-bucket-file-list-xml-source-300x161.png 300w" sizes="(max-width: 695px) 100vw, 695px" /></a><p id="caption-attachment-2320" class="wp-caption-text">Preview Data in XML Source &#8211; Amazon S3 File List (Calling AWS API)</p></div></li>
<li>Now attach your XML source to target like OLEDB Destination to load data to SQL Server or other Target (e.g. Oracle, MySQL)</li>
<li>Execute SSIS Package to load data from Amazon AWS API to SQL Server.
<div id="attachment_2321" style="width: 917px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-example-read-amazon-to-sql-server-call-aws-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2321" class="size-full wp-image-2321" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-example-read-amazon-to-sql-server-call-aws-api.png" alt="SSIS Package - Read Amazon S3 File List and load into SQL Server Table (Call AWS API Example)" width="907" height="597" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-example-read-amazon-to-sql-server-call-aws-api.png 907w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-example-read-amazon-to-sql-server-call-aws-api-300x197.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-example-read-amazon-to-sql-server-call-aws-api-768x506.png 768w" sizes="(max-width: 907px) 100vw, 907px" /></a><p id="caption-attachment-2321" class="wp-caption-text">SSIS Package &#8211; Read Amazon S3 File List and load into SQL Server Table (Call AWS API Example)</p></div></li>
</ol>
<h2></h2>
<h2><span id="Using_SSIS_JSON_Source_to_read_from_REST_API_and_load_into_SQL_Server">File Upload Example &#8211; Low level API &#8211; Call PUT request</span></h2>
<p>There will be a time when you want to take total control of your AWS API calls. One example is if you wish to Upload / Write data to S3 then components like ZappySys Amazon S3 CSV Destination or Amazon Storage Task might need additional permission such as <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html" target="_blank" rel="noopener">HeadObject</a> . If you have only write permission on bucket then this will fail to execute Task. In such case you can use REST API Task like below way.</p>
<p>Basically we exported data from Relation Database to CSV File using <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener">Export CSV File Task</a> and then we uploaded file content using REST API Task.</p>
<h3>Upload Text File to S3 (i.e. JSON, CSV, XML &#8230;)</h3>
<p>Your URL Format can be like this. Region codes can be <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints" target="_blank" rel="noopener">found here</a></p><pre class="crayon-plain-tag">https://YOUR-BUCKET.s3.YOUR-REGION.amazonaws.com/YOUR-FILE
https://YOUR-BUCKET.s3.YOUR-REGION.amazonaws.com/SOME-FOLDER/SOME-SUB-FOLDER/YOUR-FILE</pre><p>
&nbsp;</p>
<div id="attachment_8925" style="width: 902px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-upload-file-to-s3-bucket-low-level-rest-api-put-request.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8925" class="size-full wp-image-8925" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-upload-file-to-s3-bucket-low-level-rest-api-put-request.png" alt="Upload file to Amazon S3 - Call low level API (PUT request)" width="892" height="752" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-upload-file-to-s3-bucket-low-level-rest-api-put-request.png 892w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-upload-file-to-s3-bucket-low-level-rest-api-put-request-300x253.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-upload-file-to-s3-bucket-low-level-rest-api-put-request-768x647.png 768w" sizes="(max-width: 892px) 100vw, 892px" /></a><p id="caption-attachment-8925" class="wp-caption-text">Upload file to Amazon S3 &#8211; Call low level API (PUT request)</p></div>
<p>&nbsp;</p>
<h3>Upload Binary File to S3 (i.e. Zip, mp3, gzip, png, jpeg&#8230;)</h3>
<p>Above method only works for Text Files. If you have Binary files (e.g. Zip file, mp3, png, jpeg) then you can use below workaround.</p>
<ol>
<li>Check Is Multi Part / File Upload Option next to the Body editor (<a href="https://zappysys.com/blog/rest-api-file-upload-using-ssis-multi-part-post/" target="_blank" rel="noopener">Read this Post for more info</a>)</li>
<li>In the Body enter file path like below<br />
<pre class="crayon-plain-tag">@c:\folder\some-file.xyz</pre>
</li>
<li>That&#8217;s it, now your binary file can be uploaded to S3 same way as Text file we uploaded in earlier section.</li>
</ol>
<p>&nbsp;</p>
<p><strong>NOTE:</strong> <span style="text-decoration: underline;">Binary file option only works in the latest Build Uploaded after 5/21/2020</span></p>
<p>&nbsp;</p>
<h2><span id="Using_SSIS_JSON_Source_to_read_from_REST_API_and_load_into_SQL_Server">Debugging AWS API Command Line Requests using Fiddler (Web Proxy)</span></h2>
<p>Before we see more examples of calling AWS API lets first learn how to capture Request data using <a href="https://aws.amazon.com/cli/" target="_blank" rel="noopener">aws command line</a> (CLI). We will use <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">Fiddler</a> to capture AWS API Requests.</p>
<ol>
<li>Download and <a href="https://www.telerik.com/download/fiddler" target="_blank" rel="noopener">Install Fiddler</a> (Free Tool)</li>
<li>Install  <a href="https://aws.amazon.com/cli/" target="_blank" rel="noopener">aws command line</a></li>
<li>Open command prompt and type aws configure command to set credentials.  For more info see <a href="http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html" target="_blank" rel="noopener">configure aws credentials</a> .. see below example.<br />
<pre class="crayon-plain-tag">c:&gt; aws configure
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default region name [None]: us-west-2
Default output format [None]: json</pre>
</li>
<li>Once you set credentials launch Fiddler</li>
<li>On the Fiddler Tools menu &gt; Click Fiddler Option &gt; HTTPS &gt; Check <strong>Decrypt HTTPS Traffic</strong></li>
<li>Once you do that you may be asked to Trust Fiddler Certificate click OK</li>
<li>Close and Open Fiddler to apply setting</li>
<li>Now any command you type in aws command line will show up in fiddler. This command we can use in SSIS REST API Task or XML Source to call virtually Any API AWS supports.</li>
<li>For example to call some lambda function (supply input json data from file) use below command and watch Fiddler Trace. Notice we added <strong>&#8211;no-verify-ssl</strong> option so we can see requests in custom web proxy like fiddler (This option will trust Fiddler certificate).<br />
<pre class="crayon-plain-tag">c:\&gt;aws lambda invoke --function-name HelloWorld c:\temp\outputfile.txt --no-verify-ssl --payload file://c://test/customer.json</pre>
&nbsp;</p>
<div id="attachment_2314" style="width: 1175px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-get-raw-rest-request-aws-commandline-cli-capture-fiddler.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2314" class="size-full wp-image-2314" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-get-raw-rest-request-aws-commandline-cli-capture-fiddler.png" alt="Capture AWS Commandline (CLI) request using Fiddler" width="1165" height="640" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-get-raw-rest-request-aws-commandline-cli-capture-fiddler.png 1165w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-get-raw-rest-request-aws-commandline-cli-capture-fiddler-300x165.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-get-raw-rest-request-aws-commandline-cli-capture-fiddler-768x422.png 768w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-get-raw-rest-request-aws-commandline-cli-capture-fiddler-1024x563.png 1024w" sizes="(max-width: 1165px) 100vw, 1165px" /></a><p id="caption-attachment-2314" class="wp-caption-text">Capture AWS Commandline (CLI) request using Fiddler</p></div></li>
<li>Once you have this information you can use it inside ZappySys Components which supports API calls (e.g. REST API Task, JSON Source, XML Source). For this example we will use REST API Task to call same Lambda Function. Things to change to call any API is URL, Method, ContentType, Body. If its GET call then you wont have Body.
<div id="attachment_2315" style="width: 826px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-lambda-function-using-rest-api-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2315" class="size-full wp-image-2315" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-lambda-function-using-rest-api-task.png" alt="Calling Amazon AWS Lambda Function using SSIS REST API Task" width="816" height="659" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-lambda-function-using-rest-api-task.png 816w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-lambda-function-using-rest-api-task-300x242.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-lambda-function-using-rest-api-task-768x620.png 768w" sizes="(max-width: 816px) 100vw, 816px" /></a><p id="caption-attachment-2315" class="wp-caption-text">Calling Amazon AWS Lambda Function using SSIS REST API Task</p></div>
<p>&nbsp;</li>
<li>That&#8217;s it.. You can now take this same concept and call virtually API AWS API right insight SSIS without any SDK or command line tools.</li>
</ol>
<h2>Call API Gateway Endpoint (Default URL)</h2>
<p>If you wish to call API hosted on Amazon API Gateway Service then enter direct URL. You have to use OAuth Connection (AWS v4 Provider) as previous section.</p>
<p>Typical URL may look like as below if you calling API gateway Endpoint.</p><pre class="crayon-plain-tag">https://c5hhigf5mh.execute-api.us-east-1.amazonaws.com/prod/pets</pre><p>
<h2>Call AWS API with Region and Custom Service Name</h2>
<p>There will be a time when you will have to call AWS API URL and it doesnt indicate Region / Service but you have to supply part of signature for Authentication.  In this case just enter AWS Service and Region along with ClientID, Secret Fields (Custom Service and  Region attributes were introduced in v3.0 or higher so if you are not seeing on OAuth Connection UI then you probably running older version).</p>
<p>&nbsp;</p>
<h2>Call Amazon Athena API</h2>
<p>Check <a href="https://zappysys.com/blog/import-export-data-amazon-athena-using-ssis/" target="_blank" rel="noopener">this article</a> for detailed instructions</p>
<h2><span id="Using_SSIS_JSON_Source_to_read_from_REST_API_and_load_into_SQL_Server">Call AWS EC2 API</span></h2>
<p>Here is an example of calling EC2 API. This is example of listing EC2 instances.</p>
<p>Request:</p><pre class="crayon-plain-tag">POST https://ec2.us-east-1.amazonaws.com/
Content-Type: application/x-www-form-urlencoded; charset=utf-8

Action=DescribeInstances&amp;Version=2016-11-15</pre><p>
<h2>Call <span id="Using_SSIS_JSON_Source_to_read_from_REST_API_and_load_into_SQL_Server">AWS </span>Lambda API</h2>
<p>Here is some example of calling Lambda function</p>
<p>Request:</p><pre class="crayon-plain-tag">POST https://lambda.YOUR-REGION.amazonaws.com/2015-03-31/functions/YOUR-FUNCTION/invocations

{you-json-input-goes-in-body}</pre><p>
<h2></h2>
<h2>Call AWS ElasticSearch</h2>
<p>If you are using <a href="https://aws.amazon.com/elasticsearch-service/" target="_blank" rel="noopener">AWS Hosted Managed ElasticSearch</a> then also you can use OAuth AWS v4 Provider as below. Assuming you have <a href="https://stackoverflow.com/questions/33751580/how-to-access-kibana-from-amazon-elasticsearch-service" target="_blank" rel="noopener">configured correct Policy</a> to allow your IAM User Account / IP address.</p>
<div id="attachment_6277" style="width: 836px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-aws-elasticsearch-rest-api-sign-v4.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6277" class="size-full wp-image-6277" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-aws-elasticsearch-rest-api-sign-v4.png" alt="Call AWS Hosted ElasticSearch REST API in SSIS (V4 Request Signing)" width="826" height="730" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-aws-elasticsearch-rest-api-sign-v4.png 826w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-aws-elasticsearch-rest-api-sign-v4-300x265.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-aws-elasticsearch-rest-api-sign-v4-768x679.png 768w" sizes="(max-width: 826px) 100vw, 826px" /></a><p id="caption-attachment-6277" class="wp-caption-text">Call AWS Hosted ElasticSearch REST API in SSIS (V4 Request Signing)</p></div>
<h2>Call <span id="Using_SSIS_JSON_Source_to_read_from_REST_API_and_load_into_SQL_Server">AWS </span>API using Native Task/Components</h2>
<p>ZappySys provides many High quality Tasks / Components for AWS integration. See below list.</p>
<table id="cat_amazon_aws_cloud" style="margin: 0px 0px 1.5em !important; padding: 0px; outline: 0px; border: 1px solid #cccccc !important; border-image: none !important !important; width: 973px; color: #333333; text-transform: none; line-height: 2; text-indent: 0px; letter-spacing: normal; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; font-style: normal; font-weight: normal; word-spacing: 0px; vertical-align: baseline; white-space: normal; border-collapse: collapse !important; border-spacing: 0px; orphans: 2; widows: 2; background-color: #ffffff; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">
<tbody>
<tr class="su-even">
<th colspan="3"><strong>Amazon AWS Cloud Integration</strong></th>
</tr>
<tr>
<td><img loading="lazy" decoding="async" src="https://i1.wp.com/zappysys.com/images/ssis-powerpack/SSIS-Amazon-S3-Cloud-Task.png?w=720&amp;ssl=1" alt="Custom SSIS Tasks - Amazon S3 Task" width="24" height="24" /> <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-task/" target="_blank" rel="noopener">Amazon S3 Task</a></td>
<td><img loading="lazy" decoding="async" src="https://i0.wp.com/zappysys.com/images/ssis-powerpack/SSIS-Amazon-Redshift-Data-Transfer-Task.png?w=720&amp;ssl=1" alt="Custom SSIS Tasks - Amazon Redshift Data Transfer Task" width="24" height="24" /> <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-redshift-data-transfer-task/" target="_blank" rel="noopener">Amazon Redshift Data Transfer Task</a></td>
<td><img loading="lazy" decoding="async" src="https://i1.wp.com/zappysys.com/images/ssis-powerpack/SSIS-Amazon-Redshift-ExecuteSQL-Task.png?w=720&amp;ssl=1" alt="Custom SSIS Tasks - Amazon Redshift ExecuteSql Task" width="24" height="24" /> <a href="https://zappysys.com/products/ssis-powerpack/ssis-redshift-execute-sql-task/" target="_blank" rel="noopener">Amazon Redshift ExecuteSql Task</a></td>
</tr>
<tr class="su-even">
<td><img loading="lazy" decoding="async" src="https://i0.wp.com/zappysys.com/images/ssis-powerpack/ssis-amazon-redshift-cluster-management-task.png?w=720&amp;ssl=1" alt="Custom SSIS Tasks - Amazon Redshift Cluster Management Task" width="24" height="24" /> <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-redshift-cluster-management-task/" target="_blank" rel="noopener">Amazon Redshift Cluster Management Task</a></td>
<td><img loading="lazy" decoding="async" src="https://i1.wp.com/zappysys.com/images/ssis-powerpack/SSIS-Amazon-DynamoDB-Source-Adapter.png?w=720&amp;ssl=1" alt="Custom SSIS Components - Amazon DynamoDB Source" width="24" height="24" /> <a href="https://zappysys.com/products/ssis-powerpack/ssis-dynamodb-source/" target="_blank" rel="noopener">Amazon DynamoDB Source</a></td>
<td><img loading="lazy" decoding="async" src="https://i1.wp.com/zappysys.com/images/ssis-powerpack/SSIS-Amazon-DynamoDB-Destination-Adapter.png?w=720&amp;ssl=1" alt="Custom SSIS Components - Amazon DynamoDB Destination" width="24" height="24" /> <a href="https://zappysys.com/products/ssis-powerpack/ssis-dynamodb-destination/" target="_blank" rel="noopener">Amazon DynamoDB Destination</a></td>
</tr>
<tr>
<td><img loading="lazy" decoding="async" src="https://i0.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/amazon-redshift-source/ssis-amazon-redshift-source.png?w=720&amp;ssl=1" alt="Custom SSIS Components - Amazon Redshift Source" width="24" height="24" /> <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-redshift-source-connector/" target="_blank" rel="noopener">Amazon Redshift Source</a></td>
<td><img loading="lazy" decoding="async" src="https://i1.wp.com/zappysys.com/images/ssis-powerpack/SSIS-Amazon-DynamoDB-Source-Adapter.png?w=720&amp;ssl=1" alt="Custom SSIS Components - Amazon DynamoDB Source" width="24" height="24" /> Amazon SQS Queue Source</td>
<td> <img loading="lazy" decoding="async" src="https://i1.wp.com/zappysys.com/images/ssis-powerpack/SSIS-Amazon-DynamoDB-Source-Adapter.png?w=720&amp;ssl=1" alt="Custom SSIS Components - Amazon DynamoDB Source" width="24" height="24" /> Amazon SQS Queue Destination</td>
</tr>
</tbody>
</table>
<h2>Conclusion</h2>
<p>Amazon AWS Cloud integration from SSIS packages becoming more and more common scenario. ZappySys provides easy to use no coding connectors to achieve many time consuming scenarios. Having clean drag and drop approach is not only faster but more secure using inbuilt SSIS framework. <a href="https://zappysys.com/products/ssis-powerpack/">Try SSIS PowerPack</a> to explore many other scenarios not discussed in this article.</p>
<p>The post <a href="https://zappysys.com/blog/how-to-call-amazon-aws-api-using-ssis-ec2-lambda-api-gateway-sqs/">How to call Amazon AWS API using SSIS (EC2, Lambda, API Gateway, SQS)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
