<?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>Reporting - Microsoft Power BI Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/category/odbc-powerpack/odbc-app-integration/bi-reporting-power-bi/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/category/odbc-powerpack/odbc-app-integration/bi-reporting-power-bi/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Thu, 16 Apr 2026 20:35:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.4</generator>

<image>
	<url>https://zappysys.com/blog/wp-content/uploads/2023/01/cropped-zappysys-symbol-large-32x32.png</url>
	<title>Reporting - Microsoft Power BI Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/category/odbc-powerpack/odbc-app-integration/bi-reporting-power-bi/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Enable Power BI DirectQuery for ODBC: Solving the Live Data Problem</title>
		<link>https://zappysys.com/blog/enable-power-bi-directquery-for-odbc-solving-the-live-data-problem/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Thu, 16 Apr 2026 16:04:40 +0000</pubDate>
				<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[Reporting - Microsoft Power BI]]></category>
		<category><![CDATA[directquery]]></category>
		<category><![CDATA[powerbi]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=12006</guid>

					<description><![CDATA[<p>Introduction Power BI native ODBC connectors do not support DirectQuery. This significant platform limitation forces users into Import mode, preventing real-time data access and causing refresh delays for critical business dashboards. If you have been searching for a &#8220;Power BI ODBC DirectQuery workaround&#8221; or a way to &#8220;enable DirectQuery for custom ODBC drivers,&#8221; this guide [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/enable-power-bi-directquery-for-odbc-solving-the-live-data-problem/">Enable Power BI DirectQuery for ODBC: Solving the Live Data Problem</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><strong><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-logo-310x310.png"><img decoding="async" class="alignleft wp-image-3951 " src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-logo-310x310.png" alt="" width="115" height="115" 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: 115px) 100vw, 115px" /></a>Power BI native ODBC connectors do not support DirectQuery.</strong> This significant platform limitation forces users into Import mode, preventing real-time data access and causing refresh delays for critical business dashboards. If you have been searching for a <em>&#8220;Power BI ODBC DirectQuery workaround&#8221;</em> or a way to <em>&#8220;enable DirectQuery for custom ODBC drivers,&#8221;</em> this guide provides the exact steps to bridge that gap.</p>
<div style="width: 715px" class="wp-caption alignnone"><img fetchpriority="high" decoding="async" title="Power BI ODBC data source with Import mode only and no DirectQuery option" src="/blog/wp-content/uploads/2026/04/power-bi-odbc-directquery-import-only.png" alt="Power BI ODBC data source with Import mode only and no DirectQuery option" width="705" height="278" /><p class="wp-caption-text">The Industry Challenge: Standard Power BI ODBC settings lack the DirectQuery option.</p></div>
<h2>The Problem: Why &#8220;Import Mode&#8221; Fails Modern Data Teams</h2>
<p>While the native Microsoft connector is useful for simple tasks, its lack of DirectQuery support creates several enterprise-level issues:</p>
<ul>
<li><strong>Stale Data:</strong> There is no true real-time reporting, as data is only as fresh as your last refresh.</li>
<li><strong>Memory Constraints:</strong> Large datasets quickly bloat the Power BI model and increase memory usage.</li>
<li><strong>Refresh Overhead:</strong> Frequent changes in underlying data require complex and constant refresh schedules.</li>
<li><strong>API Lag:</strong> Data from cloud apps like Jira, SharePoint, or OneDrive becomes outdated between scheduled updates.</li>
</ul>
<h2>The Solution: ZappySys DirectQuery ODBC Connector</h2>
<p>To fix this widespread industry problem, you can use the <strong>ZappySys DirectQuery ODBC Connector</strong> (a specialized custom Power BI connector). This tool allows you to treat any ODBC source as a live connection, unlocking real-time analytics for databases, APIs, and cloud apps.</p>
<h3>Advanced Capabilities:</h3>
<ul>
<li>Enable <strong>DirectQuery</strong> mode for virtually any 64-bit ODBC source.</li>
<li>Query live data directly without importing massive datasets into Power BI.</li>
<li>Seamlessly integrate with the <a href="https://zappysys.com/products/odbc-powerpack/">ZappySys ODBC PowerPack</a> for API and JSON connectivity.</li>
</ul>
<hr />
<h2>Step 1: Install the ZappySys Connector</h2>
<ol>
<li>First, download and install the <a href="https://zappysys.com/products/odbc-powerpack/download">ZappySys ODBC PowerPack</a>.<br />
This is essential for those using ZappySys drivers (e.g. REST API, JSON, JDBC Bridge (e.g. Trino, Infor, Athena) and more).</li>
<li><strong>Download the Power BI Connector file:</strong> <a href="https://zappysys.com/downloads/ZappySys-DirectQuery-ODBC-Connector.zip">ZappySys-DirectQuery-ODBC-Connector.zip</a></li>
<li>Copy the extracted <code>.mez</code> file to &lt;your-profile&gt;\Documents\Power BI Desktop\Custom Connectors: (See next section to find exact path)<br />
<pre class="crayon-plain-tag">Examples:

C:\Users\&amp;lt;YourUsername&amp;gt;\Documents\Power BI Desktop\Custom Connectors
C:\Users\&amp;lt;YourUsername&amp;gt;\OneDrive - &amp;lt;your-company&amp;gt;\Documents\Power BI Desktop\Custom Connectors</pre>
<strong><br />
Note:</strong> If the <code>Custom Connectors</code> folder does not exist, you must create it manually.For finding exact connector folder path see <a href="https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-connector-extensibility">Microsoft Connector Extensibility documentation</a>.</li>
</ol>
<p><strong>How to find the Custom Connector folder Path for Power BI</strong></p>
<ol>
<li>Type PowerShell on command line.</li>
<li>Run the lines below to print the base path and the full path. You can run one after another or paste both lines.<br />
<pre class="crayon-plain-tag">[Environment]::GetFolderPath('MyDocuments')
Join-Path ([Environment]::GetFolderPath('MyDocuments')) 'Microsoft Power BI Desktop\Custom Connectors'</pre>
</li>
</ol>
<h2>Step 2: Update Power BI Security for Custom Connectors</h2>
<ol>
<li>Open Power BI Desktop.</li>
<li>Navigate to <strong>File &gt; Options and settings &gt; Options &gt; Security</strong>.</li>
<li>Under <strong>Data Extensions</strong>, enable the option <strong>&#8220;Allow any extension to load without validation&#8221;</strong>.</li>
<li>Save your changes and restart Power BI Desktop to apply the new security policy.</li>
</ol>
<div style="width: 864px" class="wp-caption alignnone"><img loading="lazy" decoding="async" title="Power BI options security settings to enable custom connectors" src="/blog/wp-content/uploads/2026/04/power-bi-enable-custom-connectors-security.png" alt="Power BI options security settings to enable custom connectors" width="854" height="398" /><p class="wp-caption-text">Power BI options security settings to enable custom connectors</p></div>
<h2>Step 3: Set Up a 64-bit ODBC DSN</h2>
<ol>
<li>Open the <strong>ODBC Data Sources (64-bit)</strong> administrator.</li>
<li>Click the <strong>System DSN</strong> tab and select <strong>Add</strong>.</li>
<li>Choose your driver (for example, the ZappySys ODBC Driver for API/Jira/SharePoint).</li>
<li>Save the DSN with a clear name, such as <code>MyZappyDSN</code>.</li>
</ol>
<p><strong>Important Architecture Note:</strong> Power BI Desktop and the Gateway require a 64-bit DSN; 32-bit DSNs are not supported for this workflow.</p>
<div style="width: 589px" class="wp-caption alignnone"><img loading="lazy" decoding="async" title="Windows 64-bit ODBC Data Source Administrator with System DSN configured" src="/blog/wp-content/uploads/2026/04/windows-odbc-64bit-system-dsn-setup.png" alt="Windows 64-bit ODBC Data Source Administrator with System DSN configured" width="579" height="24" /><p class="wp-caption-text">Windows 64-bit ODBC DSN Configuration.</p></div>
<h2>Step 4: Connecting for Live Data / DirectQuery Support</h2>
<ol>
<li>In Power BI Desktop, go to <strong>Get Data &gt; More..</strong>.</li>
<li>Search for &#8220;zappysys&#8221; in the list.</li>
<li>Select <strong>ZappySys ODBC Connector (For DirectQuery Support)</strong>.</li>
<li>Provide your DSN name (<code>MyZappyDSN</code>) or a full connection string.</li>
<li>Select <strong>DirectQuery</strong> mode and click connect.
<div id="attachment_12015" style="width: 472px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2026/04/powerbi-custom-odbc-connector-with-directquery-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-12015" class="size-full wp-image-12015" src="https://zappysys.com/blog/wp-content/uploads/2026/04/powerbi-custom-odbc-connector-with-directquery-1.png" alt="ZappySys ODBC Connector - To enable DirectQuery option for ODBC Datasource (Custom Install required)" width="462" height="293" srcset="https://zappysys.com/blog/wp-content/uploads/2026/04/powerbi-custom-odbc-connector-with-directquery-1.png 462w, https://zappysys.com/blog/wp-content/uploads/2026/04/powerbi-custom-odbc-connector-with-directquery-1-300x190.png 300w" sizes="(max-width: 462px) 100vw, 462px" /></a><p id="caption-attachment-12015" class="wp-caption-text">ZappySys ODBC Connector &#8211; To enable DirectQuery option for ODBC Datasource (Custom Install required)</p></div></li>
</ol>
<p><strong>Note for PowerPack Users:</strong> You can use a full connection string (e.g., <code>Driver={ZappySys ODBC Driver};Host=...;</code>) by using the &#8220;Copy Settings&#8221; feature within the ZappySys Driver UI. Read more <a href="https://community.zappysys.com/t/how-to-copy-the-zappysys-driver-connection-string/172">how to copy full connection string</a></p>
<div style="width: 815px" class="wp-caption alignnone"><img loading="lazy" decoding="async" title="Power BI Get Data showing ZappySys DirectQuery ODBC Connector selected" src="/blog/wp-content/uploads/2026/04/power-bi-zappysys-directquery-connector-selection.png" alt="Power BI Get Data showing ZappySys DirectQuery ODBC Connector selected" width="805" height="557" /><p class="wp-caption-text">Power BI Get Data showing ZappySys DirectQuery ODBC Connector selected</p></div>
<h3>Choosing Your Selection Mode</h3>
<p>When the navigator opens, you must choose how to fetch your data:</p>
<ul>
<li><strong>Table Mode:</strong> Best for simple datasets where you want to select a table from a list.</li>
<li><strong>Query Mode (SQL):</strong> Recommended for performance. Writing a custom SQL query allows you to filter and join data at the source, which is much faster for DirectQuery.</li>
</ul>
<div class="su-note"  style="border-color:#dfdfdf;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:#f9f9f9;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">
<strong>Pro-Tip:</strong> To get the full connection string for ZappySys drivers, click &#8220;Copy Settings&#8221; in the Driver UI and paste it directly into Power BI.<br />
</div></div>
<h2>Step 5: Verify Your DirectQuery Connection (Final Result)</h2>
<p>Once connected, it is crucial to verify that the report is truly &#8220;Live.&#8221; A successful connection will change the behavior of Power BI Desktop.</p>
<div id="attachment_12030" style="width: 1183px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2026/04/powerbi-real-time-directquery-odbc-dashboard-example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-12030" class="wp-image-12030 size-full" src="https://zappysys.com/blog/wp-content/uploads/2026/04/powerbi-real-time-directquery-odbc-dashboard-example.png" alt="Power BI Test Dashboard showing Storage Mode: DirectQuery" width="1173" height="757" srcset="https://zappysys.com/blog/wp-content/uploads/2026/04/powerbi-real-time-directquery-odbc-dashboard-example.png 1173w, https://zappysys.com/blog/wp-content/uploads/2026/04/powerbi-real-time-directquery-odbc-dashboard-example-300x194.png 300w, https://zappysys.com/blog/wp-content/uploads/2026/04/powerbi-real-time-directquery-odbc-dashboard-example-1024x661.png 1024w, https://zappysys.com/blog/wp-content/uploads/2026/04/powerbi-real-time-directquery-odbc-dashboard-example-768x496.png 768w" sizes="(max-width: 1173px) 100vw, 1173px" /></a><p id="caption-attachment-12030" class="wp-caption-text">Power BI Test Dashboard showing Storage Mode: DirectQuery</p></div>
<div class="su-note"  style="border-color:#d0e0d7;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:#eafaf1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">
<strong>Confirmation Checklist:</strong><br />
* <strong>Storage Mode:</strong> Look at the status bar at the bottom-right; it must say <strong>Storage Mode: DirectQuery</strong>.<br />
* <strong>Data Pane:</strong> On the right side, you can see your tables, but the local &#8220;Data&#8221; icon on the far left sidebar is hidden because data is not imported.<br />
</div></div>
<h2>Step 6: Configure the Gateway for Power BI Service</h2>
<p>Once your report is ready, you must configure the gateway so Power BI Service can maintain the live DirectQuery connection to your data source. Follow the steps below to deploy and enable your custom connector for the On-premises Data Gateway.</p>
<h3>6.1 Create a Dedicated Connector Folder</h3>
<p>Do not place the connector in a user-specific folder. The gateway service account needs reliable access, so use a shared folder on a local drive instead.</p>
<ul>
<li><strong>Recommended paths:</strong> <code>C:\CustomConnectors</code> or <code>C:\ZappySysConnectors</code></li>
</ul>
<h3>6.2 Copy the Connector File</h3>
<p>Copy your custom connector file (<code>.mez</code>) into the folder you created.</p><pre class="crayon-plain-tag">C:\CustomConnectors\YourConnector.mez</pre><p>
<h3>6.3 Grant Folder Permissions to the Gateway Service</h3>
<p>If the connector does not appear in Power BI Service, first make sure the gateway service account can access the connector folder.</p>
<ol>
<li>Right-click the folder (for example, <code>C:\CustomConnectors</code>) and select <strong>Properties &gt; Security</strong>.</li>
<li>Click <strong>Edit &gt; Add</strong>.</li>
<li>Enter <code>NT SERVICE\PBIEgwService</code> and click <strong>Check Names</strong>.<br />
<strong>NOTE:</strong> If you are using a different service account, then use that instead. To verify Services account name try below steps.<br />
Press <strong>Windows Key + R</strong> &gt; open <strong>services.msc</strong> &gt; locate <strong>On-premises data gateway service</strong> &gt; look at <strong>Log On As<br />
&gt; </strong>If it says <strong>NT SERVICE\PBIEgwService</strong> then use exact same user name<br />
<strong>&gt; </strong>If it says <strong>Local System</strong> then use <strong>SYSTEM</strong> user for folder permission<br />
<strong>&gt; </strong>If it says <strong>DOMAIN\Svc-PBI-Gateway</strong> then use exact same user name</li>
<li>If Windows cannot find the account, make sure the <strong>Location</strong> is set to the local machine, not the domain.</li>
<li>Grant at least <strong>Read</strong> and <strong>List folder contents</strong> permissions.</li>
</ol>
<h3>6.4 Enable Custom Connectors in the Gateway Config File</h3>
<p>You must explicitly enable custom connectors and point the gateway to your connector folder.</p>
<ol>
<li>Open this file in Notepad as Administrator:</li>
</ol>
<pre class="crayon-plain-tag">C:\Program Files\On-premises data gateway\Microsoft.PowerBI.DataMovement.Pipeline.GatewayCore.dll.config</pre>
<ol start="2">
<li>Find the <code>&lt;appSettings&gt;</code> section and add these entries:</li>
</ol>
<pre class="crayon-plain-tag">&amp;lt;add key=&quot;EnableCustomConnectors&quot; value=&quot;true&quot; /&amp;gt;
&amp;lt;add key=&quot;CustomConnectorsPath&quot; value=&quot;C:\CustomConnectors&quot; /&amp;gt;</pre>
<ol start="3">
<li>Save the file.</li>
<li>Restart the gateway service from <strong>services.msc</strong> or from the gateway application.</li>
</ol>
<h3>6.5 Verify the Connector in Power BI Service</h3>
<p>After restarting the gateway, sign in to Power BI Service and try adding or mapping the data source. Your custom connector should now be available through the gateway.</p>
<div class="su-note"  style="border-color:#e5dacb;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:#fff4e5;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">
<strong>Why this matters:</strong> Using a shared root-level folder such as <code>C:\CustomConnectors</code> and granting access to the gateway service account helps avoid common <em>Connector Not Found</em> issues when publishing to Power BI Service.<br />
</div></div>
<hr />
<h2>FAQ: Frequently Asked Questions</h2>
<h3>Does the native Microsoft ODBC connector support DirectQuery?</h3>
<p>No. The native Microsoft ODBC connector is limited to Import mode only.</p>
<h3>How can I enable DirectQuery for ODBC sources in Power BI?</h3>
<p>By using the ZappySys DirectQuery ODBC Connector and following the custom extension setup outlined in this guide.</p>
<h3>Where is the ZappySys DirectQuery connector download?</h3>
<p>You can find the latest version here: <a href="https://zappysys.com/downloads/ZappySys-DirectQuery-ODBC-Connector.zip">ZappySys DirectQuery Connector ZIP</a>.</p>
<h2>Troubleshooting Checklist</h2>
<ul>
<li><strong>Connector Missing:</strong> Ensure &#8220;Allow any extension&#8221; is checked in Power BI security settings.</li>
<li><strong>Gateway Errors:</strong> Verify the DSN name is identical on both the local PC and the gateway server.</li>
<li><strong>32-bit vs 64-bit:</strong> Ensure you are using a 64-bit System DSN; 32-bit will cause connection failures.</li>
<li><strong>Driver Installation:</strong> Ensure the ZappySys ODBC driver is installed on all machines where the report or gateway runs.</li>
</ul>
<p>The post <a href="https://zappysys.com/blog/enable-power-bi-directquery-for-odbc-solving-the-live-data-problem/">Enable Power BI DirectQuery for ODBC: Solving the Live Data Problem</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Import JIRA data in Power BI</title>
		<link>https://zappysys.com/blog/how-to-import-jira-data-in-powerbi/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 26 Dec 2018 07:53:23 +0000</pubDate>
				<category><![CDATA[JSON File / REST API Driver]]></category>
		<category><![CDATA[Reporting - Microsoft Power BI]]></category>
		<category><![CDATA[REST API]]></category>
		<category><![CDATA[jira]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[odbc json driver]]></category>
		<category><![CDATA[power bi]]></category>
		<category><![CDATA[rest api]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=5715</guid>

					<description><![CDATA[<p>Introduction In our previous blog we saw how to import rest api in Power BI. We recommend you go through that article first. In this article, we will learn how to Import JIRA data in Power BI. For that, we will create a successful HTML Connection then request for reading JIRA data and loading into Power [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/how-to-import-jira-data-in-powerbi/">How to Import JIRA data in Power BI</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF8B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>UPDATE:</strong> ZappySys has released a brand new <a href="https://zappysys.com/api/integration-hub/zendesk-connector/power-bi">API Connector for Jira Online</a> which makes it much simpler to <strong>Read/Write Jira Data in Power BI</strong> compared to the steps listed in this article. You can still use steps from this article but if you are new to API or want to avoid learning curve with API then use newer approach.</p>
<p>Please visit <a href="https://zappysys.com/api/integration-hub/">this page to see all</a> Pre-Configured ready to use API connectors which you can use in <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-source/">SSIS API Source</a> / <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-destination/">SSIS API Destination</a> OR <a href="https://zappysys.com/products/odbc-powerpack/odbc-api-driver/">API ODBC Driver</a> (for non-SSIS Apps such as Excel, Power BI, Informatica).</p>
</div></div>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/jira-to-power-biimport-export.png"><img loading="lazy" decoding="async" class="alignleft wp-image-5717 size-thumbnail" src="https://zappysys.com/blog/wp-content/uploads/2018/06/jira-to-power-biimport-export-150x150.png" alt="jira-to-power-biimport-export" width="150" height="150" /></a>In our previous blog we saw how to <a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/" target="_blank" rel="noopener">import rest api in Power BI</a>. We recommend you go through that article first. In this article, we will learn how to <strong>Import JIRA data in Power BI</strong>. For that, we will create a successful HTML Connection then request for reading JIRA data and loading into Power BI</p>
<p>Power BI is a very popular Business Analytic tool used to get business information. It is very popular because it is easy to install, simple to learn and very intuitive. Also, REST API is very popular these days and we wanted to show you a way to integrate them in Power BI with the help of the <a href="https://zappysys.com/products/odbc-powerpack/">ZappySys ODBC PowerPack</a>. This software includes powerful drivers to <strong>query REST API</strong> URL, Local <strong>XML / JSON files</strong> and <strong>XML SOAP Web Service</strong> with simple SQL queries.</p>
<p>In nutshell, this post will focus on how to call JIRA API using <a href="https://zappysys.com/products/odbc-powerpack/">Zappysys ODBC PowerPack</a>. So let&#8217;s get started</p>
<h2><span id="Requirements">Prerequisite</span></h2>
<ol>
<li>First, you will need to have our <a href="https://zappysys.com/products/odbc-powerpack/">ZappySys ODBC Power Pack.</a></li>
<li>In the second place, you will need to have internet access.</li>
<li>On third place, <a href="https://powerbi.microsoft.com/en-us/desktop/" target="_blank" rel="noopener">Power BI Desktop (FREE)</a> installed.</li>
<li><a href="https://id.atlassian.com/manage-profile">JIRA Atlassian</a> account.</li>
</ol>
<h2>What is JIRA</h2>
<p>JIRA is Atlassian’s popular project- and issue-tracking platform used by development and technical support teams to get more work done and faster.</p>
<p>It combines:</p>
<p><strong>issue tracking</strong> &#8211; a software application that allows to record and follow the progress of every problem or &#8220;issue&#8221; that user identifies until the problem is resolved.<br />
<strong>agile project management</strong> &#8211; an iterative approach to planning and guiding project processes. customizable workflow, and a pluggable integration &#8211; integrates with Freshdesk, GitHub, Zendesk, Zapbook, Asana and so on.</p>
<h2><span id="Getting_Started">Getting Started</span></h2>
<p>In order to start, we will show several examples. ZappySys ODBC PowerPack includes the ZappySys JSON Driver that will help you to call JIRA API, retrieve various data from JIRA and load that data in Power BI. To learn more about JIRA API <a href="https://developer.atlassian.com/cloud/jira/platform/rest/" target="_blank" rel="noopener">check this help file</a>.</p>
<div class="content_block" id="custom_post_widget-4816"><h2>Generate API Token</h2>
To access JIRA data using REST API call you need to generate an API Token in your Atlassian account. Follow the steps mentioned below to generate API Token:
<ol>
 	<li>you can directly login to the <a href="https://id.atlassian.com" target="_blank" rel="noopener">JIRA Atlassian Cloud site</a> with your credentials, and redirect to the <a href="https://id.atlassian.com/profile/profile.action" target="_blank" rel="noopener">JIRA Atlassian Cloud Account's Profile Page</a> for generating an API Token.</li>
 	<li>Click <strong>API tokens</strong>, then <strong>Create API token</strong>.
<div class="wp-caption aligncenter">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-1.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-4315 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-1.png" alt="Generate API Token - Step - 1" width="1600" height="605" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-1.png 1600w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-1-300x113.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-1-768x290.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-1-1024x387.png 1024w" sizes="(max-width: 1600px) 100vw, 1600px" /></a>
<p class="wp-caption-text">Generate API Token - Step - 1</p>

</div></li>
 	<li>Create API Token - Give Label name to your API token which you are generating now
<div class="wp-caption aligncenter">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-2.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="size-full wp-image-4316" src="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-2.png" alt="Generate API Token - Step - 2" width="1599" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-2.png 1599w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-2-300x113.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-2-768x290.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-2-1024x386.png 1024w" sizes="(max-width: 1599px) 100vw, 1599px" /></a>
<p class="wp-caption-text">Generate API Token - Step - 2</p>

</div></li>
 	<li>Use <strong>Copy to the clipboard</strong>, and paste the token into your or elsewhere:
<div class="su-note-inner su-clearfix" style="background-color:#fff4b7;border-color:#fffdf1;color:#333333"><blockquote>Note:  * For security reasons it isn't possible to view the token after closing the creation dialog; if necessary, create a new token. * You should store the token securely, just as for any password.</blockquote></div>
<div class="wp-caption aligncenter">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-3.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="size-full wp-image-4321" src="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-3.png" alt="Generate API Token - Step - 3" width="1600" height="602" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-3.png 1600w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-3-300x113.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-3-768x289.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-3-1024x385.png 1024w" sizes="(max-width: 1600px) 100vw, 1600px" /></a>
<p class="wp-caption-text">Generate API Token - Step - 3</p>

</div></li>
 	<li>If you forgot API token, then you can Revoke your old API token and create new API token OR you can create multiple API tokens too.
<div class="wp-caption aligncenter">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-4.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-4326 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-4.png" alt="Generate API token - Step - 4" width="1600" height="601" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-4.png 1600w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-4-300x113.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-4-768x288.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-4-1024x385.png 1024w" sizes="(max-width: 1600px) 100vw, 1600px" /></a>
<p class="wp-caption-text">Generate API token - Step - 4</p>

</div></li>
</ol>
Now we have successfully generated an API token. Let´s start with an example. In this example, we will show how to read Tasks/Issues data from JIRA and store that data into a SQL table with SSIS.</div>
<div class="content_block" id="custom_post_widget-5776"><h2>About JIRA REST API</h2>
JIRA On-premises and Cloud Version both offers REST API. Here are some examples of <a href="https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/" target="_blank" rel="noopener">JIRA REST API</a>. For reading JIRA REST API data we will use <a href="https://developer.atlassian.com/server/jira/platform/jira-rest-api-example-query-issues-6291606/" target="_blank" rel="noopener">JIRA REST API Search method</a> which returns data in JSON format. Search API support use of <a href="https://developer.atlassian.com/server/jira/platform/jira-rest-api-example-query-issues-6291606/" target="_blank" rel="noopener">JQL Syntax</a> to filter issues. If you don't specify <strong>JQL</strong> parameters in /search endpoint then all issues will be returned. Check this link to learn <a href="https://www.youtube.com/watch?v=oSxBnqdF3-A" target="_blank" rel="noopener">how to build JQL for JIRA REST API Call</a>. If you don't have JIRA hosted instance yet but still want to try REST API Examples on public JIRA Server then try below URL (Its official JIRA site which lists their own issues). For example, try to copy below URL in a browser and hit enter.
<pre class="">https://jira.atlassian.com/rest/api/2/search?jql=project=JRASERVER</pre>
<h2><span id="Step-by-Step_Import_REST_API_into_Power_BI">Step-by-Step: Import JIRA data using REST API </span></h2>
Now once you have API token in the JIRA Atlassian Cloud website we can move to ODBC JSON Driver Configuration Part. For this example purpose you can use the following URL:
<pre class="lang:default decode:true">https://YOUR-DOMAIN.atlassian.net/rest/api/2/search?startAt=0&amp;maxResults=100&amp;jql=project=MYPROJECT</pre>
hence, <strong>your-domain is your Atlassian Cloud account’s domain name (we are using zappysys2.atlassian.net).</strong>
Therefore <strong>startAt</strong> is the index of the first item returned in the page of results.
And another<strong> maxResults</strong> is the maximum number of items that can be returned per page.

Above all, each API endpoint may have a different limit for the number of items returned, and these limits may change without notice. (For more See this <a href="https://developer.atlassian.com/cloud/jira/platform/rest/#pagination" target="_blank" rel="noopener">JIRA API Documentation for Pagination</a>)
<h3><span id="Create_ODBC_DSN_8211_JSON_Driver">Create ODBC – Zappysys JSON Driver Data Source</span></h3>
<ol>
 	<li>To do this, we will first open the ODBC Data Source : <strong>Select 64-Bit</strong> for 64bit apps and 32bit if your app / process doesnt support 64bit.
<div class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/open-ODBC-Data-souce-administrator.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-4232 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/open-ODBC-Data-souce-administrator.png" alt="ODBC Windows" width="393" height="531" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/open-ODBC-Data-souce-administrator.png 393w, https://zappysys.com/blog/wp-content/uploads/2018/06/open-ODBC-Data-souce-administrator-222x300.png 222w" sizes="(max-width: 393px) 100vw, 393px" /></a> Windows ODBC Data Sources

</div></li>
 	<li>Click on Add button in User DSN Tab and then select JSON Driver from the driver list and click on Finish button to Create a new JSON Driver.
<div class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-3993 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver.png" alt="ODBC User DSN Tab: Add new Driver Screen" width="1057" height="422" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver.png 1057w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver-300x120.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver-768x307.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver-1024x409.png 1024w" sizes="(max-width: 1057px) 100vw, 1057px" /></a> ODBC User DSN Tab: Add new Driver Screen

</div></li>
 	<li>Now it's time to connect with JIRA. Let's use JSON Driver Data source with the following URL. Change domain with your own domain.
<div id="crayon-5befbb0bdc2d5563302218" class="crayon-syntax crayon-theme-vs2012 crayon-font-courier-new crayon-os-pc print-yes notranslate">
<div class="crayon-main">
<pre class="lang:default decode:true" style="padding-left: 30px;">https://{yourdomain}.atlassian.net/rest/api/2/search?startAt=0&amp;maxResults=100
</pre>
</div>
</div>
<div class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_enter_jira_request_url.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="size-full wp-image-5390" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_enter_jira_request_url.png" alt="ODBC JSON Driver: Enter Request URL" width="802" height="702" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_enter_jira_request_url.png 802w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_enter_jira_request_url-300x263.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_enter_jira_request_url-768x672.png 768w" sizes="(max-width: 802px) 100vw, 802px" /></a>

ODBC JSON Driver: Enter Request URL

</div></li>
 	<li>It is time to configure the Other Settings. Select HTTP Connection Type from the Connection Type drop-down and Click on Click to Configure Link to Configure the Connection Manager.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/jira-odbc-json-driver-configure-http-api-connection-e1548714720542.png" target="_blank" rel="noopener"><img decoding="async" class="wp-image-5830 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2018/11/jira-odbc-json-driver-configure-http-api-connection-e1548714720542.png" alt="JIRA REST API Connection - Use ZappySys JSON Driver HTTP Connection" width="720" /></a>JIRA REST API Connection - Use ZappySys JSON Driver HTTP Connection</div></li>
 	<li>Now, we are going to set Pagination related configurations for JIRA Search request. Page number indicator must be <span class="crayon-syntax crayon-syntax-inline crayon-theme-vs2012 crayon-theme-vs2012-inline crayon-font-courier-new" style="font-size: 12px !important; line-height: 15px !important;"><span class="crayon-pre crayon-code" style="font-size: 12px !important; line-height: 15px !important;"><span class="crayon-v">startAt</span></span></span> and <span class="crayon-syntax crayon-syntax-inline crayon-theme-vs2012 crayon-theme-vs2012-inline crayon-font-courier-new" style="font-size: 12px !important; line-height: 15px !important;"><span class="crayon-pre crayon-code" style="font-size: 12px !important; line-height: 15px !important;"><span class="crayon-v">maxResults</span></span></span> value in URL must match with Increment By (i.e. 50)
<div class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/odbc_json_driver_pagination_configuration.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="aligncenter wp-image-9305 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2018/12/odbc_json_driver_pagination_configuration.png" alt="ODBC JSON Driver - JIRA request Pagination Configurations Settings" width="720" height="630" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/odbc_json_driver_pagination_configuration.png 802w, https://zappysys.com/blog/wp-content/uploads/2018/12/odbc_json_driver_pagination_configuration-300x263.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/odbc_json_driver_pagination_configuration-768x672.png 768w" sizes="(max-width: 720px) 100vw, 720px" /></a>

ODBC JSON Driver - JIRA request Pagination Configurations Settings

</div></li>
 	<li>After adding pagination parameters let's add <span id="crayon-5c2b1cd384d9b365821121" class="crayon-syntax crayon-syntax-inline crayon-theme-vs2012 crayon-theme-vs2012-inline crayon-font-courier-new" style="font-size: 12px !important; line-height: 15px !important;"><span class="crayon-pre crayon-code" style="font-size: 12px !important; line-height: 15px !important;"><span class="crayon-v">JQL</span><span class="crayon-o">=</span></span></span> search parameter to get specific data. Here we are searching the data by Project name and status. You can find more information about JQL on this link: <a href="https://confluence.atlassian.com/jiracore/blog/2015/07/search-jira-like-a-boss-with-jql" target="_blank" rel="noopener">Search JIRA like a boss with JQL</a>
Here is example JQL search query for Public JIRA site. Replace jira.atlassian.com and project JRASERVER with your own values.
<pre class="lang:default highlight:0 decode:true">https://jira.atlassian.com/rest/api/2/search?jql=project=JRASERVER
https://jira.atlassian.com/rest/api/2/search?jql=project=JRASERVER AND status=Open
https://jira.atlassian.com/rest/api/2/search?jql=project=JRASERVER AND status in (Open,Done)
https://jira.atlassian.com/rest/api/2/search?jql=project=JRASERVER AND status=Open order by lastViewed DESC</pre>
<div id="attachment_5829" align="aligncenter">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/jira-search-using-jql.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-5830 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2018/12/jira-search-using-jql-768x672.png" alt="Search using jql parameter" width="720" height="630" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/jira-search-using-jql-768x672.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/12/jira-search-using-jql-300x263.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/jira-search-using-jql.png 802w" sizes="(max-width: 720px) 100vw, 720px" /></a>

Search using JQL parameter

</div></li>
 	<li>Click on Select Filter to set the Filter.
<div class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_select_filter.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="size-full wp-image-5393" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_select_filter.png" alt="ODBC JSON Driver for JIRA API: Select Filter" width="1283" height="699" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_select_filter.png 1283w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_select_filter-300x163.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_select_filter-768x418.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_select_filter-1024x558.png 1024w" sizes="(max-width: 1283px) 100vw, 1283px" /></a>

ODBC JSON Driver for JIRA API: Select Filter

</div></li>
 	<li>You are done with the Configurations, Click on Test Connection to test the Connection.
<div class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_test_connection.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="size-full wp-image-5394" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_test_connection.png" alt="ODBC JSON Driver - Test Connection" width="802" height="702" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_test_connection.png 802w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_test_connection-300x263.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_test_connection-768x672.png 768w" sizes="(max-width: 802px) 100vw, 802px" /></a>

ODBC JSON Driver - Test Connection

</div></li>
 	<li>After that select the table from where you want to get data.
<div class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_create_query_of_json.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="size-full wp-image-5396" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_create_query_of_json.png" alt="JSON Driver: Create Query of JSON data" width="749" height="434" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_create_query_of_json.png 749w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_create_query_of_json-300x174.png 300w" sizes="(max-width: 749px) 100vw, 749px" /></a>

JSON Driver: Create Query of JSON data

</div></li>
 	<li>Click on the Preview Data button to preview the data.
<div class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_preview_data.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-5553 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_preview_data.png" alt="Preview issues table data" width="1016" height="734" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_preview_data.png 1016w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_preview_data-300x217.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_preview_data-768x555.png 768w" sizes="(max-width: 1016px) 100vw, 1016px" /></a>

Preview issues table data

</div></li>
 	<li>And that’s it, Now we will move forward to the next Phase.</li>
</ol>
<h3>Build your Own JQL Search queries for JIRA Issue</h3>
In previous sections we saw some basic JQL queries to search JIRA Issues using API call. Now lets look at how to build such queries using online UI (Think like a query builder). from JIRA.
<ol>
 	<li>JIRA has its own public Issue repository which you can browse any time by going here <a href="https://jira.atlassian.com/issues/" target="_blank" rel="noopener">https://jira.atlassian.com/issues/</a></li>
 	<li>Now try to change filter settings for search criteria (E.g. change Project, Status etc)</li>
 	<li>You will notice when you make change your URL keeps changing too. From that URL you can extract ?jql=xxxxxxx  part and use it as template for your own JIRA API search queries.</li>
</ol>
For more information check <a href="https://www.youtube.com/watch?v=oSxBnqdF3-A" target="_blank" rel="noopener">how to build JQL for JIRA REST API Call</a>.</div>
<h2><span id="Load_data_into_Power_BI">Load JIRA data into Power BI (Connect JIRA REST API)</span></h2>
<div class="content_block" id="custom_post_widget-6247">In the previous section, we configured and added the ZappySys drivers in the ODBC Driver Administrator with information to connect to REST API. We queried the REST API data in JSON / XML format. Now let's look at how to import REST API data in Power BI using from ODBC connection.
<ol>
 	<li>Open Power BI Desktop and select the <strong>Get data </strong>option.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/Get-data-Power-bi-desktop.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/03/Get-data-Power-bi-desktop.png" alt="Get data using power bi" />
</a>
<p class="wp-caption-text">Get data using Power BI</p>

</div></li>
</ol>
<ol>
 	<li>Once Get data is clicked, Go to <strong>Other</strong> and select <strong>ODBC.</strong>
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-odbc-other-data-source.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-2-1.png" alt="Import ODBC data source in power bi" />
</a>
<p class="wp-caption-text">Import ODBC data source in Power BI</p>

</div></li>
 	<li>After that select ODBC DSN name from the DSN dropdown</li>
 	<li>Now it's time to import data. Basically, there are two modes to import data. <strong>Table Mode</strong> and <strong>Query Mode</strong>. Query mode is the most common but we will show you both ways.</li>
 	<li><strong>Import using Power BI Query Mode:  </strong>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 query like below. If you are not sure use Query builder (Found on Driver Preview Window)
<pre class="lang:tsql decode:true">SELECT * FROM $
WITH(SRC='https://my-api-url')</pre>
<div 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 decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-1-1.png" alt="Import JSON / REST API data in Power BI using SQL Query Mode" />
</a>
<p class="wp-caption-text">Import JSON / REST API data in Power BI using SQL Query Mode</p>

</div>
&nbsp;</li>
 	<li><strong>Import using Power BI Table Mode:  </strong>If you don't specify SQL query under advanced options then you may get a chance to select Table name to import and Credentials. If Power BI asks for credentials then select <strong>Windows</strong> and connect.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/select-credentials-zappysys.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-3.png" alt="Select credentials for ODBC Source" />
</a>
<p class="wp-caption-text">Select credentials for ODBC Source</p>

</div></li>
 	<li>Once you enter select table, you can choose Select data to import and click OK (Below screeenshot is for the Table mode import when no SQL specified. You can pick desired table to import)
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/Navigator-odbc-json-get-values.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-4.png" alt="Select Table to import in Power BI" />
</a>
<p class="wp-caption-text">Select Table to import in Power BI</p>

</div></li>
 	<li>You can also display data in map using Map visualization like below. Press the map and check Address this option will display the addresses in a map.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/maps-power-view.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-5.png" alt="see address in power bi map" />
</a>
<p class="wp-caption-text">See Address data in power bi map</p>

</div>
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/maps-address-power-bi.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-6.png" alt="Map visualization in Power BI" />
</a>
<p class="wp-caption-text">Map visualization in Power BI</p>

</div></li>
 	<li>Now, let's display data in Table Format. Select in values more columns and select the data grid to visualize the data.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/visualization-power-bi-select-columns.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-7.png" alt="Select columns in Power BI" />
</a>
<p class="wp-caption-text">Select columns in Power BI</p>

</div></li>
 	<li>Once data is displayed, Right click on the data and select <strong>Show Data</strong>.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-show-data.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-8.png" alt="show data in power bi" />
</a>
<p class="wp-caption-text">Show data in Power BI</p>

</div></li>
 	<li>The data will be displayed
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-read-data.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-9.png" alt="View Power BI Table data" />
</a>
<p class="wp-caption-text">read json information data</p>

</div></li>
</ol></div>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>In this blog, we have learned how to retrieve the data from JIRA using ODBC JSON Driver and then Load those data in Power BI with ODBC DSN in a very simple way. You can achieve many more functionalities with the use of <a href="https://zappysys.com/products/odbc-powerpack/">ODBC PowerPack</a>.</p>
<h2><span id="References">References</span></h2>
<p>Finally, you can use the following links for more information about the use of JIRA API with our tools:</p>
<ul>
<li><a href="https://developer.atlassian.com/cloud/jira/platform/rest/" target="_blank" rel="noopener">JIRA Documentation for API</a></li>
<li><strong>Landing Page</strong> for <a href="https://zappysys.com/products/odbc-powerpack/odbc-json-rest-api-driver/" target="_blank" rel="noopener">ODBC JSON / REST API Driver</a>, you can also find <a href="https://youtu.be/iwezz0Z3D4U" target="_blank" rel="noopener">Tutorial Video</a> here.</li>
<li><strong>Help File:</strong> Documentation of <a href="https://zappysys.com/onlinehelp/odbc-powerpack/index.htm#page=json-odbc-driver-intro.htm" target="_blank" rel="noopener">JSON Driver</a>.</li>
<li><strong>Blog/articles link</strong>: <a href="https://zappysys.com/blog/category/odbc-powerpack/odbc-drivers/json-rest-api-driver/" target="_blank" rel="noopener">https://zappysys.com/blog/category/odbc-powerpack/odbc-drivers/json-rest-api-driver/</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/how-to-import-jira-data-in-powerbi/">How to Import JIRA data in Power BI</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Get Office 365 data in Power BI using Microsoft Graph API and ODBC</title>
		<link>https://zappysys.com/blog/get-office-365-data-in-power-bi-using-microsoft-graph-api-and-odbc/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 19 Dec 2018 17:57:00 +0000</pubDate>
				<category><![CDATA[JSON File / REST API Driver]]></category>
		<category><![CDATA[ODBC App Integration]]></category>
		<category><![CDATA[ODBC Drivers]]></category>
		<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[Reporting - Microsoft Power BI]]></category>
		<category><![CDATA[REST API]]></category>
		<category><![CDATA[XML File / SOAP API Driver]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[microsoft graph api]]></category>
		<category><![CDATA[office 365]]></category>
		<category><![CDATA[onedrive]]></category>
		<category><![CDATA[onenote]]></category>
		<category><![CDATA[power bi]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=5661</guid>

					<description><![CDATA[<p>Introduction In this article, we will get Office 365  data in Power BI using Microsoft Graph API and ODBC drivers. Specifically, we will get Excel file data in OneDrive, events from a Calendar and finally, a list in a note in OneNote and then load that data into a Power BI report. We will achieve [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/get-office-365-data-in-power-bi-using-microsoft-graph-api-and-odbc/">Get Office 365 data in Power BI using Microsoft Graph API and ODBC</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p style="text-align: justify;"><img loading="lazy" decoding="async" class="size-thumbnail wp-image-6204 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/12/office-365-to-power-bi-150x150.png" alt="" width="150" height="150" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/office-365-to-power-bi-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2018/12/office-365-to-power-bi-300x300.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/office-365-to-power-bi.png 350w" sizes="(max-width: 150px) 100vw, 150px" />In this article, we will get <a href="https://www.office.com/" target="_blank" rel="noopener">Office 365</a>  data in Power BI using <a href="https://docs.microsoft.com/en-us/graph/overview" target="_blank" rel="noopener">Microsoft Graph API</a> and ODBC drivers. Specifically, we will get Excel file data in <a href="https://onedrive.live.com" target="_blank" rel="noopener">OneDrive</a>, events from a <a href="https://outlook.live.com/owa/?path=/calendar" target="_blank" rel="noopener">Calendar</a> and finally, a list in a note in <a href="https://www.onenote.com/" target="_blank" rel="noopener">OneNote</a> and then load that data into a Power BI report. We will achieve that by creating an ODBC data source using <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> and then querying corresponding <a href="https://docs.microsoft.com/en-us/graph/overview" target="_blank" rel="noopener">Microsoft Graph API</a> methods. ODBC PowerPack allows to query REST/SOAP APIs in an easy way and lets to view responses in a tabular format, which will be perfect to accomplish our goal.</p>
<p>&nbsp;</p>
<h2>Prerequisites</h2>
<ol>
<li>A Power BI account.</li>
<li>Wield basic Power BI skills.</li>
<li><a href="https://powerbi.microsoft.com/en-us/desktop/" target="_blank" rel="noopener">Power BI Desktop</a> installed.</li>
<li><a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> installed.</li>
</ol>
<h2>Step By Step &#8211; Get Office 365 data in Power BI using Microsoft Graph API and ODBC</h2>
<div class="content_block" id="custom_post_widget-5670"><h2 style="text-align: left;">Register Application (OAuth2 App for Graph API)</h2>
<p style="text-align: left;">The first step to access any Office 365 API / Graph API is to register an OAuth App in the Azure Portal. After
following these steps, you will get the following two items to use in the next section:</p>

<ul style="text-align: left;">
 	<li>Application Id</li>
 	<li>Application Secret</li>
</ul>
<p style="text-align: left;">In this section, you will learn how to register a custom app in Microsoft Azure portal that will allow access to the
OneDrive. So, let's get started -</p>

<ol>
 	<li style="text-align: left;">Log into <a href="https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps">Microsoft
Azure portal</a> to register a custom app.</li>
 	<li style="text-align: left;">Register a new application by clicking New Registration link.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/NewRegistration.png"><img loading="lazy" decoding="async" class="size-full wp-image-9034" src="https://zappysys.com/blog/wp-content/uploads/2020/07/NewRegistration.png" alt="New App Registration in Azure portal" width="748" height="221" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/NewRegistration.png 748w, https://zappysys.com/blog/wp-content/uploads/2020/07/NewRegistration-300x89.png 300w" sizes="(max-width: 748px) 100vw, 748px" /></a></li>
 	<li style="text-align: left;">Provide the name of the custom app and who can access the app in the organization.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/RegisterOneDriveApp-1.jpg"><img loading="lazy" decoding="async" class="wp-image-9005 size-full" src="https://zappysys.com/blog/wp-content/uploads/2020/07/RegisterOneDriveApp-1.jpg" alt="Register an OneDrive App" width="610" height="518" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/RegisterOneDriveApp-1.jpg 610w, https://zappysys.com/blog/wp-content/uploads/2020/07/RegisterOneDriveApp-1-300x255.jpg 300w" sizes="(max-width: 610px) 100vw, 610px" /></a></li>
 	<li style="text-align: left;">Go to the App overview and add a Redirect URL.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI-1.jpg"><img loading="lazy" decoding="async" class="wp-image-9044 size-full" src="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI-1.jpg" alt="Add a Redirect URL" width="937" height="122" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI-1.jpg 937w, https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI-1-300x39.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI-1-768x100.jpg 768w" sizes="(max-width: 937px) 100vw, 937px" /></a></li>
 	<li style="text-align: left;">Click on "Add a Platform" under Platform Configuration section and then select "Web" under Web applications
section to enter a Redirect URL.
<pre class="lang:default decode:true">https://zappysys.com/oauth</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI2.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9007" src="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI2.jpg" alt="Redirect URL" width="466" height="564" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI2.jpg 466w, https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI2-248x300.jpg 248w" sizes="(max-width: 466px) 100vw, 466px" /></a></li>
 	<li style="text-align: left;">Create a Client Secret key which will be used to Authenticate the custom Azure app.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9010" src="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret.jpg" alt="Add a Client Secret" width="576" height="403" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret.jpg 576w, https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret-300x210.jpg 300w" sizes="(max-width: 576px) 100vw, 576px" /></a><a href="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret2.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9011" src="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret2.jpg" alt="Secret Key Expiration Period" width="208" height="259" /></a><a href="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret3.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9012" src="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret3.jpg" alt="Specify Secret Key" width="1024" height="176" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret3.jpg 1024w, https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret3-300x52.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret3-768x132.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></a>
<div><strong>Note</strong> - Take a note of <strong>Client Secret</strong>, it will be required while
configuring OAuth connection in the SSIS later</div></li>
 	<li style="text-align: left;">Add API Permissions.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9008" src="https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions.jpg" alt="OneDrive API Permissions" width="1291" height="415" /></a></li>
 	<li style="text-align: left;">Select following permissions from the Delegated Permissions section.
<pre class="lang:default decode:true">User.ReadBasic.All
Files.Read
offline_access</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions2.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9009" src="https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions2.jpg" alt="Select Delegated Permissions" width="512" height="571" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions2.jpg 512w, https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions2-269x300.jpg 269w" sizes="(max-width: 512px) 100vw, 512px" /></a></li>
 	<li>Take a note of Client ID, it will be required while configuring OAuth connection in the SSIS later.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret4.jpg"><img loading="lazy" decoding="async" class="wp-image-9013 size-full alignleft" src="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret4.jpg" alt="App Client ID" width="810" height="274" /></a></li>
</ol></div>
<div class="content_block" id="custom_post_widget-5914"><h3>Open ODBC Data Source Administrator</h3>
<ol>
 	<li>Hit <em>Windows Start</em> button and search for "odbc".</li>
 	<li>You will see two versions of <em>ODBC Data Source administrator</em>: <strong>64-bit </strong>and <strong>32-bit</strong>. Choose:
<ol>
 	<li style="list-style-type: none;">
<ul style="margin-left: 0px;">
 	<li>64-bit if your client application is a 64-bit program and you plan to create a <em>System DSN</em>.</li>
 	<li>32-bit if your client application is a 32-bit program and you plan to create a <em>System DSN</em>.</li>
 	<li>32-bit or 64-bit version if you plan to create a <em>User DSN</em>.</li>
</ul>
</li>
</ol>
<div class="wp-caption alignnone">

<img loading="lazy" decoding="async" class="alignnone size-full wp-image-6213" src="https://zappysys.com/blog/wp-content/uploads/2019/01/how-to-open-odbc-data-source-administrator-2.png" alt="" width="394" height="542" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/how-to-open-odbc-data-source-administrator-2.png 394w, https://zappysys.com/blog/wp-content/uploads/2019/01/how-to-open-odbc-data-source-administrator-2-218x300.png 218w" sizes="(max-width: 394px) 100vw, 394px" />
<p class="wp-caption-text">Windows ODBC Data Sources</p>

</div></li>
 	<li>Once you open, you should see a similar window:
<div class="wp-caption">

<img loading="lazy" decoding="async" class="alignnone size-full wp-image-5915" src="https://zappysys.com/blog/wp-content/uploads/2019/01/open-odbc-data-source-administrator-to-get-data-in-power-bi.png" alt="" width="594" height="421" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/open-odbc-data-source-administrator-to-get-data-in-power-bi.png 594w, https://zappysys.com/blog/wp-content/uploads/2019/01/open-odbc-data-source-administrator-to-get-data-in-power-bi-300x213.png 300w" sizes="(max-width: 594px) 100vw, 594px" />
<p class="wp-caption-text">ODBC Data Source Administrator</p>

</div></li>
</ol></div>
<h3>Set up an ODBC data source based on ZappySys JSON Driver</h3>
<h4>Add a data source</h4>
<div class="content_block" id="custom_post_widget-6052"><ol>
 	<li>Go to <em>System DSN</em> and press <em>Add</em> to add a system DSN. If you use apps like Power BI which needs access only your User account then you can create User DSN.<img loading="lazy" decoding="async" class="wp-image-2927 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/03/odb-data-source-administrator-add.png" alt="Create new ODBC DSN (System DSN Tab)" width="590" height="419" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/odb-data-source-administrator-add.png 590w, https://zappysys.com/blog/wp-content/uploads/2018/03/odb-data-source-administrator-add-300x213.png 300w" sizes="(max-width: 590px) 100vw, 590px" /></li>
 	<li>Add a data source based on <em>ZappySys JSON Driver</em>:
<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/add-zappysys-json-driver.png"><img loading="lazy" decoding="async" class="wp-image-2923 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/03/add-zappysys-json-driver.png" alt="Add ZappySys JSON / REST Driver Connection" width="464" height="352" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/add-zappysys-json-driver.png 464w, https://zappysys.com/blog/wp-content/uploads/2018/03/add-zappysys-json-driver-300x228.png 300w" sizes="(max-width: 464px) 100vw, 464px" /></a></li>
</ol></div>
<h4>Configure the data source</h4>
<div class="content_block" id="custom_post_widget-6064"><ol>
 	<li>Once a window appears, give a name to the data source, e.g. <strong>System - JSON:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-6182" src="https://zappysys.com/blog/wp-content/uploads/2019/01/get-data-from-office-365-using-microsoft-graph-api-and-odbc-powerpack-1.png" alt="" width="697" height="745" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/get-data-from-office-365-using-microsoft-graph-api-and-odbc-powerpack-1.png 697w, https://zappysys.com/blog/wp-content/uploads/2019/01/get-data-from-office-365-using-microsoft-graph-api-and-odbc-powerpack-1-281x300.png 281w" sizes="(max-width: 697px) 100vw, 697px" />
</strong></li>
 	<li>Then input <strong>https://graph.microsoft.com/v1.0/me</strong> in the URL field.</li>
 	<li>Select <strong>OAuth</strong> as the <em>Connection Type</em>.</li>
 	<li>Click <strong>Click to Configure</strong> button/link to open OAuth configuration window.</li>
 	<li>Select <strong>Custom</strong> as <em>OAuth Provider</em>.</li>
 	<li>Then input <em>Client Id, Client Secret</em> which we got when created the Graph API application.</li>
 	<li>Set <strong>https://login.microsoftonline.com/common/oauth2/v2.0/authorize</strong> as <em>Authorization Url.</em></li>
 	<li>Set <strong>https://login.microsoftonline.com/common/oauth2/v2.0/token</strong> as <em>Access Token Url</em>.</li>
 	<li>In <em>Scopes / Permissions</em> section set these scopes, separated by a new line. E.g. <strong>offline_access</strong>, <strong>Files.Read.All</strong>, <strong>Calendars</strong>.<strong>Read</strong>, <strong>Notes.Read, User.Read</strong></li>
 	<li>In <em>Advanced </em>tab configure <em>Callback/Redirect Url </em>and set it to the one we configured in Graph API app:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-6060" src="https://zappysys.com/blog/wp-content/uploads/2018/12/oauth-callback-return-url-configuration-for-office-365-app-in-odbc-powerpack.png" alt="" width="586" height="271" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/oauth-callback-return-url-configuration-for-office-365-app-in-odbc-powerpack.png 586w, https://zappysys.com/blog/wp-content/uploads/2018/12/oauth-callback-return-url-configuration-for-office-365-app-in-odbc-powerpack-300x139.png 300w" sizes="(max-width: 586px) 100vw, 586px" /></li>
 	<li>Finally, click <strong>Generate Token </strong>button to generate a token.</li>
 	<li>Click <strong>OK</strong> to close the window.</li>
</ol></div>
<h3>Set up an ODBC data source based on ZappySys XML Driver</h3>
<div class="content_block" id="custom_post_widget-6075"><ol>
 	<li>Before adding another data source based on ZappySys XML Driver, copy the connection string of the data source we just created:
<img loading="lazy" decoding="async" class="wp-image-6062 size-full alignnone" style="margin-right: 100px;" src="https://zappysys.com/blog/wp-content/uploads/2018/12/copy-connection-string-of-odbc-datasource-for-office-365-e1547488424263.png" alt="" width="529" height="210" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/copy-connection-string-of-odbc-datasource-for-office-365-e1547488424263.png 529w, https://zappysys.com/blog/wp-content/uploads/2018/12/copy-connection-string-of-odbc-datasource-for-office-365-e1547488424263-300x119.png 300w" sizes="(max-width: 529px) 100vw, 529px" /></li>
 	<li>Close the window and then add a new data source, but this time based on <em>ZappySys XML Driver</em>.</li>
 	<li>Once a window is opened, give it a name, e.g. <strong>System - XML</strong>.</li>
 	<li>Then press <strong>Load connection string</strong> button to load the connection string.</li>
 	<li>Paste the copied connection string and replace JSON text to XML, so that you have <strong>{ ZappySys XML Driver }</strong> in <em>DRIVER</em> property.</li>
 	<li>Close the window.</li>
</ol>
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-6184" src="https://zappysys.com/blog/wp-content/uploads/2019/01/load-connection-string-in-odbc-data-source-for-office-365-graph-api-app-1.png" alt="" width="652" height="416" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/load-connection-string-in-odbc-data-source-for-office-365-graph-api-app-1.png 652w, https://zappysys.com/blog/wp-content/uploads/2019/01/load-connection-string-in-odbc-data-source-for-office-365-graph-api-app-1-300x191.png 300w" sizes="(max-width: 652px) 100vw, 652px" /></div>
<h3>Create a Power BI report</h3>
<h4>Reading files from OneDrive (getting Excel data)</h4>
<p>Let&#8217;s say you have Stock.xlsx stored in <em>Sample Documents</em> folder, OneDrive with this kind of data and you want to show it in a Power BI report:</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-6081" src="https://zappysys.com/blog/wp-content/uploads/2018/12/stock.xlsx.png" alt="" width="261" height="151" /></p>
<p>To have that data in a Power BI report, perform these steps:</p>
<ol style="margin-left: 0;">
<li>Open Power BI Desktop and create a new Power BI report.</li>
<li>Create a data source based on <strong>System &#8211; JSON</strong> DSN (since we get a JSON response):<br />
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-6191" style="border: 1px solid grey;" src="https://zappysys.com/blog/wp-content/uploads/2018/12/create-odbc-data-source-in-power-bi-report-to-get-office-365-data-2.png" alt="" width="695" height="518" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/create-odbc-data-source-in-power-bi-report-to-get-office-365-data-2.png 695w, https://zappysys.com/blog/wp-content/uploads/2018/12/create-odbc-data-source-in-power-bi-report-to-get-office-365-data-2-300x224.png 300w" sizes="(max-width: 695px) 100vw, 695px" /></li>
<li style="text-align: justify;">Then in <em>SQL statement</em> area enter this query:<br />
<code>SELECT * FROM $<br />
WITH(Src='https://graph.microsoft.com/v1.0/me/drive/root:/<strong>YOUR FOLDER</strong>/Stock.xlsx:/workbook/worksheets/<strong>SHEET NAME</strong>/usedRange'<br />
,Filter='$.values[1:]'<br />
,ArrayTransformType='TransformSimpleTwoDimensionalArray'<br />
,ArrayTransColumnNameFilter='$.values[0][*]'<br />
)<br />
</code>Using <em>WITH</em> clause lets us override the properties. You can generate the query above using the <em>Query Builder</em>:<br />
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-6189" src="https://zappysys.com/blog/wp-content/uploads/2018/12/use-query-builder-in-odbc-powerpack-to-override-the-properties.png" alt="" width="545" height="297" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/use-query-builder-in-odbc-powerpack-to-override-the-properties.png 545w, https://zappysys.com/blog/wp-content/uploads/2018/12/use-query-builder-in-odbc-powerpack-to-override-the-properties-300x163.png 300w" sizes="(max-width: 545px) 100vw, 545px" />In this step we are overriding Url, Filter and array transformation fields you configured in JSON DSN. The <em>Src</em> value overrides the URL. The <em>Filter</em> property enables us to select the data we want to see in the report. We use <strong>[1:]</strong> in <strong>$.values[1:] </strong>to skip the first row because the first row contains the headers and we want only the data. You can configure this option in the <em>Filter Options</em> tab (<a href="https://goessner.net/articles/JsonPath/" target="_blank" rel="noopener">read more about JSON path</a>).We also have to make the transformation on the JSON and turn JSON arrays into rows. To accomplish that, we override <em>ArrayTransformType. </em>With <em>ArrayTransColumnNameFilter</em> property and <strong>[0][*]</strong> text, we specify that the first array of parent array will be the headers of the columns. You can read more about transformations in <a href="https://zappysys.com/blog/parse-multi-dimensional-json-array-ssis/" target="_blank" rel="noopener">Parse multi-dimensional JSON array</a> article.<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> Use <a href="https://developer.microsoft.com/en-us/graph/graph-explorer/" target="_blank" rel="noopener">Microsoft Graph API Explorer</a> to make a call and see what response you get. You can try calling <a href="https://docs.microsoft.com/en-us/graph/onedrive-concept-overview" target="_blank" rel="noopener">other OneDrive endpoints</a>.</div></div></li>
<li>Click <strong>OK</strong>.</li>
<li>Drag a table into the report, select the columns and you should see a similar view:<br />
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-6087" src="https://zappysys.com/blog/wp-content/uploads/2018/12/get-excel-data-into-power-bi-using-odbc-powerpack-and-microsoft-graph-api-1.png" alt="" width="236" height="216" /></li>
</ol>
<h4>Reading calendar entries</h4>
<p>Now, let&#8217;s say you use a calendar in Office 365 and you want your appointments to be visible in a Power BI report:<br />
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-6101" src="https://zappysys.com/blog/wp-content/uploads/2018/12/calendar-in-office-365.png" alt="" width="590" height="222" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/calendar-in-office-365.png 590w, https://zappysys.com/blog/wp-content/uploads/2018/12/calendar-in-office-365-300x113.png 300w" sizes="(max-width: 590px) 100vw, 590px" /></p>
<ol>
<li>To start, create a new Power BI report.</li>
<li>Then add a data source based on <strong>System &#8211; JSON </strong>DSN (again, we get the response in JSON):<br />
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-6187" src="https://zappysys.com/blog/wp-content/uploads/2018/12/create-odbc-data-source-in-power-bi-report-to-get-calendar-events-in-office-365-b-1.png" alt="" width="701" height="524" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/create-odbc-data-source-in-power-bi-report-to-get-calendar-events-in-office-365-b-1.png 701w, https://zappysys.com/blog/wp-content/uploads/2018/12/create-odbc-data-source-in-power-bi-report-to-get-calendar-events-in-office-365-b-1-300x224.png 300w" sizes="(max-width: 701px) 100vw, 701px" /></li>
<li style="text-align: justify;">In <em>SQL statement</em> section enter this query:<br />
<code>SELECT * FROM $<br />
WITH(Src='https://graph.microsoft.com/v1.0/me/events?$select=subject,start,end,location'<br />
,Filter='$.value[*]'<br />
,Header='Prefer: outlook.timezone="FLE Standard Time"'<br />
)</code>Here we also are overriding <em>HTTP Header</em> so that we get the event times not in UTC/GMT but for the specified timezone. It must be specified in <strong>Prefer: outlook.timezone=&#8221;{time-zone-string}&#8221;</strong> format (check <a href="https://graph.microsoft.com/v1.0/me/outlook/supportedTimeZones" target="_blank" rel="noopener">an article</a> on how to get a list of supported time zones).<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> Use <a href="https://developer.microsoft.com/en-us/graph/graph-explorer/" target="_blank" rel="noopener">Microsoft Graph API Explorer</a> to make a call and see what response you get. You can try calling <a href="https://docs.microsoft.com/en-us/graph/outlook-calendar-concept-overview" target="_blank" rel="noopener">other Calendar endpoints</a>.</div></div></li>
<li>Click <strong>OK</strong>.</li>
<li>Drag a table control into the report, select several columns and you should see a similar view:<br />
<img loading="lazy" decoding="async" class="alignnone wp-image-6102 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/office-365-calendar-appointments-in-power-bi-report-retrieved-with-odbc-powerpack-e1547658449371.png" alt="" width="490" height="214" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/office-365-calendar-appointments-in-power-bi-report-retrieved-with-odbc-powerpack-e1547658449371.png 490w, https://zappysys.com/blog/wp-content/uploads/2018/12/office-365-calendar-appointments-in-power-bi-report-retrieved-with-odbc-powerpack-e1547658449371-300x131.png 300w" sizes="(max-width: 490px) 100vw, 490px" /></li>
</ol>
<h4>Reading notes from OneNote</h4>
<p>Suppose, you have these notes in OneNote and you want &#8220;<em>Groceries list</em>&#8221; to be shown in a Power BI report:</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-6114" src="https://zappysys.com/blog/wp-content/uploads/2018/12/notes-in-onenote.png" alt="" width="516" height="189" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/notes-in-onenote.png 516w, https://zappysys.com/blog/wp-content/uploads/2018/12/notes-in-onenote-300x110.png 300w" sizes="(max-width: 516px) 100vw, 516px" /></p>
<ol>
<li>First, we will need to find NOTE ID we are trying to get. To do that, open <em>ODBC Administrator</em>, find <strong>System &#8211; JSON</strong> data source and hit <strong>Configure</strong>.</li>
<li>Then go to <em>the Preview</em> tab, and input this SQL query and hit <strong>Preview Data</strong>:<br />
<code>SELECT * FROM $<br />
WITH (Src='https://graph.microsoft.com/v1.0/me/onenote/pages'<br />
,Filter='$.value[*]'<br />
)</code></li>
<li>Once you get a result set, find your note name and copy its ID:<br />
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-6192" src="https://zappysys.com/blog/wp-content/uploads/2018/12/using-odbc-powerpack-get-note-id-in-onenote-part-of-office-365-1.png" alt="" width="676" height="593" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/using-odbc-powerpack-get-note-id-in-onenote-part-of-office-365-1.png 676w, https://zappysys.com/blog/wp-content/uploads/2018/12/using-odbc-powerpack-get-note-id-in-onenote-part-of-office-365-1-300x263.png 300w" sizes="(max-width: 676px) 100vw, 676px" /></li>
<li>Then create a new Power BI report.</li>
<li>Create a new data source based on <strong>System &#8211; XML</strong> DSN (we are using XML-based DSN because the response will be in HTML):<br />
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-6193" src="https://zappysys.com/blog/wp-content/uploads/2018/12/create-odbc-data-source-in-power-bi-report-to-get-onenote-notes-in-office-365-1.png" alt="" width="701" height="524" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/create-odbc-data-source-in-power-bi-report-to-get-onenote-notes-in-office-365-1.png 701w, https://zappysys.com/blog/wp-content/uploads/2018/12/create-odbc-data-source-in-power-bi-report-to-get-onenote-notes-in-office-365-1-300x224.png 300w" sizes="(max-width: 701px) 100vw, 701px" /></li>
<li>In <em>SQL statement</em> section enter this query (use the NOTE ID you retrieved in the previous step):<br />
<code>SELECT * FROM $<br />
WITH(ElementsToTreatAsArray='div,p'<br />
,Src='https://graph.microsoft.com/v1.0/me/onenote/pages/<strong>NOTE ID</strong>/content'<br />
,Filter='$.html.body.div[0].p[1:]'<br />
)<br />
</code><br />
<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> Use <a href="https://developer.microsoft.com/en-us/graph/graph-explorer/" target="_blank" rel="noopener">Microsoft Graph API Explorer</a> to make a call and see what response you get. You can try calling <a href="https://docs.microsoft.com/en-us/graph/integrate-with-onenote" target="_blank" rel="noopener">other OneNote endpoints</a>.</div></div></li>
<li style="text-align: justify;">Click <strong>OK</strong>.</li>
<li>Drag and drop <em>Multi-row card</em> visual, select <strong>#text</strong> column and you should see a similar view:<br />
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-6145" src="https://zappysys.com/blog/wp-content/uploads/2018/12/note-to-buy.png" alt="" width="288" height="288" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/note-to-buy.png 288w, https://zappysys.com/blog/wp-content/uploads/2018/12/note-to-buy-150x150.png 150w" sizes="(max-width: 288px) 100vw, 288px" /></li>
<li>We finished! Now you can publish your Power BI reports to Power BI service.</li>
</ol>
<div class="content_block" id="custom_post_widget-5891"><h2>Working with Gateways in Power BI (Schedule Import)</h2>
If the data needs to be updated, it is necessary to create a gateway on-premises. In this new section, we will install a Power BI Gateway and in the next section schedule it to update the REST API information.
<ol>
 	<li>In the last section, we Published the report. Power BI may ask you to <strong>SIGN IN.</strong>
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/sign-in-power-bi.png"><img loading="lazy" decoding="async" class="size-full wp-image-2879" src="https://zappysys.com/blog/wp-content/uploads/2018/03/sign-in-power-bi.png" alt="Sign in Power BI" width="762" height="361" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/sign-in-power-bi.png 762w, https://zappysys.com/blog/wp-content/uploads/2018/03/sign-in-power-bi-300x142.png 300w" sizes="(max-width: 762px) 100vw, 762px" /></a>
<p class="wp-caption-text">Sign in in Power BI</p>

</div></li>
 	<li>Select the Workspace and select Datasets
<div class="wp-caption">

[caption id="attachment_10110" align="alignnone" width="702"]<a href="https://zappysys.com/blog/wp-content/uploads/2019/01/power-bi-my-workspace-dataset.png"><img loading="lazy" decoding="async" class="wp-image-10110 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/power-bi-my-workspace-dataset.png" alt="power-bi-my-workspace-dataset" width="702" height="372" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/power-bi-my-workspace-dataset.png 702w, https://zappysys.com/blog/wp-content/uploads/2019/01/power-bi-my-workspace-dataset-300x159.png 300w" sizes="(max-width: 702px) 100vw, 702px" /></a> Go to workspace and dataset[/caption]
<p class="wp-caption-text">Go to workspace and dataset</p>

</div></li>
 	<li>Right-click the report and select <strong>Settings</strong>.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/report-power-bi-settings.png"><img loading="lazy" decoding="async" class="size-full wp-image-2877" src="https://zappysys.com/blog/wp-content/uploads/2018/03/report-power-bi-settings.png" alt="Define settings for Power BI report" width="535" height="325" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/report-power-bi-settings.png 535w, https://zappysys.com/blog/wp-content/uploads/2018/03/report-power-bi-settings-300x182.png 300w" sizes="(max-width: 535px) 100vw, 535px" /></a>
<p class="wp-caption-text">Specify settings for the report</p>

</div></li>
 	<li>The system will ask for a Gateway. Stay here.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway.png"><img loading="lazy" decoding="async" class="size-full wp-image-2862" src="https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway.png" alt="add power bi gateway" width="1068" height="380" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway.png 1068w, https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway-300x107.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway-768x273.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway-1024x364.png 1024w" sizes="(max-width: 1068px) 100vw, 1068px" /></a>
<p class="wp-caption-text">Add Power BI Gateway</p>

</div></li>
 	<li>Use the following link to install a Data Gateway:
<pre class="lang:php highlight:0 decode:true">https://docs.microsoft.com/en-us/power-bi/service-gateway-onprem</pre>
</li>
 	<li>Run the installer and press <strong>Next</strong>
<div class="wp-caption">

<img loading="lazy" decoding="async" class="size-full wp-image-2888" src="https://zappysys.com/blog/wp-content/uploads/2018/03/on-premises-gateway-installer-PB.png" alt="Initial gateway window for installation" width="634" height="504" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/on-premises-gateway-installer-PB.png 634w, https://zappysys.com/blog/wp-content/uploads/2018/03/on-premises-gateway-installer-PB-300x238.png 300w" sizes="(max-width: 634px) 100vw, 634px" />
<p class="wp-caption-text">Gateway installer</p>

</div></li>
 	<li>Select the option On-premises data gateway (recommended). This option allows access to multiple users and can be used by more applications than Power BI.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/choose-power-bi-on-premises-data-pb.png"><img loading="lazy" decoding="async" class="size-full wp-image-2889" src="https://zappysys.com/blog/wp-content/uploads/2018/03/choose-power-bi-on-premises-data-pb.png" alt="Choose Power BI gateway" width="631" height="501" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/choose-power-bi-on-premises-data-pb.png 631w, https://zappysys.com/blog/wp-content/uploads/2018/03/choose-power-bi-on-premises-data-pb-300x238.png 300w" sizes="(max-width: 631px) 100vw, 631px" /></a>
<p class="wp-caption-text">Choose Power BI option</p>

</div></li>
 	<li>The installer will show a warning message.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-warning-PB-msg.png"><img loading="lazy" decoding="async" class="size-full wp-image-2891" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-warning-PB-msg.png" alt="Warning message gateway installation" width="628" height="447" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-warning-PB-msg.png 628w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-warning-PB-msg-300x214.png 300w" sizes="(max-width: 628px) 100vw, 628px" /></a>
<p class="wp-caption-text">Warning message during installation</p>

</div></li>
 	<li>Select the path to install and check the I accept the terms.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-accept.png"><img loading="lazy" decoding="async" class="size-full wp-image-2916" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-accept.png" alt="accept terms" width="636" height="441" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-accept.png 636w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-accept-300x208.png 300w" sizes="(max-width: 636px) 100vw, 636px" /></a>
<p class="wp-caption-text">Accept terms</p>

</div></li>
 	<li>Specify the email address to use the gateway.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-email-address.png"><img loading="lazy" decoding="async" class="size-full wp-image-2895" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-email-address.png" alt="Register email in gateway installation" width="627" height="578" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-email-address.png 627w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-email-address-300x277.png 300w" sizes="(max-width: 627px) 100vw, 627px" /></a>
<p class="wp-caption-text">Register email address</p>

</div></li>
 	<li>After entering the email, write the gateway name and a recovery key. Make sure to confirm the recovery key.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-name-recovery-key-confirm.png"><img loading="lazy" decoding="async" class="size-full wp-image-2896" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-name-recovery-key-confirm.png" alt="Specify name and recovery key" width="629" height="487" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-name-recovery-key-confirm.png 629w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-name-recovery-key-confirm-300x232.png 300w" sizes="(max-width: 629px) 100vw, 629px" /></a>
<p class="wp-caption-text">Enter recovery key</p>

</div></li>
</ol>
&nbsp;</div>
<div class="content_block" id="custom_post_widget-5892"><h2>Manage gateways and configure the schedule</h2>
Once that the gateway is installed we will configure it and add the connection strings.
<ol>
 	<li>The next step is to go to manage gateway
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway.png"><img loading="lazy" decoding="async" class="size-full wp-image-2912" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway.png" alt="Power BI - Manage Gateway Setting" width="1068" height="380" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway.png 1068w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway-300x107.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway-768x273.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway-1024x364.png 1024w" sizes="(max-width: 1068px) 100vw, 1068px" /></a>
<p class="wp-caption-text">Power BI - Manage Gateway Setting</p>

</div></li>
 	<li>In order to get the connection string, we will need the connection string of the ZappySys JSON Driver. In the first section of this post, we explained how to configure it. Press<strong> Copy Connection String</strong>
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-data-source-copy-connection-string.png"><img loading="lazy" decoding="async" class="size-full wp-image-2866" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-data-source-copy-connection-string.png" alt="ZappySys connection properties" width="607" height="599" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-data-source-copy-connection-string.png 607w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-data-source-copy-connection-string-300x296.png 300w" sizes="(max-width: 607px) 100vw, 607px" /></a>
<p class="wp-caption-text">Connection properties</p>

</div></li>
 	<li>Once that the data is copied, add a New data Source. In <strong>Data Source Name</strong>, enter the Data Source Name of the ZappySys JSON driver in step 13 and in Data Source Type, select ODBC. In connection string copy and paste from the clipboard of the step 13 and press <strong>Add</strong>.
<div class="wp-caption">

[caption id="attachment_10113" align="alignnone" width="720"]<a href="https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string.png"><img loading="lazy" decoding="async" class="wp-image-10113 size-large" src="https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string-1024x536.png" alt="gateway-data-source-name-connection-string" width="720" height="377" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string-1024x536.png 1024w, https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string-300x157.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string-768x402.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string.png 1043w" sizes="(max-width: 720px) 100vw, 720px" /></a> ZappySys connection properties in Power BI[/caption]
<p class="wp-caption-text">ZappySys connection properties in Power BI</p>

</div></li>
 	<li>Once added the gateway. You can see the schedule refresh to <strong>On </strong>and Add another time to add the time where you want to refresh the data.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-schedule.png"><img loading="lazy" decoding="async" class="size-full wp-image-2875" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-schedule.png" alt="Schedule gateway" width="451" height="401" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-schedule.png 451w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-schedule-300x267.png 300w" sizes="(max-width: 451px) 100vw, 451px" /></a>
<p class="wp-caption-text">Schedule gateway</p>

</div></li>
</ol>
&nbsp;</div>
<h2>Conclusion</h2>
<p style="text-align: justify;">Today we learned how to call Microsoft Graph API methods using <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> and load response data into Power BI without any ETL procedures. Particularly, we used OneDrive, Calendar and OneNote Graph API endpoints to achieve that. We created two ODBC data sources based on JSON and XML ODBC Driver to query those endpoints, which let us read data directly in a Power BI report. Finally, we examined how to refresh data source on Power BI using on-premises Power BI gateway.</p>
<h2>References</h2>
<p><a href="https://powerbi.microsoft.com/en-us/" target="_blank" rel="noopener">https://powerbi.microsoft.com/en-us/</a></p>
<p><a href="https://apps.dev.microsoft.com/" target="_blank" rel="noopener">https://apps.dev.microsoft.com/</a></p>
<p><a href="https://developer.microsoft.com/en-us/graph/graph-explorer/" target="_blank" rel="noopener">https://developer.microsoft.com/en-us/graph/graph-explorer/</a></p>
<p><a href="https://docs.microsoft.com/en-us/graph/overview" target="_blank" rel="noopener">https://docs.microsoft.com/en-us/graph/overview</a></p>
<p><a href="https://docs.microsoft.com/en-us/graph/onedrive-concept-overview" target="_blank" rel="noopener">https://docs.microsoft.com/en-us/graph/onedrive-concept-overview</a></p>
<p><a href="https://docs.microsoft.com/en-us/graph/outlook-calendar-concept-overview" target="_blank" rel="noopener">https://docs.microsoft.com/en-us/graph/outlook-calendar-concept-overview</a></p>
<p><a href="https://docs.microsoft.com/en-us/graph/integrate-with-onenote" target="_blank" rel="noopener">https://docs.microsoft.com/en-us/graph/integrate-with-onenote</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/get-office-365-data-in-power-bi-using-microsoft-graph-api-and-odbc/">Get Office 365 data in Power BI using Microsoft Graph API and ODBC</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Import Amazon MWS data in Power BI</title>
		<link>https://zappysys.com/blog/import-amazon-mws-data-power-bi/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 14 Sep 2018 15:24:15 +0000</pubDate>
				<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[Reporting - Microsoft Power BI]]></category>
		<category><![CDATA[XML File / SOAP API Driver]]></category>
		<category><![CDATA[Amazon MWS]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=4825</guid>

					<description><![CDATA[<p>Introduction In our previous blog we saw how to call REST API in Power BI to import data from JSON based REST API services. Now let&#8217;s continue on that and learn how to import Amazon MWS data in Power BI using XML driver. To learn more about how to consume Amazon MWS data in ETL [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/import-amazon-mws-data-power-bi/">How to Import Amazon MWS data in Power BI</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="https://zappysys.com/blog/wp-content/uploads/2016/10/amazon-mws-api-integration.png"><img loading="lazy" decoding="async" class="wp-image-1632 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2016/10/amazon-mws-api-integration.png" alt="" width="97" height="97" 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: 97px) 100vw, 97px" /></a>In our previous blog we saw how to <a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/">call REST API in Power BI</a> to import data from JSON based REST API services. Now let&#8217;s continue on that and learn how to import Amazon MWS data in Power BI <strong>using XML driver</strong>. To learn more about how to consume <strong>Amazon MWS data</strong> in ETL using SSIS <a href="https://zappysys.com/blog/call-amazon-mws-api-using-ssis-marketplace-web-service/" target="_blank" rel="noopener">check this article</a>.</p>
<p>We will read data from Amazon MWS API using ZappySys XML Driver which is part of <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ODBC PowerPack</a>.</p>
<h2></h2>
<h2>Requirements</h2>
<ol>
<li>Active Amazon Seller Account needed (Make sure you have <strong>Professional Plan or higher</strong> (around $39/month) to call Amazon MWS API)</li>
<li>You are already <a href="https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Registering.html#DG_Registering__RegisteringAsADeveloper" target="_blank" rel="noopener">registered as a Developer</a> and you obtained AWS Access Key / Secret Key and Seller ID (i.e. Merchant ID) (see next section)</li>
<li>Download and <a href="https://zappysys.com/products/odbc-powerpack/download/" target="_blank" rel="noopener">Install ODBC PowerPack</a></li>
<li>You will also need <a href="https://powerbi.microsoft.com/en-us/desktop/" target="_blank" rel="noopener">Power BI Desktop (FREE)</a> installed</li>
</ol>
<h2>About Amazon MWS / API</h2>
<p>If you want to sell something on Amazon you can use their e-commerce platform with some monthly fee. You can setup your entire online store / inventory using admin interface.</p>
<p>Amazon Marketplace Web Service (Amazon MWS) is an integrated web service API that helps Amazon sellers to programmatically exchange data on listings, orders, payments, reports, and more. Using these API you can read or write data from your Seller account and integrate it inside your own Systems (e.g. Reporting / ETL / BI tools).</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: Amazon MWS may allow only certain number of requests per minute depending which API you calling so you might want to use each call wisely. We will suggest you various techniques throughout this article so you can avoid errors so read each section carefully. You can find Throttling information on API help page itself (<a href="https://docs.developer.amazonservices.com/en_IT/orders-2013-09-01/Orders_ListOrders.html" target="_blank" rel="noopener">like this one</a> see throttling section. Also <a href="https://docs.developer.amazonservices.com/en_IT/dev_guide/DG_Throttling.html">this one</a>).</div></div>
<h2>Obtain MWS API Access Key / Secret and Seller ID</h2>
<p>Very first thing to call any MWS API is to obtain Access Key, Secret Key and Seller ID (i.e. Merchant ID). To obtain this you first have to <a href="https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Registering.html" target="_blank" rel="noopener">register a developer</a>.</p>
<p>Here is where to look for your Merchant ID and Key / Secret.  Here is direct link to <a href="https://sellercentral.amazon.com/gp/account-manager/home.html/ref=xx_userperms_dnav_userperms" target="_blank" rel="noopener">User Permissions</a> page.</p>
<div id="attachment_4843" style="width: 997px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/obtain-amazon-mws-developer-aws-access-key-secret-key-sellerid.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4843" class="size-full wp-image-4843" src="https://zappysys.com/blog/wp-content/uploads/2018/09/obtain-amazon-mws-developer-aws-access-key-secret-key-sellerid.png" alt="How to get Amazon MWS developer keys and know your Merchant ID (i.e. Seller ID)" width="987" height="422" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/obtain-amazon-mws-developer-aws-access-key-secret-key-sellerid.png 987w, https://zappysys.com/blog/wp-content/uploads/2018/09/obtain-amazon-mws-developer-aws-access-key-secret-key-sellerid-300x128.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/obtain-amazon-mws-developer-aws-access-key-secret-key-sellerid-768x328.png 768w" sizes="(max-width: 987px) 100vw, 987px" /></a><p id="caption-attachment-4843" class="wp-caption-text">How to get Amazon MWS developer keys and know your Merchant ID (i.e. Seller ID)</p></div>
<h2>Getting Started</h2>
<p>Now let&#8217;s look at step by step instructions on how to call Amazon MWS API and then import into Power BI. In below steps we will use  <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> so make sure it&#8217;s installed first.</p>
<h3>Using ScratchPad to Test Amazon MWS API</h3>
<p>Each MWS API has set of required and optional parameters. You can refer each API page for details. For example <a href="https://docs.developer.amazonservices.com/en_US/products/Products_ListMatchingProducts.html" target="_blank" rel="noopener">ListMatchingProducts</a> API which we will use as an example. To make MWS API testing / learning easy, Amazon provides online testing tool called <a href="https://mws.amazonservices.com/scratchpad/index.html" target="_blank" rel="noopener">MWS ScratchPad</a>. We will use this tool to craft API requests and use that information in ODBC driver SQL queries and later import data in Power BI.</p>
<ol>
<li>Open <a href="https://mws.amazonservices.com/scratchpad/index.html" target="_blank" rel="noopener">MWS ScratchPad</a>  by vising <strong>https://mws.amazonservices.com/scratchpad/index.html</strong></li>
<li>Select <strong>Products</strong> API category and pick <strong>ListMatchingProducts</strong> API</li>
<li>Enter your <strong>SellerID</strong> (i.e. Merchant ID), Developer AccessKey (i.e. <strong>AWSAccessKeyId</strong>) and <strong>Secret Key</strong> we obtained in the previous section. Enter MarketId (e.g. <strong>ATVPDKIKX0DER</strong> for USA Market) and other parameters as below and Click Submit to see response.
<div id="attachment_4844" style="width: 800px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-scratchpad-online-testing-tool.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4844" class="size-full wp-image-4844" src="https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-scratchpad-online-testing-tool.png" alt="Using Amazon MWS ScratchPad (API Testing Tool - Created by Amazon)" width="790" height="500" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-scratchpad-online-testing-tool.png 790w, https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-scratchpad-online-testing-tool-300x190.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-scratchpad-online-testing-tool-768x486.png 768w" sizes="(max-width: 790px) 100vw, 790px" /></a><p id="caption-attachment-4844" class="wp-caption-text">Using Amazon MWS ScratchPad (API Testing Tool &#8211; Created by Amazon)</p></div></li>
<li>Click on the <strong>Response Details</strong> Tab to extract some important information we will use for ODBC configuration. Notice attributes in red rectangles. They are the ones which we will need in the POST request Body. ZappySys Drivers supply many common parameters automatically but any API endpoint specific parameter must be supplied in the Request Body. For example you dont have to supply <b>SignatureVersion, Timestamp, Signature or SignatureMethod</b>
<div id="attachment_4847" style="width: 933px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-response-scratchpad-listmatchingproducts-example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4847" class="size-full wp-image-4847" src="https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-response-scratchpad-listmatchingproducts-example.png" alt="Calling Amazon MWS API in Scratchpad Testing Tool (Response Details Tab) - ListMatchingProducts Example" width="923" height="527" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-response-scratchpad-listmatchingproducts-example.png 923w, https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-response-scratchpad-listmatchingproducts-example-300x171.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-response-scratchpad-listmatchingproducts-example-768x439.png 768w" sizes="(max-width: 923px) 100vw, 923px" /></a><p id="caption-attachment-4847" class="wp-caption-text">Calling Amazon MWS API in Scratchpad Testing Tool (Response Details Tab) &#8211; ListMatchingProducts Example</p></div></li>
</ol>
<p>This API requires Market ID parameter so enter it as per your Market where you selling. For example USA marketplaceid = ATVPDKIKX0DER. You can lookup correct MarketplaceId by <a href="https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Endpoints.html" target="_blank" rel="noopener">checking this help (endpoints / marketplaces)</a>.</p>
<h3>Create ODBC DSN Connection for MWS API / Test Query</h3>
<p>Once you have necessary details to call your Amazon MWS API, we can create ODBC DSN which will be used as a reusable connection for MWS API data access in apps like Power BI.</p>
<p>So let&#8217;s get started.</p>
<ol>
<li>In your start menu search for <strong>ODBC</strong> and select <strong>Data Source (64 bit)</strong>:  If you need to access DSN by Service or scheduled Job then make sure you choose 64-bit DSN if caller App is 64 bit App.
<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>For DSN access by Service account or automated jobs which runs under different user, choose System DSN Tab, Make sure You create DSN for correct Bitness (i.e. for 64bit Apps create 64 Bit DSN)
<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>Select <strong>ZappySys XML Driver</strong> and click Finish. Amazon MWS API is XML format so we selected XML driver however you can choose JSON or CSV Driver instead of XML if you dealing with JSON format.
<div id="attachment_3255" style="width: 470px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/xml-driver-ssrs.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3255" class="size-full wp-image-3255" src="https://zappysys.com/blog/wp-content/uploads/2018/04/xml-driver-ssrs.png" alt="Add new ZappySys XML Driver (For XML File / SOAP API)" width="460" height="349" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/xml-driver-ssrs.png 460w, https://zappysys.com/blog/wp-content/uploads/2018/04/xml-driver-ssrs-300x228.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a><p id="caption-attachment-3255" class="wp-caption-text">Add new ZappySys XML Driver (For XML / SOAP API)</p></div></li>
<li>Once you see Driver Configuration UI window open, enter the following settings</li>
<li>ODBC DSN name (e.g. ZS &#8211; Amazon MWS API Connection)</li>
<li>Enter MWS API Service URL as below. Notice that we added /Products/2011-10-01 (This was extracted from previous section). You can check <a href="https://docs.developer.amazonservices.com/en_ES/dev_guide/DG_Endpoints.html" target="_blank" rel="noopener">full list of Amazon MWS Endpoints here</a>. Because we are connecting to USA region we will use below URL.<br />
<pre class="crayon-plain-tag">https://mws.amazonservices.com/Products/2011-10-01</pre>
</li>
<li>Select <strong>OAuth</strong> from the Connection dropdown and Click <strong>Configure Settings</strong></li>
<li>On the Connection UI, Select OAuth Provider <strong>Amazon Market Web Service (MWS)</strong></li>
<li>Enter your API <strong>Access Key</strong> and <strong>Secret Key</strong> (obtained <a href="https://sellercentral.amazon.com/gp/account-manager/home.html/ref=xx_userperms_dnav_userperms" target="_blank" rel="noopener">from here</a>)</li>
<li>Your connection will look like below.
<div id="attachment_4850" style="width: 667px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-odbc-driver-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4850" class="size-full wp-image-4850" src="https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-odbc-driver-connection.png" alt="ODBC Connection Credentials for Amazon MWS API (Access Key, Secret Key, URL Endpoint)" width="657" height="570" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-odbc-driver-connection.png 657w, https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-odbc-driver-connection-300x260.png 300w" sizes="(max-width: 657px) 100vw, 657px" /></a><p id="caption-attachment-4850" class="wp-caption-text">ODBC Connection Credentials for Amazon MWS API (Access Key, Secret Key, URL Endpoint)</p></div></li>
<li>Also configure Retry options to handle API limit reached error when you call API too often. For Amazon MWS we get Status code 503 when request is throttled so lets narrow down on which error we want to retry.
<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>Click OK to save OAuth Connection UI to go back to main UI</li>
<li>Now let&#8217;s use some information we gathered from the previous section (Using Scraptchpad Test).</li>
<li>Select <strong>POST</strong> for HTTP Request Method</li>
<li>Enter Body as below (<strong>Change last parameter with your own SellerID</strong> and if needed change your <a href="https://docs.developer.amazonservices.com/en_ES/dev_guide/DG_Endpoints.html" target="_blank" rel="noopener">MarketPlaceId</a> too if its not USA)<br />
<pre class="crayon-plain-tag">Action=ListMatchingProducts&amp;MarketplaceId=ATVPDKIKX0DER&amp;Query=harry%20potter%20dvd&amp;SellerId=ZZZZZ-YOUR-SELLER-ID-ZZZZZ</pre>
</li>
<li>Click on Select Filter to select correct node (in our case it will be Product node as below.<br />
<pre class="crayon-plain-tag">$.ListMatchingProductsResponse.ListMatchingProductsResult.Products.Product[*]</pre>
</li>
<li>Now Go to Throttling Tab and enter some delay (e.g. <strong>enter 20000 for 20sec delay after each request</strong>). This will slow down API calls so we don&#8217;t face errors about API Limit reached.</li>
<li>You can also consider enabling <strong>Data Caching</strong> for MWS API as below to avoid API throttling / rate exceeded error. Change Cache Mode to <strong>Cache All</strong> (Use Cache for Metadata + Data Requests)<br />
<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: MWS may allow only certain number of requests per minute so you might want to use each call wisely. You can find Throttling information on API help page itself (<a href="https://docs.developer.amazonservices.com/en_IT/orders-2013-09-01/Orders_ListOrders.html" target="_blank" rel="noopener">like this one</a> see throttling section. Also <a href="https://docs.developer.amazonservices.com/en_IT/dev_guide/DG_Throttling.html">this one</a>).</div></div>
<div id="attachment_5146" style="width: 414px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/10/zappysys-odbc-caching-options.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5146" class="size-full wp-image-5146" src="https://zappysys.com/blog/wp-content/uploads/2018/10/zappysys-odbc-caching-options.png" alt="Enable Caching Options for Metadata / Data for ZappySys ODBC Drivers" width="404" height="362" srcset="https://zappysys.com/blog/wp-content/uploads/2018/10/zappysys-odbc-caching-options.png 404w, https://zappysys.com/blog/wp-content/uploads/2018/10/zappysys-odbc-caching-options-300x269.png 300w" sizes="(max-width: 404px) 100vw, 404px" /></a><p id="caption-attachment-5146" class="wp-caption-text">Enable Caching Options for Metadata / Data for ZappySys ODBC Drivers</p></div></li>
<li>Now goto Preview Tab and click on Green Play button to test query
<div id="attachment_4854" style="width: 818px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/read-amazon-mws-data-sql-query-preview-zapysys-odbc-xml-api-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4854" class="size-full wp-image-4854" src="https://zappysys.com/blog/wp-content/uploads/2018/09/read-amazon-mws-data-sql-query-preview-zapysys-odbc-xml-api-driver.png" alt="Query Amazon MWS API using ZappySys XML Driver - Preview UI" width="808" height="770" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/read-amazon-mws-data-sql-query-preview-zapysys-odbc-xml-api-driver.png 808w, https://zappysys.com/blog/wp-content/uploads/2018/09/read-amazon-mws-data-sql-query-preview-zapysys-odbc-xml-api-driver-300x286.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/read-amazon-mws-data-sql-query-preview-zapysys-odbc-xml-api-driver-768x732.png 768w" sizes="(max-width: 808px) 100vw, 808px" /></a><p id="caption-attachment-4854" class="wp-caption-text">Query Amazon MWS API using ZappySys XML Driver &#8211; Preview UI</p></div></li>
<li>That&#8217;s it. We have successfully tested first query to read data from Amazon MWS API</li>
</ol>
<h3>Caching Metadata and Using in SQL Query</h3>
<p>We talked briefly about Data Caching but still there will be a time you will face such errors. So lets do another safeguard to reduce total API requests for MWS. <a href="https://zappysys.com/blog/caching-metadata-odbc-drivers-performance/" target="_blank" rel="noopener">Check this article</a> to learn about Caching and META Clause in SQL.</p>
<p>Here are high level steps to Use predefined Schema File so Driver doesn&#8217;t call API request to guess metadata.</p>
<ol>
<li>Go to ODBC Preview window and write desired query you like to use. Click <strong>Preview Button</strong> to see sample data</li>
<li>Now click <strong>Save Metadata</strong> of query which we can use later. <strong>Save to File</strong> in our case (name as <strong>mws-query-meta.txt</strong> ).
<div id="attachment_5138" style="width: 553px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/10/odbc-driver-generate-metadata.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5138" class="size-full wp-image-5138" src="https://zappysys.com/blog/wp-content/uploads/2018/10/odbc-driver-generate-metadata.png" alt="Create Metadata for ODBC Driver Query - ZappySys API Drivers" width="543" height="526" srcset="https://zappysys.com/blog/wp-content/uploads/2018/10/odbc-driver-generate-metadata.png 543w, https://zappysys.com/blog/wp-content/uploads/2018/10/odbc-driver-generate-metadata-300x291.png 300w" sizes="(max-width: 543px) 100vw, 543px" /></a><p id="caption-attachment-5138" class="wp-caption-text">Create Metadata for ODBC Driver Query &#8211; ZappySys API Drivers</p></div></li>
<li>Now change our query as below<br />
<pre class="crayon-plain-tag">SELECT 
 ......
 ......
FROM xxxxxxxxx
WITH (META='c:\somefolder\mws-query-meta.txt')</pre>
</li>
<li>That&#8217;s it. Use query like above when we import Amazon MWS data in Power BI in the next section.</li>
</ol>
<h3>Import Amazon MWS data in Power BI (List Orders Example)</h3>
<p>Now it&#8217;s time to load our data in Power BI and create reports.</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>Now it&#8217;s time to import data. Basically, there are two modes to import data. <strong>Table Mode</strong> and <strong>Query Mode</strong>. Query mode is the most common way. <strong>Select your DSN</strong> and click <strong>Advanced Option</strong> to <strong>enter custom SQL</strong> Query to Import your MWS API data. You can use ODBC DSN Data sources Preview tool to generate SQL Query. For example you can enter query to import Orders for specified date range. We have added some pagination attributes which we will cover in the next section. Click OK to continue.<br />
<pre class="crayon-plain-tag">SELECT * FROM $
WITH(
	 ElementsToTreatAsArray='Order'
	,Src='https://mws.amazonservices.com/Orders/2013-09-01'
	,Filter='$.ListOrders[$tag$]Response.ListOrders[$tag$]Result.Orders.Order[*]'
	,RequestData='Action=ListOrders[$tag$]&amp;SellerId=A1xxxxxxxxxxxxx&amp;CreatedAfter=2018-09-01T04%3A00%3A00Z&amp;MarketplaceId.Id.1=ATVPDKIKX0DER'
	,RequestMethod='POST'
	,NextUrlAttributeOrExpr='$.ListOrders[$tag$]Response.ListOrders[$tag$]Result.NextToken'
	,NextUrlSuffix='&amp;NextToken=&lt;%nextlink_encoded%&gt;'
	,HasDifferentNextPageInfo='True'
	,EnablePageTokenForBody='True'
	,PagePlaceholders='body=|ByNextToken;filter=|ByNextToken'
	,WaitTimeMs=300 -- API throttling for pagination
	--Uncomment Caching Line to Speedup API calls and Avoid API Limit. Power BI issues many API calls behind the scene
	--,CachingMode='All',CacheStorage='File',CacheEntryTtl=120,CacheFileLocation='c:\temp\mws-orders.cache'
	--,DataConnectionType='OAuth'
	--,ScopeSeparator='{space}'
	--,ServiceProvider='AmazonMWS'
	--,ClientId='AKIAIWxxxxxxxxxxxxx' --Skip this to use DSN credentials
	--,ClientSecret='AKIAIWxxxxxxxxxxxxx' --Skip this to use DSN credentials
	--,UseCustomApp='True'	
)
--Uncomment below if you are using Schema file for cached metadata
--WITH (META='c:\somefolder\mws-query-meta.txt')</pre>
<div class="mceTemp"></div>
</li>
<li>Use above query for example and paste in Query editor while you Import Amazon MWS data.
<div id="attachment_3946" style="width: 952px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-soap-api-xml-web-service-advanced-options-sql.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3946" class="size-full wp-image-3946" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-soap-api-xml-web-service-advanced-options-sql.png" alt="Enter custom SQL to load SOAP Web Service Data in Power BI (ZappySys XML Driver)" width="942" height="713" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-soap-api-xml-web-service-advanced-options-sql.png 942w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-soap-api-xml-web-service-advanced-options-sql-300x227.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-soap-api-xml-web-service-advanced-options-sql-768x581.png 768w" sizes="(max-width: 942px) 100vw, 942px" /></a><p id="caption-attachment-3946" class="wp-caption-text">Enter custom SQL to load SOAP Web Service Data in Power BI (ZappySys XML Driver)</p></div></li>
<li>On the next screen select <strong>Windows Authentication<br />
</strong></p>
<div id="attachment_4860" style="width: 732px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/connect-amazon-mws-data-power-bi-windows-authentication.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4860" class="size-full wp-image-4860" src="https://zappysys.com/blog/wp-content/uploads/2018/09/connect-amazon-mws-data-power-bi-windows-authentication.png" alt="Select Authentication for Amazon MWS connection in Power BI data load" width="722" height="391" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/connect-amazon-mws-data-power-bi-windows-authentication.png 722w, https://zappysys.com/blog/wp-content/uploads/2018/09/connect-amazon-mws-data-power-bi-windows-authentication-300x162.png 300w" sizes="(max-width: 722px) 100vw, 722px" /></a><p id="caption-attachment-4860" class="wp-caption-text">Select Authentication for Amazon MWS connection in Power BI data load</p></div></li>
<li>Once data is imported you can use dataset to build your dashboard
<div id="attachment_4859" style="width: 1211px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/load-amazon-mws-data-in-power-bi-dataset-report.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4859" class="size-full wp-image-4859" src="https://zappysys.com/blog/wp-content/uploads/2018/09/load-amazon-mws-data-in-power-bi-dataset-report.png" alt="Load Amazon MWS data in Power BI - Create Amazon Sales Dashboard" width="1201" height="609" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/load-amazon-mws-data-in-power-bi-dataset-report.png 1201w, https://zappysys.com/blog/wp-content/uploads/2018/09/load-amazon-mws-data-in-power-bi-dataset-report-300x152.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/load-amazon-mws-data-in-power-bi-dataset-report-768x389.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/09/load-amazon-mws-data-in-power-bi-dataset-report-1024x519.png 1024w" sizes="(max-width: 1201px) 100vw, 1201px" /></a><p id="caption-attachment-4859" class="wp-caption-text">Load Amazon MWS data in Power BI &#8211; Create Amazon Sales Dashboard</p></div></li>
</ol>
<h2>Using Pagination in Amazon MWS API calls</h2>
<p>Now let&#8217;s look at how to query certain API which allows paginated response. Pagination is <a href="https://docs.developer.amazonservices.com/en_US/dev_guide/DG_NextToken.html" target="_blank" rel="noopener">fully explained here</a>. Certain APIs like ListOrders , ListOrderItems, ListInboundShipments, ListInventorySupply, GetFullfillmentOrder and few more supports Pagination.</p>
<p>When you call Paginated response next request changes Action with <strong>ByNextToken</strong> suffix. For example to get orders call <a href="https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_ListOrders.html" target="_blank" rel="noopener">ListOrders</a> and next request will be <a href="https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_ListOrdersByNextToken.html" target="_blank" rel="noopener">ListOrdersByNextToken</a></p>
<p>MWS API has multiple pagination patterns so based on which action you calling you have to use correct SQL parameters.</p>
<div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF7B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">Amazon MWS API has strict throttling limits so make sure you call API accordingly. Calling same API too fast may result in throttling error. You can use <strong>WaitTimeMs</strong> option to wait after each API call so you do face throttling limit. Refer to MWS API help pages to see exact limit. </div></div>
<h3>Using NextToken for Pagination (ListOrders Example)</h3>
<p>Many MWS API returns NextToken attribute in the response which you can pass in the body of next request until no more NextToken found in the response.</p>
<p>Check below example query for <a href="https://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_ListOrders.html" target="_blank" rel="noopener">ListOrders</a> API. We have enabled pagination by supplying few extra parameters in our original SQL Query.</p><pre class="crayon-plain-tag">SELECT * FROM $
WITH(
	 ElementsToTreatAsArray='Order'
	,Src='https://mws.amazonservices.com/Orders/2013-09-01'
	,Filter='$.ListOrders[$tag$]Response.ListOrders[$tag$]Result.Orders.Order[*]'
	,RequestData='Action=ListOrders[$tag$]&amp;SellerId=A10JBWAX563WMC&amp;CreatedAfter=2018-09-01T04%3A00%3A00Z&amp;MarketplaceId.Id.1=ATVPDKIKX0DER'
	,RequestMethod='POST'
	,NextUrlAttributeOrExpr='$.ListOrders[$tag$]Response.ListOrders[$tag$]Result.NextToken'
	,NextUrlSuffix='&amp;NextToken=&lt;%nextlink_encoded%&gt;'
	,WaitTimeMs=300 -- slow down to avoid throttling
	,HasDifferentNextPageInfo='True'
	,EnablePageTokenForBody='True'
	,PagePlaceholders='body=|ByNextToken;filter=|ByNextToken'
	--,DataConnectionType='OAuth'
	--,ScopeSeparator='{space}'
	--,ServiceProvider='AmazonMWS'
	--,ClientId='AKIxxxxxx'
	--,ClientSecret='AKIxxxxxx'
	--,UseCustomApp='True'	
)
--Uncomment below if you are using Schema file for cached metadata 
--WITH (META='c:\somefolder\mws-query-meta.txt')</pre><p>
&nbsp;</p>
<h3>Using NextToken with operations that return HasNext / MoreResultsAvailable</h3>
<p>Some API has attribute which tells you to stop pagination (e.g. HasNext). Check below example query for <a href="https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportRequestList.html">GetReportRequestList</a>. We have enabled pagination by supplying few extra parameters in SQL Query.</p><pre class="crayon-plain-tag">SELECT * FROM $
WITH(
	 ElementsToTreatAsArray='Product,ReportRequestInfo'
	,Src='https://mws.amazonservices.com'
	--,DataConnectionType='OAuth'
	--,ScopeSeparator='{space}'
	--,ServiceProvider='AmazonMWS'
	--,ClientId='Axxxxxxxxxxxxxx' --This will come from connection if you comment
	--,ClientSecret='Bxxxxxxxxxxxxxxxxx' --This will come from connection you comment
	--,UseCustomApp='True'
	,Filter='$.GetReportRequestList[$tag$]Response.GetReportRequestList[$tag$]Result.ReportRequestInfo[*]'
	,RequestData='Action=GetReportRequestList[$tag$]&amp;Merchant=A10xxxxxxxxxxxxxxxx'
	,RequestMethod='POST'
	,NextUrlAttributeOrExpr='$.GetReportRequestList[$tag$]Response.GetReportRequestList[$tag$]Result.NextToken'
	,NextUrlEndIndicator='false'
	,StopIndicatorAttributeOrExpr='$.GetReportRequestList[$tag$]Response.GetReportRequestList[$tag$]Result.HasNext'
	,NextUrlSuffix='&amp;NextToken=&lt;%nextlink_encoded%&gt;'
	,HasDifferentNextPageInfo='True'
	,EnablePageTokenForBody='True'
	,PagePlaceholders='body=|ByNextToken;filter=|ByNextToken'
)
--Uncomment below if you are using Schema file for cached metadata 
--WITH (META='c:\somefolder\mws-query-meta.txt')</pre><p>
Some API calls return slightly different response so rather than HasNext attribute you will see MoreResultsAvailable. In that case change StopIndicatorAttributeOrExpr property to use MoreResultsAvailable property.</p>
<h3>Properties you need to change for pagination</h3>
<p>Now let&#8217;s look at properties which need to be changed to support 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">NextUrlAttributeOrExpr</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 EnablePageTokenForBody=true to use Extracted token in Body.</td>
</tr>
<tr>
<td style="width: 14.5161%">StopIndicatorAttributeOrExpr</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 HasNext attribute value. 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.</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 enables use of [$tag$] inside body to use different RequestBody values of first request and second onwards requests.</td>
</tr>
</tbody>
</table>
</div>
<p>Here is the preview of MWS API query output with Pagination Attributes.</p>
<div id="attachment_4855" style="width: 818px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-pagination-example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4855" class="size-full wp-image-4855" src="https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-pagination-example.png" alt="Amazon MWS API Pagination Example - Preview SQL Query Result" width="808" height="660" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-pagination-example.png 808w, https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-pagination-example-300x245.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/amazon-mws-api-pagination-example-768x627.png 768w" sizes="(max-width: 808px) 100vw, 808px" /></a><p id="caption-attachment-4855" class="wp-caption-text">Amazon MWS API Pagination Example &#8211; Preview SQL Query Result</p></div>
<h2></h2>
<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> (You must need ODBC PowerPack <strong>v1.1.1</strong> or higher). However reading data from 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 Driver for this step. If CSV data is returned then we must use CSV Driver rather than XML Driver.</li>
</ol>
<p>Now lets see how to get this 3 steps done in Power BI. In this example, We will get Inventory by calling <strong>_GET_MERCHANT_LISTINGS_DATA_</strong> report type.</p>
<ol>
<li>Create a directory c:\temp</li>
<li>Create new <strong>ZappySys XML Driver DSN</strong> (User DSN) using same steps we described before. Lets name this DSN as <strong>ZAPPY-MWS-API-XML</strong></li>
<li>Create new <strong>ZappySys CSV Driver DSN</strong>  (User DSN) using same steps we described before (Except the Driver Type should be <a href="https://zappysys.com/products/odbc-powerpack/odbc-csv-rest-api-driver/" target="_blank" rel="noopener">ZappySys CSV Driver</a>). Lets name this DSN as <strong>ZAPPY-MWS-API-CSV</strong></li>
<li>Once you done with ODBC DSN Setup open or create new Power BI Project.</li>
<li>Click on Create Source &gt; from Blank Query
<div id="attachment_6955" style="width: 233px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-new-data-source-from-query.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6955" class="size-full wp-image-6955" src="https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-new-data-source-from-query.png" alt="Power BI - Create New Data source from Query (M Script)" width="223" height="487" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-new-data-source-from-query.png 223w, https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-new-data-source-from-query-137x300.png 137w" sizes="(max-width: 223px) 100vw, 223px" /></a><p id="caption-attachment-6955" class="wp-caption-text">Power BI &#8211; Create New Data source from Query (M Script)</p></div></li>
<li>When Query Editor Shows up click on Advanced Editor and paste below code (Its <a href="https://docs.microsoft.com/en-us/powerquery-m/power-query-m-reference">Power BI M Language</a>). If you are unsure how to write Power BI check <a href="https://docs.microsoft.com/en-us/powerquery-m/quick-tour-of-the-power-query-m-formula-language" target="_blank" rel="noopener">this tutorial</a>.<br />
Replace MarketPlaceId and Seller ID in the script (i.e. A1xxxxxx and A2xxxxxx ). See we are using <strong>ReportType=_GET_MERCHANT_LISTINGS_DATA_</strong>  but you can use any valid report ID <a href="https://docs.developer.amazonservices.com/en_UK/reports/Reports_RequestReport.html" target="_blank" rel="noopener">from here</a>. You can also pass other optional parameter available for each report Type (e.g. StartDate and EndDate)</p>
<div id="attachment_6956" style="width: 826px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-query-editor-m-language-expression.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6956" class="size-full wp-image-6956" src="https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-query-editor-m-language-expression.png" alt="Edit Power BI Query Script - Use custom M Language Script to import data from ODBC or other Relational" width="816" height="625" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-query-editor-m-language-expression.png 816w, https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-query-editor-m-language-expression-300x230.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-query-editor-m-language-expression-768x588.png 768w" sizes="(max-width: 816px) 100vw, 816px" /></a><p id="caption-attachment-6956" class="wp-caption-text">Edit Power BI Query Script &#8211; Use custom M Language Script to import data from ODBC or other Relational</p></div>
<p><strong>Power BI M Script (New Driver) &#8211; Import MWS Custom Report in Power BI<br />
</strong></p><pre class="crayon-plain-tag">//////////////////////////////////////////////////////////////////////////
// Change _GET_MERCHANT_LISTINGS_DATA_ to something else if you need different report type (all 3 steps) -- https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
// Replace MarketplaceId in all 3 steps (i.e for USA use ATVPDKIKX0DER) --https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Endpoints.html
// Replace SellerId in all 3 steps
// Remove or Change CreatedAfter in first step (or use CreatedBefore parameter instread of CreatedAfter)
//////////////////////////////////////////////////////////////////////////

let
    sql="SELECT s3.* FROM $
WITH(
Src='https://mws.amazonservices.com/Reports/2009-01-01',RequestMethod='POST'
,RequestData='Action=RequestReport&amp;ReportType=_GET_MERCHANT_LISTINGS_DATA_&amp;MarketplaceId=ATVPDKIKX0DER&amp;SellerId=Axxxxxxxxxx&amp;CreatedAfter=2017-12-31T04%3A00%3A00Z'
,IncludeParentColumns='False'
,EnableRawOutputModeSingleRow='True'
,RawOutputFilterExpr='//*[local-name()=""ReportRequestId""]' 
,RawOutputDataRowTemplate='{ReportRequestId:""[$1]""}' 
,RawOutputExtractMode='Xml' 
,WaitTimeMs=5000
,Meta='[{""Name"": ""ReportRequestId"",""Type"": ""Int64""}]'
,Alias='s1'

,Join1_alias='s2'	
,Join1_Src='https://mws.amazonservices.com/Reports/2009-01-01',Join1_RequestMethod='POST'
,Join1_RequestData='Action=GetReportRequestList&amp;ReportRequestIdList.Id.1=[$s1.ReportRequestId$]&amp;MarketplaceId=ATVPDKIKX0DER&amp;SellerId=Axxxxxxxxxx'
,Join1_EnableRawOutputModeSingleRow='True'
,Join1_RawOutputFilterExpr='//*[local-name()=""ReportProcessingStatus""]||//*[local-name()=""GeneratedReportId""]' 
,Join1_RawOutputDataRowTemplate='{ReportProcessingStatus:""[$1]"",GeneratedReportId:""[$2]""}' 
,Join1_RawOutputExtractMode='Xml' 
,Join1_EnableStatusCheck='True', 
,Join1_StatucCheckMaxWaitSeconds=300,
,Join1_StatucCheckIterationWaitSeconds=25,
,Join1_StatusSuccessValue='_DONE_'
,Join1_StatusFailedValue='_DONE_NO_DATA_|_CANCELLED_'

,Join2_Alias='s3'
,Join2_Src='https://mws.amazonservices.com/Reports/2009-01-01',Join2_RequestMethod='POST'
,Join2_RequestData='Action=GetReport&amp;ReportId=[$s2.GeneratedReportId$]&amp;MarketplaceId=ATVPDKIKX0DER&amp;SellerId=Axxxxxxxxxx'	
,Join2_ColumnDelimiter='{TAB}'
,Join2_ResponseCharset='Windows-1252'	 
,Join2_EnableStatusCheck='False' 
,Join2_EnableRawOutputModeSingleRow='False'
)",
    Source = Odbc.Query("dsn=ZS-AMAZON-MWS-CSV", sql)
in
    Source</pre><p>
&nbsp;</p>
<p><strong></p>
<p>Power BI M Script (Old Driver) &#8211; v1.1.2 or older</p>
<p></strong>If you are using older version &#8211; v1.1.2 or older then use below script.</p><pre class="crayon-plain-tag">/*
 All Copy Rights Reserved - ZappySys LLC. Feel free to share this snippet as long as you retain copyrights notice. https://zappysys.com
 Description:  This snippet will call Amazon MWS API to generate Inventory Report (Its multi step process - Job Style API call. First 2 calls gets XML data and Last call CSV data)
*/

let
    //NOTE: In Power BI M Language... each declare is separated by comma... 
    //variable can be any type.. string, number, table, list , record, function reference. More info: https://docs.microsoft.com/en-us/powerquery-m/power-query-m-reference
    /* 
    let 
        var1=expression, var2=expression,  ... varN=expression
    in
        varN   //return some variable
    */

    //define some common variables

    MarketplaceId="A1xxxxxx",
    SellerId="A2xxxxxxxxxx",

    //////////////////////////////////////////////////
    /*Step-1 : Send new report request  - Must use XML Driver */
    //////////////////////////////////////////////////

    Step1Sql="SELECT ReportRequestId FROM $
WITH(
    --Src='c:\temp\reportrequest.txt'
    Src='https://mws.amazonservices.com/Reports/2009-01-01'
	--,ElementsToTreatAsArray='Product'
	,Filter='$.RequestReportResponse.RequestReportResult.ReportRequestInfo'
	,RequestData='Action=RequestReport&amp;ReportType=_GET_MERCHANT_LISTINGS_DATA_&amp;MarketplaceId=" &amp; MarketplaceId &amp; "&amp;SellerId=" &amp; SellerId &amp; "'
	,RequestMethod='POST'
	,WaitTimeMs='300'
	,IncludeParentColumns='False'
	,CachingMode='All'
	,CacheStorage='File'
	,CacheFileLocation='c:\temp\mws-step1.cache'
	,CacheEntryTtl=300
	,Meta='[{""Name"": ""ReportRequestId"",""Type"": ""Int64""}]'
)",
    Source1 = Odbc.Query("dsn=ZAPPY-MWS-API-XML", Step1Sql),
    ReportRequestId= Source1{0}[ReportRequestId],
    
    //NOTE: Technically we need to implement status check loop Wait for few seconds before 
    //Increase this if you get ERROR in 3rd step
    BlankTextForDelay = Function.InvokeAfter(()=&gt;"", #duration(0,0,0,15)), //define delay - You must use it somewhere inorder to invoke delay

    //////////////////////////////////////////////////
    /*Step-2 : Get report id - once report is done  - Must use XML Driver */
    //////////////////////////////////////////////////
    Step2Sql=BlankTextForDelay &amp; "SELECT *  FROM $
WITH(
    --Src='c:\temp\report-status.xml'
    Src='https://mws.amazonservices.com/Reports/2009-01-01'
	,ElementsToTreatAsArray='ReportRequestInfo'
	,Filter='$.GetReportRequestListResponse.GetReportRequestListResult.ReportRequestInfo'
	,RequestData='Action=GetReportRequestList&amp;ReportRequestIdList.Id.1=" &amp;  ReportRequestId &amp; "&amp;MarketplaceId=" &amp; MarketplaceId &amp; "&amp;SellerId=" &amp; SellerId &amp; "'
	,RequestMethod='POST'
	,WaitTimeMs='300'
	,IncludeParentColumns='False'
	,CachingMode='All'
	,CacheStorage='File'
	,CacheFileLocation='c:\temp\mws-step2.cache'
	,CacheEntryTtl=15
	,Meta='[{""Name"": ""ReportProcessingStatus"",""Type"": ""String"", Length: 100},{""Name"": ""GeneratedReportId"",""Type"": ""Int64""}]'
)",    
    Source2 = Odbc.Query("dsn=ZAPPY-MWS-API-XML", Step2Sql),
    ReportId= Source2{0}[GeneratedReportId],


    //////////////////////////////////////////////////
    /*Step-3 : Get report data in CSV format - Must use CSV Driver */
    //////////////////////////////////////////////////
    Step3Sql="SELECT * FROM $
WITH(
       --Src='c:\temp\inventory.csv.txt'
	 Src='https://mws.amazonservices.com/Reports/2009-01-01'
	,RequestData='Action=GetReport&amp;ReportId=" &amp;  ReportId &amp; "&amp;MarketplaceId=" &amp; MarketplaceId &amp; "&amp;SellerId=" &amp; SellerId &amp; "'
	,RequestMethod='POST'
	,WaitTimeMs='300'
	,ColumnDelimiter='{TAB}'
	,CachingMode='All'
	,CacheStorage='File'
	,CacheFileLocation='c:\temp\mws-step3.cache'    
	,ResponseCharset='Windows-1252'	    
	)",    
    Source3 = Odbc.Query("dsn=AMAZON-MWS-CSV", Step3Sql)

in
    Source3  //return Source3 (i.e. Table type variable)</pre><p>
&nbsp;</li>
<li>Once done <strong>click OK</strong>.</li>
<li>You may be prompted few times to trust each Query we defined in M Script above. Also you may be prompted to select DSN Credentials (Just Select <strong>Windows Credentials</strong>)
<div id="attachment_6957" style="width: 592px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-native-database-query-warning.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6957" class="size-full wp-image-6957" src="https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-native-database-query-warning.png" alt="Power BI - Run Native Database Query Prompt" width="582" height="602" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-native-database-query-warning.png 582w, https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-native-database-query-warning-290x300.png 290w" sizes="(max-width: 582px) 100vw, 582px" /></a><p id="caption-attachment-6957" class="wp-caption-text">Power BI &#8211; Run Native Database Query Prompt</p></div></li>
<li>If you get prompted to select DSN Credentials then select as below (Click <strong>Windows</strong>).
<div id="attachment_4860" style="width: 732px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/connect-amazon-mws-data-power-bi-windows-authentication.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4860" class="size-full wp-image-4860" src="https://zappysys.com/blog/wp-content/uploads/2018/09/connect-amazon-mws-data-power-bi-windows-authentication.png" alt="Select Authentication for Amazon MWS connection in Power BI data load" width="722" height="391" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/connect-amazon-mws-data-power-bi-windows-authentication.png 722w, https://zappysys.com/blog/wp-content/uploads/2018/09/connect-amazon-mws-data-power-bi-windows-authentication-300x162.png 300w" sizes="(max-width: 722px) 100vw, 722px" /></a><p id="caption-attachment-4860" class="wp-caption-text">Select Authentication for Amazon MWS connection in Power BI data load</p></div></li>
<li>After few seconds (Depending on Delay we define in Script &#8211; default 15 sec) you will see data loaded.</li>
<li>Once data is loaded click Close &amp; Apply and it will close the query editor and we will see main designer where you can see Dataset and Fields we just created.
<div id="attachment_6958" style="width: 1013px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-amazon-mws-save-query-close-apply.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6958" class="size-full wp-image-6958" src="https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-amazon-mws-save-query-close-apply.png" alt="Loading Amazon MWS Reports data in Power BI (List Inventory Example using M Script)" width="1003" height="633" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-amazon-mws-save-query-close-apply.png 1003w, https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-amazon-mws-save-query-close-apply-300x189.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/power-bi-amazon-mws-save-query-close-apply-768x485.png 768w" sizes="(max-width: 1003px) 100vw, 1003px" /></a><p id="caption-attachment-6958" class="wp-caption-text">Loading Amazon MWS Reports data in Power BI (List Inventory Example using M Script)</p></div></li>
</ol>
<h2>Conclusion</h2>
<p>In this article, we saw how to build sales report by reading data from your Amazon Seller Account. We used simple SQL queries with ZappySys XML Driver to pull data from Amazon MWS API. <a href="https://zappysys.com/products/odbc-powerpack/">ZappySys ODBC PowerPack</a> makes it super easy to consume data from virtually any API (JSON / XML or CSV Web Services), no coding required. <a href="https://zappysys.com/products/odbc-powerpack/download/">Download here</a> to get started with ZappySys ODBC drivers.</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/import-amazon-mws-data-power-bi/">How to Import Amazon MWS data in Power BI</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to read NetSuite data in Power BI</title>
		<link>https://zappysys.com/blog/read-netsuite-data-power-bi/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 11 Aug 2018 17:29:14 +0000</pubDate>
				<category><![CDATA[Reporting - Microsoft Power BI]]></category>
		<category><![CDATA[XML File / SOAP API Driver]]></category>
		<category><![CDATA[NetSuite]]></category>
		<category><![CDATA[power bi]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[SoapUI]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=4613</guid>

					<description><![CDATA[<p>Introduction In our previous blog we discussed how to import REST / SOAP API data in Power BI. Now we will use that knowledge to read NetSuite data in Power BI (NetSuite CRM &#8211; SuiteTalk). We will use ZappySys XML Driver to call Search function in NetSuite SOAP API. If you are not familiar with SOAP [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-netsuite-data-power-bi/">How to read NetSuite data in Power BI</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 loading="lazy" 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="192" height="192" 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: 192px) 100vw, 192px" /></a>In our previous blog we discussed how to <a href="https://zappysys.com/blog/call-soap-api-power-bi-read-xml-web-service-data/" target="_blank" rel="noopener">import REST / SOAP API data in Power BI</a>. Now we will use that knowledge to <strong>read NetSuite data in Power BI (NetSuite CRM &#8211; SuiteTalk)</strong>. We will use ZappySys XML Driver to call Search function in NetSuite SOAP API. If you are not familiar with SOAP API concept then we highly recommend you read <a href="https://zappysys.com/blog/call-soap-api-power-bi-read-xml-web-service-data/" target="_blank" rel="noopener">previous blog post</a>. In this post we will use Power BI as an example App to consume NetSuite data but you can use steps listed in this article to load data in any other ODBC compliant ETL / reporting app (e.g. <a href="https://zappysys.com/blog/import-json-excel-load-file-rest-api/">Excel</a>, <a href="https://zappysys.com/blog/qlik-rest-connector-examples-read-json-xml-api/" target="_blank" rel="noopener">Qlik</a>, <a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/" target="_blank" rel="noopener">Informatica</a>, <a href="https://zappysys.com/blog/read-rest-api-using-ssrs-reports-call-json-xml-web-service/">SSRS</a>) or programming language (e.g. <a href="https://zappysys.com/blog/calling-rest-api-in-c/">C#</a>, <a href="https://zappysys.com/blog/connect-java-to-rest-api-json-soap-xml/">JAVA</a>, <a href="https://zappysys.com/blog/set-rest-python-client/">Python</a>) or <a href="https://zappysys.com/blog/import-rest-api-json-sql-server/">SQL Server (Linked Server)</a>.</p>
<p>We will look at each step in depth, how to enable SOAP Api access in NetSuite, How to register Application, how to configure NetSuite ODBC DSN, and finally how to load NetSuite data into Power BI dashboard.</p>
<p>So let&#8217;s get started. The approach listed in this article can be used to call other SOAP based API such as <a href="https://zappysys.com/blog/how-to-call-salesforce-rest-api-via-odbc-driver/" target="_blank" rel="noopener"><strong>Salesforce</strong></a>, <a href="https://zappysys.com/blog/get-data-from-workday-in-ssis-using-soap-or-rest-api/"><strong>Workday</strong></a>, <strong>SAP</strong>, Sage etc.</p>
<h2>Prerequisite</h2>
<p>Before you get started make sure following requirements are met.</p>
<ol>
<li>NetSuite CRM Login (UserID and Password)</li>
<li>Enable Web Service Feature in NetSuite</li>
<li>Obtain NetSuite Account ID</li>
<li>Obtain Application ID if you have created an App. Else Register new Netsuite Application and get Application ID</li>
<li>Download <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> (for SOAP / XML Driver)</li>
<li>Download <a href="https://powerbi.microsoft.com/en-us/downloads/" target="_blank" rel="noopener">Power BI Desktop</a> (FREE) if you have not already done it.</li>
</ol>
<h2><span id="What_is_NetSuite_CRM">What is NetSuite CRM?</span></h2>
<p>NetSuite is a CRM / ERP product. It gives you scalable cloud CRM / ERP solution targeted at high-growing, mid-sized businesses and large enterprises. It automates front- and back-office processes including: financial management, revenue management, fixed assets, order management, billing, and inventory management.</p>
<h2><span id="Getting_Started">Preparing for NetSuite WebService Call in Power BI</span></h2>
<p>For NetSuite API call we have to make sure certain settings and obtain Application ID and AccountID. So let&#8217;s get started.</p>
<div class="content_block" id="custom_post_widget-5058"><h3>How to enable NetSuite Web Service Feature</h3>
Before you call any NetSuite SOAP API (i.e. <strong>SuiteTask Web Service</strong>), First thing to get started with NetSuite SOAP API (i.e. ) is to enable Web Service Feature. Once you enable Web Service, you can programmatically access NetSuite data in your App (e.g. Power BI, Tableau, Informatica).

<a href="https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3419926.html" target="_blank" rel="noopener">Click this link</a> to see steps to enable Web Service Feature
<div id="attachment_4616" class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-enable-web-service-features-setup-option.png?ssl=1"><img loading="lazy" decoding="async" class="wp-image-4616 size-full" style="border: 0px; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.176) 0px 1px 2px;" src="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-enable-web-service-features-setup-option.png?resize=479%2C568&amp;ssl=1" sizes="(max-width: 479px) 100vw, 479px" srcset="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-enable-web-service-features-setup-option.png?w=479&amp;ssl=1 479w, https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-enable-web-service-features-setup-option.png?resize=253%2C300&amp;ssl=1 253w" alt="Enable NetSuite Web Service Feature (SuiteTalk API)" width="471" height="559" data-attachment-id="4616" data-permalink="https://zappysys.com/blog/read-netsuite-data-power-bi/netsuite-enable-web-service-features-setup-option/#main" data-orig-file="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-enable-web-service-features-setup-option.png?fit=479%2C568&amp;ssl=1" data-orig-size="479,568" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="netsuite-enable-web-service-features-setup-option" data-image-description="&lt;p&gt;Enable NetSuite Web Service Feature&lt;/p&gt; " data-medium-file="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-enable-web-service-features-setup-option.png?fit=253%2C300&amp;ssl=1" data-large-file="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-enable-web-service-features-setup-option.png?fit=479%2C568&amp;ssl=1" /></a>
<p class="wp-caption-text">Enable NetSuite Web Service Feature (SuiteTalk API)</p>

</div>
<h3><span id="Obtain_NetSuite_Account_ID">Obtain NetSuite Account ID</span></h3>
NetSuite Account ID is needed by Login API call. So perform following steps if you dont know account id.
<ol>
 	<li>Login to your NetSuite Portal</li>
 	<li>Click the <strong>Setup Tab</strong></li>
 	<li>In the drop-down click <strong>Integration</strong> &gt;  <strong>Web services preferences</strong></li>
 	<li>On that page you will find your Account ID (<strong>example account ID = TSTDRV1234567</strong> )</li>
</ol>
<div id="attachment_4620" class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/08/obtain-netsuite-accountid.png?ssl=1"><img loading="lazy" decoding="async" class="size-full wp-image-4620" style="border: 0px; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.176) 0px 1px 2px;" src="https://zappysys.com/blog/wp-content/uploads/2018/08/obtain-netsuite-accountid.png?resize=262%2C360&amp;ssl=1" sizes="(max-width: 262px) 100vw, 262px" srcset="https://zappysys.com/blog/wp-content/uploads/2018/08/obtain-netsuite-accountid.png?w=262&amp;ssl=1 262w, https://zappysys.com/blog/wp-content/uploads/2018/08/obtain-netsuite-accountid.png?resize=218%2C300&amp;ssl=1 218w" alt="Obtain NetSuite Account ID (Needed for Web Service Login)" width="254" height="349" data-attachment-id="4620" data-permalink="https://zappysys.com/blog/read-netsuite-data-power-bi/obtain-netsuite-accountid/#main" data-orig-file="https://zappysys.com/blog/wp-content/uploads/2018/08/obtain-netsuite-accountid.png?fit=262%2C360&amp;ssl=1" data-orig-size="262,360" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="obtain-netsuite-accountid" data-image-description="&lt;p&gt;Obtain NetSuite Account ID (Needed for Web Service Login)&lt;/p&gt; " data-medium-file="https://zappysys.com/blog/wp-content/uploads/2018/08/obtain-netsuite-accountid.png?fit=218%2C300&amp;ssl=1" data-large-file="https://zappysys.com/blog/wp-content/uploads/2018/08/obtain-netsuite-accountid.png?fit=262%2C360&amp;ssl=1" /></a>
<p class="wp-caption-text">Obtain NetSuite Account ID (Needed for Web Service Login)</p>

</div>
<h3><span id="Obtain_NetSuite_Application_ID">Obtain NetSuite Application ID</span></h3>
Once you have account ID now we need to get Application ID. For that follow these steps.
<ol>
 	<li>Login to your NetSuite Portal</li>
 	<li>Click the <strong>Setup Tab</strong></li>
 	<li>In the drop-down click <strong>Integration</strong> &gt;  <strong>Manage Integrations</strong></li>
 	<li>On that page you will find your existing Applications along with Account ID / Status (<strong>example Application ID = AE2EACFD-1234-1222-1111-12345544555</strong> )</li>
 	<li>If you don’t have any application created yet then just click on New.</li>
</ol>
<div id="attachment_4619" class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-obtain-application-for-soap-api-call.png?ssl=1"><img loading="lazy" decoding="async" class="size-full wp-image-4619" style="border: 0px; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.176) 0px 1px 2px;" src="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-obtain-application-for-soap-api-call.png?resize=660%2C293&amp;ssl=1" sizes="(max-width: 660px) 100vw, 660px" srcset="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-obtain-application-for-soap-api-call.png?w=660&amp;ssl=1 660w, https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-obtain-application-for-soap-api-call.png?resize=300%2C133&amp;ssl=1 300w" alt="Create new App / Get NetSuite Application ID" width="652" height="289" data-attachment-id="4619" data-permalink="https://zappysys.com/blog/read-netsuite-data-power-bi/netsuite-obtain-application-for-soap-api-call/#main" data-orig-file="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-obtain-application-for-soap-api-call.png?fit=660%2C293&amp;ssl=1" data-orig-size="660,293" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="netsuite-obtain-application-for-soap-api-call" data-image-description="&lt;p&gt;Create new App / Get NetSuite Application ID&lt;/p&gt; " data-medium-file="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-obtain-application-for-soap-api-call.png?fit=300%2C133&amp;ssl=1" data-large-file="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-obtain-application-for-soap-api-call.png?fit=660%2C293&amp;ssl=1" /></a>
<p class="wp-caption-text">Create new App / Get NetSuite Application ID</p>

</div>
<h3></h3></div>
<div class="content_block" id="custom_post_widget-5098"><h2>Understanding how NetSuite SOAP API Call works</h2>
In this section we will briefly understand how NetSuite SOAP API call works. When you use ZappySys Driver / Component it will take care many details for you but still you have to configure correct XML Body.

There are two steps involved before you can call any SOAP API in NetSuite.
<ol>
 	<li>Call <a href="https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3512617.html" target="_blank" rel="noopener">Login method</a> and extract JSESSIONID from response Cookie (This token expires after some time)</li>
 	<li>Call any other API (Pass obtained JSESSIONID token in Cookie header)</li>
</ol>
<h3>NetSuite Login Call</h3>
<strong>Request</strong>
<pre class="lang:default highlight:0 decode:true">POST https://webservices.netsuite.com/services/NetSuitePort_2017_1
Content-Type: text/xml;charset=UTF-8
SOAPAction: "login"
Accept-Encoding: gzip, deflate

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;soap:Header&gt;
    &lt;applicationInfo xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;applicationId&gt;xxxxxxxxxxxxxx&lt;/applicationId&gt;
    &lt;/applicationInfo&gt;
  &lt;/soap:Header&gt;
  &lt;soap:Body&gt;
    &lt;login xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;passport&gt;
        &lt;email xmlns="urn:core_2017_1.platform.webservices.netsuite.com"&gt;xxxxxxxxxxxxx&lt;/email&gt;
        &lt;password xmlns="urn:core_2017_1.platform.webservices.netsuite.com"&gt;xxxxxxxxxxxx&lt;/password&gt;
        &lt;account xmlns="urn:core_2017_1.platform.webservices.netsuite.com"&gt;TSTxxxxxxxxxxxxxxx&lt;/account&gt;
        &lt;role internalId="3" xmlns="urn:core_2017_1.platform.webservices.netsuite.com" /&gt;
      &lt;/passport&gt;
    &lt;/login&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;</pre>
<strong>Response</strong>

Notice JSESSIONID=6xI6xxxxxxxxx in the login call response below. This Session ID can be used to call next call. ZappySys HTTP Connection Manager configured with <a href="https://zappysys.com/blog/call-soap-rest-api-using-dynamic-token-ssis/" target="_blank" rel="noopener">Dynamic Token</a> option can extract Cookie and reuse it until its expired (1 hour by default).
<pre class="lang:default highlight:0 decode:true">HTTP/1.1 200 OK
Date: Wed, 03 Oct 2018 16:50:41 GMT
Content-Length: 1676
Content-Type: text/xml; charset=utf-8
X-N-OperationId: 777274f6-49c6-4883-bcd1-1d70df90d78e
Strict-Transport-Security: max-age=31536000
NS_RTIMER_COMPOSITE: 13633xxxxxxxxx:70617xxxxxxxxxxxxx36F6D:80
Set-Cookie: JSESSIONID=6xI61rdFt26pxxxxxxxxxxxxxxxqvJIMlu!-17981123445; path=/; secure; HttpOnly
Set-Cookie: NS_VER=2018.1.0; domain=webservices.netsuite.com; path=/
Set-Cookie: NS_ROUTING_VERSION=LAGGING; path=/
P3P: CP="CAO PSAa OUR BUS PUR"
Vary: User-Agent
Keep-Alive: timeout=10, max=990
Connection: Keep-Alive

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;soapenv:Header&gt;
    &lt;platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;platformMsgs:nsId&gt;WEBSERVICES_xxxxxxxxxxxxxxxxx_9fc719&lt;/platformMsgs:nsId&gt;
    &lt;/platformMsgs:documentInfo&gt;
  &lt;/soapenv:Header&gt;
  &lt;soapenv:Body&gt;
    &lt;loginResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;sessionResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
        &lt;ns1:status isSuccess="true" xmlns:ns1="urn:core_2017_1.platform.webservices.netsuite.com"/&gt;
        &lt;ns2:wsRoleList xmlns:ns2="urn:core_2017_1.platform.webservices.netsuite.com"&gt;
          &lt;ns2:wsRole&gt;
            &lt;ns2:role internalId="3"&gt;
              &lt;ns2:name&gt;Administrator&lt;/ns2:name&gt;
            &lt;/ns2:role&gt;
            &lt;ns2:isDefault&gt;false&lt;/ns2:isDefault&gt;
            &lt;ns2:isInactive&gt;false&lt;/ns2:isInactive&gt;
          &lt;/ns2:wsRole&gt;
          &lt;ns2:wsRole&gt;
            &lt;ns2:role internalId="15"&gt;
              &lt;ns2:name&gt;Employee Center&lt;/ns2:name&gt;
            &lt;/ns2:role&gt;
            &lt;ns2:isDefault&gt;false&lt;/ns2:isDefault&gt;
            &lt;ns2:isInactive&gt;false&lt;/ns2:isInactive&gt;
          &lt;/ns2:wsRole&gt;
      &lt;/sessionResponse&gt;
    &lt;/loginResponse&gt;
  &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;</pre>
&nbsp;
<h3>NetSuite API Call ( getAll method )</h3>
Now once you have JSESSIONID extracted you can pass it to call next API call as below. For example here is how to call <a href="https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3489077.html" target="_blank" rel="noopener"><strong>getAll</strong></a> method to obtain currency list and exchange rates. If you are not sure how to craft correct Request XML then use tool like <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/" target="_blank" rel="noopener">SoapUI</a>.

You can use NetSuite WSDL file <a href="http://www.netsuite.com/portal/developers/resources/suitetalk-documentation.shtml" target="_blank" rel="noopener">from here</a> and import it in <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/" target="_blank" rel="noopener">SoapUI</a>.

<a href="https://zappysys.com/blog/wp-content/uploads/2018/10/soapui-create-netsuite-soap-api-request-xml.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-5103" src="https://zappysys.com/blog/wp-content/uploads/2018/10/soapui-create-netsuite-soap-api-request-xml.png" alt="" width="523" height="386" srcset="https://zappysys.com/blog/wp-content/uploads/2018/10/soapui-create-netsuite-soap-api-request-xml.png 523w, https://zappysys.com/blog/wp-content/uploads/2018/10/soapui-create-netsuite-soap-api-request-xml-300x221.png 300w" sizes="(max-width: 523px) 100vw, 523px" /></a>

&nbsp;

<strong>Request</strong>

See how Cookie is passed for authentication purpose. Again you can pass this manually or use HTTP connection with <a href="https://zappysys.com/blog/call-soap-rest-api-using-dynamic-token-ssis/" target="_blank" rel="noopener">Dynamic Token</a> to pass it automatically along with each API call.
<pre class="lang:default highlight:0 decode:true">POST https://webservices.netsuite.com/services/NetSuitePort_2017_1
Content-Type: text/xml;charset=UTF-8
SOAPAction: "getAll"
Cookie: JSESSIONID=6xI61rxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxMlu!-1798141234
Accept-Encoding: gzip, deflate

&lt;soapenv:Envelope 
   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
   xmlns:urn="urn:messages_2018_1.platform.webservices.netsuite.com" 
   xmlns:urn1="urn:core_2018_1.platform.webservices.netsuite.com"&gt;
   &lt;soapenv:Body&gt;
      &lt;urn:getAll&gt;
         &lt;record recordType="currency"/&gt; 
      &lt;/urn:getAll&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;</pre>
<strong>Response</strong>
<pre class="lang:default highlight:0 decode:true">HTTP/1.1 200 OK
Date: Wed, 03 Oct 2018 16:50:42 GMT
Content-Length: 9648
Content-Type: text/xml; charset=utf-8
X-N-OperationId: 1b2989e4-b930-4a72-b471-00a8e131dfd4
NS_RTIMER_COMPOSITE: 21403xxxxxx:706172746E65xxxxxxxxxxxx6F6D:80
Strict-Transport-Security: max-age=31536000
P3P: CP="CAO PSAa OUR BUS PUR"
Vary: User-Agent

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;soapenv:Header&gt;
    &lt;platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;platformMsgs:nsId&gt;WEBSERVICES_TSTDRV1439151_100320189871507121000128715_6ae8e8&lt;/platformMsgs:nsId&gt;
    &lt;/platformMsgs:documentInfo&gt;
  &lt;/soapenv:Header&gt;
  &lt;soapenv:Body&gt;
    &lt;getAllResponse xmlns="urn:messages_2018_1.platform.webservices.netsuite.com"&gt;
      &lt;platformCore:getAllResult xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"&gt;
        &lt;platformCore:status isSuccess="true" /&gt;
        &lt;platformCore:totalRecords&gt;11&lt;/platformCore:totalRecords&gt;
        &lt;platformCore:recordList&gt;
          &lt;platformCore:record internalId="1" xsi:type="listAcct:Currency" xmlns:listAcct="urn:accounting_2017_1.lists.webservices.netsuite.com"&gt;
            &lt;listAcct:name&gt;USD&lt;/listAcct:name&gt;
            &lt;listAcct:symbol&gt;USD&lt;/listAcct:symbol&gt;
            &lt;listAcct:isBaseCurrency&gt;true&lt;/listAcct:isBaseCurrency&gt;
            &lt;listAcct:isInactive&gt;false&lt;/listAcct:isInactive&gt;
            &lt;listAcct:overrideCurrencyFormat&gt;false&lt;/listAcct:overrideCurrencyFormat&gt;
            &lt;listAcct:displaySymbol&gt;$&lt;/listAcct:displaySymbol&gt;
            &lt;listAcct:symbolPlacement&gt;_beforeNumber&lt;/listAcct:symbolPlacement&gt;
            &lt;listAcct:locale&gt;_unitedStatesEnglish&lt;/listAcct:locale&gt;
            &lt;listAcct:formatSample&gt;$1,234.56&lt;/listAcct:formatSample&gt;
            &lt;listAcct:exchangeRate&gt;1.0&lt;/listAcct:exchangeRate&gt;
            &lt;listAcct:fxRateUpdateTimezone&gt;_americaNewYork&lt;/listAcct:fxRateUpdateTimezone&gt;
            &lt;listAcct:currencyPrecision&gt;_two&lt;/listAcct:currencyPrecision&gt;
          &lt;/platformCore:record&gt;
          &lt;platformCore:record internalId="2" xsi:type="listAcct:Currency" xmlns:listAcct="urn:accounting_2017_1.lists.webservices.netsuite.com"&gt;
            &lt;listAcct:name&gt;GBP&lt;/listAcct:name&gt;
            &lt;listAcct:symbol&gt;GBP&lt;/listAcct:symbol&gt;
            &lt;listAcct:isBaseCurrency&gt;true&lt;/listAcct:isBaseCurrency&gt;
            &lt;listAcct:isInactive&gt;false&lt;/listAcct:isInactive&gt;
            &lt;listAcct:overrideCurrencyFormat&gt;false&lt;/listAcct:overrideCurrencyFormat&gt;
            &lt;listAcct:displaySymbol&gt;£&lt;/listAcct:displaySymbol&gt;
            &lt;listAcct:symbolPlacement&gt;_beforeNumber&lt;/listAcct:symbolPlacement&gt;
            &lt;listAcct:locale&gt;_unitedKingdomEnglish&lt;/listAcct:locale&gt;
            &lt;listAcct:formatSample&gt;£1,234.56&lt;/listAcct:formatSample&gt;
            &lt;listAcct:exchangeRate&gt;1.33165497&lt;/listAcct:exchangeRate&gt;
            &lt;listAcct:fxRateUpdateTimezone&gt;_americaNewYork&lt;/listAcct:fxRateUpdateTimezone&gt;
            &lt;listAcct:currencyPrecision&gt;_two&lt;/listAcct:currencyPrecision&gt;
          &lt;/platformCore:record&gt;
          &lt;platformCore:record internalId="3" xsi:type="listAcct:Currency" xmlns:listAcct="urn:accounting_2017_1.lists.webservices.netsuite.com"&gt;
            &lt;listAcct:name&gt;CAD&lt;/listAcct:name&gt;
            &lt;listAcct:symbol&gt;CAD&lt;/listAcct:symbol&gt;
            &lt;listAcct:isBaseCurrency&gt;true&lt;/listAcct:isBaseCurrency&gt;
            &lt;listAcct:isInactive&gt;false&lt;/listAcct:isInactive&gt;
            &lt;listAcct:overrideCurrencyFormat&gt;false&lt;/listAcct:overrideCurrencyFormat&gt;
            &lt;listAcct:displaySymbol&gt;$&lt;/listAcct:displaySymbol&gt;
            &lt;listAcct:symbolPlacement&gt;_beforeNumber&lt;/listAcct:symbolPlacement&gt;
            &lt;listAcct:locale&gt;_canadaEnglish&lt;/listAcct:locale&gt;
            &lt;listAcct:formatSample&gt;$1,234.56&lt;/listAcct:formatSample&gt;
            &lt;listAcct:exchangeRate&gt;0.76457273&lt;/listAcct:exchangeRate&gt;
            &lt;listAcct:fxRateUpdateTimezone&gt;_americaNewYork&lt;/listAcct:fxRateUpdateTimezone&gt;
            &lt;listAcct:currencyPrecision&gt;_two&lt;/listAcct:currencyPrecision&gt;
          &lt;/platformCore:record&gt;
        &lt;/platformCore:recordList&gt;
      &lt;/platformCore:getAllResult&gt;
    &lt;/getAllResponse&gt;
  &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;</pre>
<h3>NetSuite Search API (Pagination Example)</h3>
Now let's look at more complex API calls where Pagination is needed. For example when you call search API to pull data from specific table (e.g. Account) you need to loop through multiple responses until all records are consumed.

<strong>Request (Page-1)</strong>
<pre class="lang:default highlight:0 decode:true">POST https://webservices.netsuite.com/services/NetSuitePort_2017_1
Content-Type: text/xml; charset=utf-8
SOAPAction: "search"
Cookie: JSESSIONID=BKQ7xxxxxxxxxxxx4Ug!-995xxxxxx
Accept-Encoding: gzip, deflate

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;soap:Header&gt;
    &lt;applicationInfo xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;applicationId&gt;xxxxxxxxxxxxxxx&lt;/applicationId&gt;
    &lt;/applicationInfo&gt;
    &lt;searchPreferences xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;pageSize&gt;50&lt;/pageSize&gt;
    &lt;/searchPreferences&gt;
  &lt;/soap:Header&gt;
  &lt;soap:Body&gt;
    &lt;search xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;searchRecord xmlns:q1="urn:accounting_2017_1.lists.webservices.netsuite.com" xsi:type="q1:AccountSearch"&gt;
        &lt;q1:basic&gt;
          &lt;description operator="doesNotContain" xmlns="urn:common_2017_1.platform.webservices.netsuite.com"&gt;
            &lt;searchValue xmlns="urn:core_2017_1.platform.webservices.netsuite.com"&gt;x&lt;/searchValue&gt;
          &lt;/description&gt;
          &lt;name operator="contains" xmlns="urn:common_2017_1.platform.webservices.netsuite.com"&gt;
            &lt;searchValue xmlns="urn:core_2017_1.platform.webservices.netsuite.com"&gt;a&lt;/searchValue&gt;
          &lt;/name&gt;
        &lt;/q1:basic&gt;
      &lt;/searchRecord&gt;
    &lt;/search&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;</pre>
&nbsp;

<strong>Response (Page-1)</strong>

In below response notice 2 things. SearchId is like a cursor id which you have to pass for each page you request after first page. And you can stop looping after 4th page based on totalPages count.

<strong>platformCore:searchId</strong> = WEBSERVICES_ABCD_12345-xxxxxxxxx
<strong>platformCore:totalPages</strong> = 4
<pre class="lang:default highlight:0 decode:true">HTTP/1.1 200 OK
Date: Wed, 03 Oct 2018 18:40:33 GMT
Content-Length: 49266
Content-Type: text/xml; charset=utf-8
X-N-OperationId: c1e79336-63b7-4eb7-989e-5c3d24c56891
NS_RTIMER_COMPOSITE: 118xxxxxxxx:70617xxxxxxxxxxxxxxxxxxxxxD:80
Strict-Transport-Security: max-age=31536000
P3P: CP="CAO PSAa OUR BUS PUR"
Vary: User-Agent

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;soapenv:Header&gt;
    &lt;platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;platformMsgs:nsId&gt;WEBSERVICES_ABCD_12345-xxxxxxxxx&lt;/platformMsgs:nsId&gt;
    &lt;/platformMsgs:documentInfo&gt;
  &lt;/soapenv:Header&gt;
  &lt;soapenv:Body&gt;
    &lt;searchResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;platformCore:searchResult xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"&gt;
        &lt;platformCore:status isSuccess="true" /&gt;
        &lt;platformCore:totalRecords&gt;193&lt;/platformCore:totalRecords&gt;
        &lt;platformCore:pageSize&gt;50&lt;/platformCore:pageSize&gt;
        &lt;platformCore:totalPages&gt;4&lt;/platformCore:totalPages&gt;
        &lt;platformCore:pageIndex&gt;1&lt;/platformCore:pageIndex&gt;
        &lt;platformCore:searchId&gt;WEBSERVICES_ABCD_12345-xxxxxxxxx&lt;/platformCore:searchId&gt;
        &lt;platformCore:recordList&gt;
          &lt;platformCore:record internalId="1" xsi:type="listAcct:Account" xmlns:listAcct="urn:accounting_2017_1.lists.webservices.netsuite.com"&gt;
            &lt;listAcct:acctType&gt;_bank&lt;/listAcct:acctType&gt;
            &lt;listAcct:acctNumber&gt;1111&lt;/listAcct:acctNumber&gt;
            &lt;listAcct:acctName&gt;Checking&lt;/listAcct:acctName&gt;
            &lt;listAcct:includeChildren&gt;false&lt;/listAcct:includeChildren&gt;
            &lt;listAcct:currency internalId="1"&gt;
              &lt;platformCore:name&gt;USD&lt;/platformCore:name&gt;
            &lt;/listAcct:currency&gt;
            &lt;listAcct:generalRate&gt;_current&lt;/listAcct:generalRate&gt;
            &lt;listAcct:parent internalId="246"&gt;
              &lt;platformCore:name&gt;xxxxxxxxxxxxxxxxxxx&lt;/platformCore:name&gt;
            &lt;/listAcct:parent&gt;
            &lt;listAcct:cashFlowRate&gt;_average&lt;/listAcct:cashFlowRate&gt;
            &lt;listAcct:description&gt;Checking&lt;/listAcct:description&gt;
            &lt;listAcct:isInactive&gt;false&lt;/listAcct:isInactive&gt;
            &lt;listAcct:inventory&gt;false&lt;/listAcct:inventory&gt;
            &lt;listAcct:eliminate&gt;false&lt;/listAcct:eliminate&gt;
            &lt;listAcct:revalue&gt;true&lt;/listAcct:revalue&gt;
          &lt;/platformCore:record&gt;
          &lt;platformCore:record internalId="2" xsi:type="listAcct:Account" xmlns:listAcct="urn:accounting_2017_1.lists.webservices.netsuite.com"&gt;
            &lt;listAcct:acctType&gt;_bank&lt;/listAcct:acctType&gt;
            &lt;listAcct:acctNumber&gt;22222&lt;/listAcct:acctNumber&gt;
            &lt;listAcct:acctName&gt;Savings&lt;/listAcct:acctName&gt;
            &lt;listAcct:includeChildren&gt;false&lt;/listAcct:includeChildren&gt;
            &lt;listAcct:currency internalId="1"&gt;
              &lt;platformCore:name&gt;USD&lt;/platformCore:name&gt;
            &lt;/listAcct:currency&gt;
            &lt;listAcct:generalRate&gt;_current&lt;/listAcct:generalRate&gt;
            &lt;listAcct:parent internalId="246"&gt;
              &lt;platformCore:name&gt;yyyyyyyyy&lt;/platformCore:name&gt;
            &lt;/listAcct:parent&gt;
            &lt;listAcct:cashFlowRate&gt;_average&lt;/listAcct:cashFlowRate&gt;
            &lt;listAcct:description&gt;Savings&lt;/listAcct:description&gt;
            &lt;listAcct:isInactive&gt;false&lt;/listAcct:isInactive&gt;
            &lt;listAcct:inventory&gt;false&lt;/listAcct:inventory&gt;
            &lt;listAcct:eliminate&gt;false&lt;/listAcct:eliminate&gt;
            &lt;listAcct:revalue&gt;true&lt;/listAcct:revalue&gt;
          &lt;/platformCore:record&gt;
          .........
          .........
          .........
          .........		  
        &lt;/platformCore:recordList&gt;
      &lt;/platformCore:searchResult&gt;
    &lt;/searchResponse&gt;
  &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;</pre>
&nbsp;

<strong>Request (Page-2 and onwards)</strong>

Here is the second page request. Notice few things here. In heraders we are now sending <strong>SOAPAction: "searchMoreWithId"</strong> rather than <strong>"search"</strong>.  Also our SOAP Body is also different compared to first page request. Now we only sending <strong>pageIndex</strong> we want to fetch and <strong>searchId</strong>. We have also change <strong>&lt;search&gt;</strong> tag with <strong>&lt;searchMoreWithId&gt;</strong> under Body.
<pre class="lang:default decode:true">POST https://webservices.netsuite.com/services/NetSuitePort_2017_1
Content-Type: text/xml; charset=utf-8
SOAPAction: "searchMoreWithId"
Cookie: JSESSIONID=BKQ7xxxxxxxxxxxx4Ug!-995xxxxxx
Accept-Encoding: gzip, deflate

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;soap:Header&gt;
    &lt;applicationInfo xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;applicationId&gt;xxxxxxxxxxxxxxxxxx&lt;/applicationId&gt;
    &lt;/applicationInfo&gt;
    &lt;searchPreferences xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;pageSize&gt;50&lt;/pageSize&gt;
    &lt;/searchPreferences&gt;
  &lt;/soap:Header&gt;
  &lt;soap:Body&gt;
    &lt;searchMoreWithId xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;searchId&gt;WEBSERVICES_ABCD_12345-xxxxxxxxx&lt;/searchId&gt;
      &lt;pageIndex&gt;2&lt;/pageIndex&gt;
    &lt;/searchMoreWithId&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;</pre>
<strong>Response (Page-2 and onwards)</strong>
<pre class="lang:default decode:true  ">HTTP/1.1 200 OK
Date: Wed, 03 Oct 2018 18:40:33 GMT
Content-Length: 49266
Content-Type: text/xml; charset=utf-8
X-N-OperationId: c1e79336-63b7-4eb7-989e-5c3d24c56891
NS_RTIMER_COMPOSITE: 118xxxxxxxx:70617xxxxxxxxxxxxxxxxxxxxxD:80
Strict-Transport-Security: max-age=31536000
P3P: CP="CAO PSAa OUR BUS PUR"
Vary: User-Agent

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;soapenv:Header&gt;
    &lt;platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;platformMsgs:nsId&gt;WEBSERVICES_ABCD_12345-xxxxxxxxx&lt;/platformMsgs:nsId&gt;
    &lt;/platformMsgs:documentInfo&gt;
  &lt;/soapenv:Header&gt;
  &lt;soapenv:Body&gt;
    &lt;searchMoreWithIdResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;platformCore:searchResult xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"&gt;
        &lt;platformCore:status isSuccess="true" /&gt;
        &lt;platformCore:totalRecords&gt;193&lt;/platformCore:totalRecords&gt;
        &lt;platformCore:pageSize&gt;50&lt;/platformCore:pageSize&gt;
        &lt;platformCore:totalPages&gt;4&lt;/platformCore:totalPages&gt;
        &lt;platformCore:pageIndex&gt;2&lt;/platformCore:pageIndex&gt;
        &lt;platformCore:searchId&gt;WEBSERVICES_ABCD_12345-xxxxxxxxx&lt;/platformCore:searchId&gt;
        &lt;platformCore:recordList&gt;
          &lt;platformCore:record internalId="1" xsi:type="listAcct:Account" xmlns:listAcct="urn:accounting_2017_1.lists.webservices.netsuite.com"&gt;
            &lt;listAcct:acctType&gt;_bank&lt;/listAcct:acctType&gt;
            &lt;listAcct:acctNumber&gt;8000&lt;/listAcct:acctNumber&gt;
            &lt;listAcct:acctName&gt;Checking&lt;/listAcct:acctName&gt;
            &lt;listAcct:includeChildren&gt;false&lt;/listAcct:includeChildren&gt;
            &lt;listAcct:currency internalId="1"&gt;
              &lt;platformCore:name&gt;USD&lt;/platformCore:name&gt;
            &lt;/listAcct:currency&gt;
            &lt;listAcct:generalRate&gt;_current&lt;/listAcct:generalRate&gt;
            &lt;listAcct:parent internalId="246"&gt;
              &lt;platformCore:name&gt;xxxxxxxxxxxxxxxxxxx&lt;/platformCore:name&gt;
            &lt;/listAcct:parent&gt;
            &lt;listAcct:cashFlowRate&gt;_average&lt;/listAcct:cashFlowRate&gt;
            &lt;listAcct:description&gt;Checking&lt;/listAcct:description&gt;
            &lt;listAcct:isInactive&gt;false&lt;/listAcct:isInactive&gt;
            &lt;listAcct:inventory&gt;false&lt;/listAcct:inventory&gt;
            &lt;listAcct:eliminate&gt;false&lt;/listAcct:eliminate&gt;
            &lt;listAcct:revalue&gt;true&lt;/listAcct:revalue&gt;
          &lt;/platformCore:record&gt;
          &lt;platformCore:record internalId="2" xsi:type="listAcct:Account" xmlns:listAcct="urn:accounting_2017_1.lists.webservices.netsuite.com"&gt;
            &lt;listAcct:acctType&gt;_bank&lt;/listAcct:acctType&gt;
            &lt;listAcct:acctNumber&gt;8001&lt;/listAcct:acctNumber&gt;
            &lt;listAcct:acctName&gt;Savings&lt;/listAcct:acctName&gt;
            &lt;listAcct:includeChildren&gt;false&lt;/listAcct:includeChildren&gt;
            &lt;listAcct:currency internalId="1"&gt;
              &lt;platformCore:name&gt;USD&lt;/platformCore:name&gt;
            &lt;/listAcct:currency&gt;
            &lt;listAcct:generalRate&gt;_current&lt;/listAcct:generalRate&gt;
            &lt;listAcct:parent internalId="246"&gt;
              &lt;platformCore:name&gt;yyyyyyyyy&lt;/platformCore:name&gt;
            &lt;/listAcct:parent&gt;
            &lt;listAcct:cashFlowRate&gt;_average&lt;/listAcct:cashFlowRate&gt;
            &lt;listAcct:description&gt;Savings&lt;/listAcct:description&gt;
            &lt;listAcct:isInactive&gt;false&lt;/listAcct:isInactive&gt;
            &lt;listAcct:inventory&gt;false&lt;/listAcct:inventory&gt;
            &lt;listAcct:eliminate&gt;false&lt;/listAcct:eliminate&gt;
            &lt;listAcct:revalue&gt;true&lt;/listAcct:revalue&gt;
          &lt;/platformCore:record&gt;
          .........
          .........
          .........
          .........		  
        &lt;/platformCore:recordList&gt;
      &lt;/platformCore:searchResult&gt;
    &lt;/searchMoreWithIdResponse&gt;
  &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;</pre>
&nbsp;

&nbsp;</div>
<h2><span id="Getting_Started">Getting Started</span></h2>
<p>Now let’s check step by step instructions on <strong>how to load NetSuite data in Power BI</strong>. In this exercise we will focus on <a href="https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3519853.html" target="_blank" rel="noopener">calling search API</a> but you can call virtually any API using the same technique.</p>
<p>For detailed help on NetSuite SOAP API and other useful information check <a href="https://system.netsuite.com/app/help/helpcenter.nl?fid=book_N3412393.html" target="_blank" rel="noopener">this documentation</a>. To browse schema you can use <a href="http://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2017_2/schema/record/account.html?mode=package" target="_blank" rel="noopener">this link</a>. From schema browser we will use Search Type name later on in this article. For example later on in this article to search accounts we will use <strong>AccountSearch</strong> as below example. This name can be found <a href="http://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2017_2/schema/search/accountsearch.html?mode=package" target="_blank" rel="noopener">from here(click search tab)</a> You can change it to something else. For now dont worry too much until we get to that point.</p>
<div id="crayon-5bb3ef8dce2fc034493941" class="crayon-syntax crayon-theme-vs2012 crayon-font-courier-new crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover">
<div class="crayon-main">
<div class="crayon-nums-content">
<div class="crayon-num" data-line="crayon-5bb3ef8dce2fc034493941-1"></div>
</div>
<div class="crayon-pre">
<div id="crayon-5bb3ef8dce2fc034493941-1" class="crayon-line"><code><span class="crayon-o">&lt;</span><span class="crayon-e">searchRecord </span><span class="crayon-v">xmlns</span><span class="crayon-o">:</span><span class="crayon-v">q1</span><span class="crayon-o">=</span><span class="crayon-s">"urn:accounting_2017_1.lists.webservices.netsuite.com"</span> <span class="crayon-v">xsi</span><span class="crayon-o">:</span><span class="crayon-v">type</span><span class="crayon-o">=</span><span class="crayon-s">"q1:AccountSearch"</span><span class="crayon-o">&gt;</span></code></div>
</div>
</div>
<div></div>
</div>
<h3>Creating NetSuite ODBC Connection (Using ZappySys XML / SOAP Driver)</h3>
<p>Once you have all necessary information handy we can <strong>create ODBC DSN for NetSuite</strong> which can be used by any ODBC compliant app such as <strong>Power BI</strong>. Perform the following steps to set NetSuite Connection which we will use to query data (e.g. Accounts, Budget, Campaign etc).</p>
<p>&nbsp;</p>
<ol>
<li>Open start menu and search for &#8220;ODBC 64&#8221;. Launch ODBC Data sources for 64 bit<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-data-sources-start-up-screen.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-3992" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-data-sources-start-up-screen.png" alt="Open ODBC Data Sources from Startup menu" width="986" height="622" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-data-sources-start-up-screen.png 986w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-data-sources-start-up-screen-300x189.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-data-sources-start-up-screen-768x484.png 768w" sizes="(max-width: 986px) 100vw, 986px" /></a></li>
<li>Click <strong>Add</strong> and select <strong>ZappySys XML Driver</strong>
<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">ZappySys ODBC Driver for XML / SOAP API</p></div></li>
<li>Once driver UI is visible change default DSN name (e.g. change to <strong>ZS &#8211; NetSuite</strong>)</li>
<li>Click on the <strong>Load Connection String</strong> button and enter the following string after replacing below placeholders to configure the NetSuite connection. If you are unsure how to get Account ID and Application ID then check previous sections. For now dont worry about various options in the connection string. We will cover them later.<br />
Replace <strong>$$$YOUR-APPLICATION-ID$$$</strong>  (2 times) with your own Application ID<br />
Replace <strong>$$$YOUR-ACCOUNT-ID$$$</strong> with your own Account ID<br />
Replace <strong>$$$YOUR-USER-ID$$$</strong>  with your own Login ID (e.g myuser@mycompany.com)<br />
Replace <strong>$$$YOUR-PASSWORD$$$</strong>  with your own Password<br />
Replace <strong>&lt;pageSize&gt;50&lt;/pageSize&gt;</strong>  with your own value. We suggest not to go more than 200 rows per page for better performance.<br />
Replace <strong>c:\temp\netsuite.cache.db</strong> with your own path for Cache File. Caching must be ON in order to Import data in Power BI correct way. We also use CacheTtl=120 seconds (Cache Expires in 120 seconds) but adjust it longer if your data import takes long time.<br />
<pre class="crayon-plain-tag">DRIVER={ZappySys XML Driver};ElementsToTreatAsArray='platformCore:record';DataPath='https://webservices.netsuite.com/services/NetSuitePort_2017_1';DataConnectionType=HTTP;AuthScheme='JSESSIONID=';TokenUrl='https://webservices.netsuite.com/services/NetSuitePort_2017_1';TokenRequestData='&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;soap:Header&gt;
    &lt;applicationInfo xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;applicationId&gt;$$$YOUR-APPLICATION-ID$$$&lt;/applicationId&gt;
    &lt;/applicationInfo&gt;
  &lt;/soap:Header&gt;
  &lt;soap:Body&gt;
    &lt;login xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;passport&gt;
        &lt;email xmlns="urn:core_2017_1.platform.webservices.netsuite.com"&gt;[$userid$]&lt;/email&gt;
        &lt;password xmlns="urn:core_2017_1.platform.webservices.netsuite.com"&gt;[$password$]&lt;/password&gt;
        &lt;account xmlns="urn:core_2017_1.platform.webservices.netsuite.com"&gt;$$$YOUR-ACCOUNT-ID$$$&lt;/account&gt;
        &lt;role internalId="3" xmlns="urn:core_2017_1.platform.webservices.netsuite.com" /&gt;
      &lt;/passport&gt;
    &lt;/login&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;';TokenRequestMethod='POST';TokenRequestContentType=TextXmlUtf8;TokenResponseValueExtractMode=Cookie;TokenRequestHeaders='SOAPAction:"login"';TokenResponseCookie='JSESSIONID';TokenAuthHeader='Cookie';UserName='$$$YOUR-USER-ID$$$';CredentialType=TokenDynamic;Password='$$$YOUR-PASSWORD$$$';Filter='$.soapenv:Envelope.soapenv:Body.search[$tag$]Response.platformCore:searchResult.platformCore:recordList.platformCore:record[*]';RequestData='&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;soap:Header&gt;
    &lt;applicationInfo xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;applicationId&gt;$$$YOUR-APPLICATION-ID$$$&lt;/applicationId&gt;
    &lt;/applicationInfo&gt;
    &lt;searchPreferences xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;pageSize&gt;50&lt;/pageSize&gt;
    &lt;/searchPreferences&gt;
  &lt;/soap:Header&gt;
  &lt;soap:Body&gt;
[$tag$]
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;';RequestMethod='POST';NextUrlAttributeOrExpr='$.soapenv:Envelope.soapenv:Body.search[$tag$]Response.platformCore:searchResult.platformCore:searchId';FirstPageBodyPart='    &lt;search xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;searchRecord xmlns:q1="urn:accounting_2017_1.lists.webservices.netsuite.com" xsi:type="q1:AccountSearch"&gt;
        &lt;q1:basic&gt;
		&lt;!--
          &lt;description operator="doesNotContain" xmlns="urn:common_2017_1.platform.webservices.netsuite.com"&gt;
            &lt;searchValue xmlns="urn:core_2017_1.platform.webservices.netsuite.com"&gt;x&lt;/searchValue&gt;
          &lt;/description&gt;
          &lt;name operator="contains" xmlns="urn:common_2017_1.platform.webservices.netsuite.com"&gt;
            &lt;searchValue xmlns="urn:core_2017_1.platform.webservices.netsuite.com"&gt;a&lt;/searchValue&gt;
          &lt;/name&gt;
		 --&gt; 
        &lt;/q1:basic&gt;
      &lt;/searchRecord&gt;
    &lt;/search&gt;';NextPageBodyPart='    &lt;searchMoreWithId xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;searchId&gt;[$pagetoken$]&lt;/searchId&gt;
      &lt;pageIndex&gt;[$pagenumber$]&lt;/pageIndex&gt;
    &lt;/searchMoreWithId&gt;';PagingMaxPagesExpr='$.soapenv:Envelope.soapenv:Body.searchResponse.platformCore:searchResult.platformCore:totalPages';HasDifferentNextPageInfo=True;EnablePageTokenForBody=True;PagePlaceholders='header=|MoreWithId;filter=|MoreWithId';RequestHeaders='Content-Type: text/xml; charset=utf-8 || SOAPAction: "search[$tag$]"';CachingMode=All;CacheStorage=File;CacheEntryTtl=120;CacheFileLocation='c:\temp\netsuite.cache.db'</pre>
&nbsp;</p>
<div id="attachment_4753" style="width: 816px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/08/zappysys-odbc-driver-load-connectionstring.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4753" class="size-full wp-image-4753" src="https://zappysys.com/blog/wp-content/uploads/2018/08/zappysys-odbc-driver-load-connectionstring.png" alt="ZappySys ODBC Driver Load Connection String - NetSuite Connection Example" width="806" height="696" srcset="https://zappysys.com/blog/wp-content/uploads/2018/08/zappysys-odbc-driver-load-connectionstring.png 806w, https://zappysys.com/blog/wp-content/uploads/2018/08/zappysys-odbc-driver-load-connectionstring-300x259.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/08/zappysys-odbc-driver-load-connectionstring-768x663.png 768w" sizes="(max-width: 806px) 100vw, 806px" /></a><p id="caption-attachment-4753" class="wp-caption-text">ZappySys ODBC Driver Load Connection String &#8211; NetSuite Connection Example</p></div></li>
<li>After configuration your screen may look like below. You can also click on <strong>Advanced View</strong> (Radio button) to see some Advanced properties (e.g. Caching Properties such as <strong>CachingMode</strong>, <strong>CacheFileLocation</strong> and Advanced Pagination Properties such as <strong>PagingMaxPagesExpr</strong>, <strong>HasDifferentNextPageInfo</strong>, <strong>NextPageBodyPart</strong>, <strong>FirstPageBodyPart, EnablePageTokenForBody, PagePlaceholders</strong> )<br />
<div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF7B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">Notice <strong>[$tag$]</strong> in Body, Header and Filter. This gets replaced at runtime based on some settings we did for pagination (see next 2 screenshots). NetSuite API has different Header, Body and Filter need for First page vs Next Pages so it needs special configuration. [$tag$] in Body gets replacement based on <strong>FirstPageBodyPart</strong> and <strong>NextPageBodyPart</strong> properties found on Advanced View under Pagination. <strong>[$tag$]</strong> used in Filter, Header or any other place gets its replacements from <strong>PagePlaceHolders</strong> Property found on Advanced View (see filter=firstPartString|nextPartString;header=firstPartString|nextPartString). Use pipe (vertical bar to separate first part placeholder and next part placeholder) In our case we use blank for first part.</div></div>
<div id="attachment_4625" style="width: 817px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/08/odbc-xml-driver-netsuite-connection-settings.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4625" class="size-full wp-image-4625" src="https://zappysys.com/blog/wp-content/uploads/2018/08/odbc-xml-driver-netsuite-connection-settings.png" alt="NetSuite ODBC Connection Settings (ZappySys XML Driver)" width="807" height="702" srcset="https://zappysys.com/blog/wp-content/uploads/2018/08/odbc-xml-driver-netsuite-connection-settings.png 807w, https://zappysys.com/blog/wp-content/uploads/2018/08/odbc-xml-driver-netsuite-connection-settings-300x261.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/08/odbc-xml-driver-netsuite-connection-settings-768x668.png 768w" sizes="(max-width: 807px) 100vw, 807px" /></a><p id="caption-attachment-4625" class="wp-caption-text">NetSuite ODBC Connection Settings (ZappySys XML Driver)</p></div></li>
<li>Here is what it looks like on Advanced Tab.
<div id="attachment_4751" style="width: 747px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-odbc-driver-pagination-settings.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4751" class="size-full wp-image-4751" src="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-odbc-driver-pagination-settings.png" alt="NetSuite Connection Settings - ODBC XML Driver Advanced View (Pagination, Caching, Logging and other properties not found in Simple Mode)" width="737" height="911" srcset="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-odbc-driver-pagination-settings.png 737w, https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-odbc-driver-pagination-settings-243x300.png 243w" sizes="(max-width: 737px) 100vw, 737px" /></a><p id="caption-attachment-4751" class="wp-caption-text">ODBC XML Driver &#8211; Ádvanced View (Pagination, Caching, Logging and other properties not found in Simple Mode)</p></div></li>
<li>Now go to preview tab and click <strong>Preview Data</strong> button. You will see upto 100 sample records. Using below query it will use all options from UI (No override in query).<strong>SELECT * from $</strong>
<div id="attachment_4627" style="width: 818px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/08/odbc-netsuite-connection-query-data-preview.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4627" class="size-full wp-image-4627" src="https://zappysys.com/blog/wp-content/uploads/2018/08/odbc-netsuite-connection-query-data-preview.png" alt="Preview NetSuite data using ODBC Driver" width="808" height="702" srcset="https://zappysys.com/blog/wp-content/uploads/2018/08/odbc-netsuite-connection-query-data-preview.png 808w, https://zappysys.com/blog/wp-content/uploads/2018/08/odbc-netsuite-connection-query-data-preview-300x261.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/08/odbc-netsuite-connection-query-data-preview-768x667.png 768w" sizes="(max-width: 808px) 100vw, 808px" /></a><p id="caption-attachment-4627" class="wp-caption-text">Preview NetSuite data (Query Accounts) using ODBC Driver</p></div></li>
<li>Now let&#8217;s change our default query a bit  to get list of Expense Category (i.e. <a href="http://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2017_2/schema/search/accountsearch.html?mode=package" target="_blank" rel="noopener">ExpenseCategorySearch</a>). As you see we change FirstRequestBody a little bit (change <strong>q1:ExpenseCategorySearch</strong>). We also removed some unwanted columns from preview by setting <strong>IncludeParentColumns=&#8217;false&#8217;</strong><br />
<pre class="crayon-plain-tag">SELECT * FROM $
WITH(
	FirstPageBodyPart='    &lt;search xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;searchRecord xmlns:q1="urn:accounting_2017_1.lists.webservices.netsuite.com" xsi:type="q1:ExpenseCategorySearch"&gt;
        &lt;q1:basic&gt;
          &lt;description operator="doesNotContain" xmlns="urn:common_2017_1.platform.webservices.netsuite.com"&gt;
            &lt;searchValue xmlns="urn:core_2017_1.platform.webservices.netsuite.com"&gt;Some-String-Goes-Here&lt;/searchValue&gt;
          &lt;/description&gt;
          &lt;name operator="contains" xmlns="urn:common_2017_1.platform.webservices.netsuite.com"&gt;
            &lt;searchValue xmlns="urn:core_2017_1.platform.webservices.netsuite.com"&gt;Some-String-Goes-Here&lt;/searchValue&gt;
          &lt;/name&gt;
        &lt;/q1:basic&gt;
      &lt;/searchRecord&gt;
    &lt;/search&gt;',
    IncludeParentColumns='False'
)</pre>
We have commented SearchQuery portion to make it simple but you can learn more about how to write search query from here</p>
<p>Here is one more example of query which combines <a href="https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3519853.html#bridgehead_N3519940">Basic Search</a> and <a href="https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3519853.html" target="_blank" rel="noopener">Advanced Search</a></p>
<div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF7B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">Pay close attention to namespace prefix in SOAP code you copy from Help center. It may be using different prefix than our original connection string (e.g. we use q1:xxxxx at some places but online sample may use ns1, ns2, ns3 &#8230;.)</div></div>
<pre class="crayon-plain-tag">SELECT * FROM $
WITH(
	FirstPageBodyPart='
    &lt;search xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;searchRecord xsi:type="ns4:ContactSearch" xmlns:ns4="urn:relationships_2017_1.lists.webservices.netsuite.com"&gt;
        &lt;ns4:basic xsi:type="ns5:ContactSearchBasic" xmlns:ns5="urn:common_2017_1.platform.webservices.netsuite.com"&gt;
          &lt;ns5:email operator="contains" xsi:type="ns6:SearchStringField" xmlns:ns6="urn:core_2017_1.platform.webservices.netsuite.com"&gt;
            &lt;ns6:searchValue xsi:type="xsd:string"&gt;.com&lt;/ns6:searchValue&gt;
          &lt;/ns5:email&gt;
        &lt;/ns4:basic&gt;
        &lt;ns4:customerJoin xsi:type="ns7:CustomerSearchBasic" xmlns:ns7="urn:common_2017_1.platform.webservices.netsuite.com"&gt;
          &lt;ns7:entityId operator="contains" xsi:type="ns8:SearchStringField" xmlns:ns8="urn:core_2017_1.platform.webservices.netsuite.com"&gt;
            &lt;ns8:searchValue xsi:type="xsd:string"&gt;C&lt;/ns8:searchValue&gt;
          &lt;/ns7:entityId&gt;
        &lt;/ns4:customerJoin&gt;
      &lt;/searchRecord&gt;
    &lt;/search&gt;',
    IncludeParentColumns='False'
)</pre>
&nbsp;</p>
<div id="attachment_4628" style="width: 784px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-search-api-example-basicsearch-advancedsearch.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4628" class="size-full wp-image-4628" src="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-search-api-example-basicsearch-advancedsearch.png" alt="NetSuite Search API Example (Mixing BasicSearch / AdvancedSearch with JOIN)" width="774" height="733" srcset="https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-search-api-example-basicsearch-advancedsearch.png 774w, https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-search-api-example-basicsearch-advancedsearch-300x284.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/08/netsuite-search-api-example-basicsearch-advancedsearch-768x727.png 768w" sizes="(max-width: 774px) 100vw, 774px" /></a><p id="caption-attachment-4628" class="wp-caption-text">NetSuite Search API Example (Mixing BasicSearch / AdvancedSearch with JOIN)</p></div></li>
<li>Copy your Final Query you like to use to import NetSuite data in Power BI</li>
<li>Click OK to save DSN</li>
</ol>
<p>&nbsp;</p>
<h3>Import NetSuite data in Power BI</h3>
<p>Now lets perform the final step to import our NetSuite Query to Power BI. Assume that we want to import Contacts in Power BI to report them by demographics or some other criteria.</p>
<ol>
<li>Open Power BI Desktop</li>
<li>Click on <strong>Get Data</strong> &gt; <strong>More Data&#8230;</strong> &gt; <strong>Other</strong> &gt; <strong>ODBC</strong>
<div id="attachment_3945" style="width: 545px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-data-xml-soap-web-service-call-odbc-xml-api-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3945" class="size-full wp-image-3945" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-data-xml-soap-web-service-call-odbc-xml-api-driver.png" alt="Import SOAP API in Power BI (Using ZappySys XML ODBC Driver)" width="535" height="590" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-data-xml-soap-web-service-call-odbc-xml-api-driver.png 535w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-data-xml-soap-web-service-call-odbc-xml-api-driver-272x300.png 272w" sizes="(max-width: 535px) 100vw, 535px" /></a><p id="caption-attachment-3945" class="wp-caption-text">Import SOAP API in Power BI (Using ZappySys XML ODBC Driver)</p></div></li>
<li>Select your <strong>ODBC DSN Source</strong> from the dropdown (Assuming you have created a ODBC Data Source using ZappySys XML Driver – See the previous Section)</li>
<li>Expand <strong>Advanced Options</strong> to enter custom Query.</li>
<li>Enter your SOAP API call SQL query here. For example purpose, we will use below query to get all account using NetSuite Search Web service.<br />
<pre class="crayon-plain-tag">SELECT * FROM $
WITH(
	FirstPageBodyPart='    &lt;search xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"&gt;
      &lt;searchRecord xmlns:q1="urn:accounting_2017_1.lists.webservices.netsuite.com" xsi:type="q1:AccountSearch"&gt;
        &lt;q1:basic&gt;
        &lt;!--
          &lt;description operator="doesNotContain" xmlns="urn:common_2017_1.platform.webservices.netsuite.com"&gt;
            &lt;searchValue xmlns="urn:core_2017_1.platform.webservices.netsuite.com"&gt;x&lt;/searchValue&gt;
          &lt;/description&gt;
          &lt;name operator="contains" xmlns="urn:common_2017_1.platform.webservices.netsuite.com"&gt;
            &lt;searchValue xmlns="urn:core_2017_1.platform.webservices.netsuite.com"&gt;a&lt;/searchValue&gt;
          &lt;/name&gt;
          --&gt;
        &lt;/q1:basic&gt;
      &lt;/searchRecord&gt;
    &lt;/search&gt;',
    IncludeParentColumns='False'
)</pre>
&nbsp;</p>
<div id="attachment_3946" style="width: 952px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-soap-api-xml-web-service-advanced-options-sql.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3946" class="size-full wp-image-3946" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-soap-api-xml-web-service-advanced-options-sql.png" alt="Enter custom SQL to load SOAP Web Service Data in Power BI (ZappySys XML Driver)" width="942" height="713" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-soap-api-xml-web-service-advanced-options-sql.png 942w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-soap-api-xml-web-service-advanced-options-sql-300x227.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-soap-api-xml-web-service-advanced-options-sql-768x581.png 768w" sizes="(max-width: 942px) 100vw, 942px" /></a><p id="caption-attachment-3946" class="wp-caption-text">Import NetSuite SOAP Web Service Data in Power BI (ZappySys XML Driver)</p></div></li>
<li>Once you see data preview click OK to import.</li>
<li>After data import is done you can edit your dataset (e.g. remove unwanted columns)</li>
<li>You can also edit Source query after data is imported (See below)
<div id="attachment_3947" style="width: 829px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3947" class="size-full wp-image-3947" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import.png" alt="Edit Power BI Data Source SQL after SOAP Web Service Import" width="819" height="502" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import.png 819w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import-300x184.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import-768x471.png 768w" sizes="(max-width: 819px) 100vw, 819px" /></a><p id="caption-attachment-3947" class="wp-caption-text">Edit Power BI Data Source SQL after REST / SOAP Web Service Import</p></div></li>
<li>That&#8217;s it. You can now create your dashboards using NetSuite data. See below example.
<div id="attachment_4633" style="width: 823px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/08/import-netsuite-data-in-power-bi-dashboard.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4633" class="size-full wp-image-4633" src="https://zappysys.com/blog/wp-content/uploads/2018/08/import-netsuite-data-in-power-bi-dashboard.png" alt="Import NetSuite data in Power BI dashboard" width="813" height="481" srcset="https://zappysys.com/blog/wp-content/uploads/2018/08/import-netsuite-data-in-power-bi-dashboard.png 813w, https://zappysys.com/blog/wp-content/uploads/2018/08/import-netsuite-data-in-power-bi-dashboard-300x177.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/08/import-netsuite-data-in-power-bi-dashboard-768x454.png 768w" sizes="(max-width: 813px) 100vw, 813px" /></a><p id="caption-attachment-4633" class="wp-caption-text">Import NetSuite data in Power BI dashboard</p></div></li>
</ol>
<p>&nbsp;</p>
<h2>How to debug Web Requests using Fiddler</h2>
<p>There will be a time you like to see RAW HTTP Requests generated by driver for NetSuite SOAP API.  If you like to do that <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">check this article</a>.</p>
<h2>How to call other NetSuite SOAP API</h2>
<p>So far we have seen only search API to query data. But there are many other SOAP APIs which can be consumed using approach listed in this article. <a href="https://zappysys.com/blog/call-soap-api-power-bi-read-xml-web-service-data/" target="_blank" rel="noopener">Check this article</a> to learn more how to call any SOAP API using ZappySys XML Driver. It shows techniques to use tool called SoapUI. You can use NetSuite WSDL file <a href="http://www.netsuite.com/portal/developers/resources/suitetalk-documentation.shtml" target="_blank" rel="noopener">from here</a> copy link listed on that page and use it to import in SoapUI.</p>
<h2>Conclusion</h2>
<p>Consuming data from NetSuite API or any XML / SOAP based API in your Reporting / ETL apps can be tricky. But we have seen how to solve this challenging task using ZappySys XML Driver in few clicks. <a href="https://zappysys.com/onlinehelp/odbc-powerpack/">Download ODBC PowerPack</a> and explore many other API integration scenarios not discussed in this article.</p>
<p>The post <a href="https://zappysys.com/blog/read-netsuite-data-power-bi/">How to read NetSuite data in Power BI</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Import LinkedIn data in Power BI</title>
		<link>https://zappysys.com/blog/how-to-import-linkedin-data-in-powerbi/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 16 Jun 2018 09:15:12 +0000</pubDate>
				<category><![CDATA[JSON File / REST API Driver]]></category>
		<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[Reporting - Microsoft Power BI]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[rest api]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=3754</guid>

					<description><![CDATA[<p>Introduction In this article, we will learn how to import LinkedIn data in Power BI. For that, we will create a successful OAuth Connection then request for reading LinkedIn Profile data and loading into Power BI Power BI is a very popular Business Analytic tool used to get business information. It is very popular because it [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/how-to-import-linkedin-data-in-powerbi/">How to Import LinkedIn data in Power BI</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/linkedin-to-power-biimport-export-2.png"><img loading="lazy" decoding="async" class="wp-image-3989 size-thumbnail alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/06/linkedin-to-power-biimport-export-2-150x150.png" alt="" width="150" height="150" /></a>In this article, we will learn how to <strong>import LinkedIn data in Power BI</strong>. For that, we will create a successful OAuth Connection then request for reading LinkedIn Profile data and loading into Power BI</p>
<p>Power BI is a very popular Business Analytic tool used to get business information. It is very popular because it is easy to install, simple to learn and very intuitive. Also, REST API is very popular these days and we wanted to show you a way to integrate them in Power BI with the help of the <a href="https://zappysys.com/products/odbc-powerpack/">ZappySys ODBC PowerPack</a>. This software includes powerful drivers to <strong>query REST API</strong> URL, Local <strong>XML / JSON files</strong> and <strong>XML SOAP Web Service</strong> with simple SQL queries.</p>
<p>In nutshell, this post will focus on how to call LinkedIn API using <a href="https://zappysys.com/products/odbc-powerpack/">Zappysys ODBC PowerPack</a>. So let&#8217;s get started</p>
<h2><span id="Requirements">Prerequisite</span></h2>
<ol>
<li>First, you will need to have our <a href="https://zappysys.com/products/odbc-powerpack/">ZappySys ODBC Power Pack</a></li>
<li>In the second place, you will need to have internet access</li>
<li>On third place, <a href="https://powerbi.microsoft.com/en-us/desktop/" target="_blank" rel="noopener">Power BI Desktop (FREE)</a> installed</li>
</ol>
<h2>Getting Started</h2>
<p>In order to start, we will show several examples. ZappySys ODBC PowerPack includes the ZappySys JSON Driver that will help you to call LinkedIn API, retrieve basic profile data from LinkedIn and load profile data in Power BI. To learn more about LinkedIn API <a href="https://developer.linkedin.com/docs/guide/v2" target="_blank" rel="noopener">check this help file</a>.</p>
<h2>Call LinkedIn API using ZappySys JSON Driver</h2>
<p>To access LinkedIn data using REST API call you need to create a LinkedIn app. See this <a href="https://zappysys.com/blog/read-linkedin-data-in-ssis-load-sql-server-call-rest-api/">article,</a> it has mentioned the steps for How to register an App in LinkedIn. once you registered OAuth app in the LinkedIn website we can move to ODBC DataSources(DSN) Part.</p>
<ol>
<li>Double-click on the ODBC Data Sources App.
<div id="attachment_3992" style="width: 996px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-data-sources-start-up-screen.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3992" class="size-full wp-image-3992" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-data-sources-start-up-screen.png" alt="Open ODBC Data Sources from Startup menu" width="986" height="622" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-data-sources-start-up-screen.png 986w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-data-sources-start-up-screen-300x189.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-data-sources-start-up-screen-768x484.png 768w" sizes="(max-width: 986px) 100vw, 986px" /></a><p id="caption-attachment-3992" class="wp-caption-text">Open ODBC Data Sources from Startup menu</p></div></li>
<li>Click on Add button in User DSN Tab and then select JSON Driver from the driver list and click on Finish button to Create a new JSON Driver.
<div id="attachment_3993" style="width: 1067px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3993" class="size-full wp-image-3993" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver.png" alt="ODBC User DSN Tab: Add new Driver Screen" width="1057" height="422" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver.png 1057w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver-300x120.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver-768x307.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver-1024x409.png 1024w" sizes="(max-width: 1057px) 100vw, 1057px" /></a><p id="caption-attachment-3993" class="wp-caption-text">ODBC User DSN Tab: Add new Driver Screen</p></div></li>
<li>Enter API URL in Properties Tab. Here is the sample Example:<br />
<pre class="crayon-plain-tag">https://api.linkedin.com/v1/people/~:(id,firstName,lastName,headline,num-connections)?format=json</pre>
Select a type of Connection from the Connection drop-down. here for this call, we have to select OAuth Connection.</p>
<div id="attachment_3996" style="width: 991px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-configuration-for-linkedin-api-call.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3996" class="wp-image-3996 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-configuration-for-linkedin-api-call.png" alt="ZappySys ODBC JSON Driver: Configurations settings for LinkedIn API" width="981" height="715" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-configuration-for-linkedin-api-call.png 981w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-configuration-for-linkedin-api-call-300x219.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-configuration-for-linkedin-api-call-768x560.png 768w" sizes="(max-width: 981px) 100vw, 981px" /></a><p id="caption-attachment-3996" class="wp-caption-text">ZappySys ODBC JSON Driver: Configurations settings for LinkedIn API</p></div></li>
<li>Configure new OAuth Connection for LinkedIn as below.<br />
Basically, you need to enter 3 pieces on the General tab (i.e. ClientId, ClientSecret, Scopes) and one more info on the Advanced tab (i.e. callback URL ). If you are not sure what is Scope then check <a href="https://developer.linkedin.com/docs/guide/v2" target="_blank" rel="noopener">this LinkedIn API documentation</a>. For each API page, you will see which permission needed. Just include the desired scope on ZappySys OAuth Connection (see below).</p>
<div id="attachment_3997" style="width: 1460px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-connection-configuration-for-linkedin.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3997" class="size-full wp-image-3997" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-connection-configuration-for-linkedin.png" alt="OAuth Connection Manager: Configure the settings for LinkedIn" width="1450" height="711" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-connection-configuration-for-linkedin.png 1450w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-connection-configuration-for-linkedin-300x147.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-connection-configuration-for-linkedin-768x377.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-connection-configuration-for-linkedin-1024x502.png 1024w" sizes="(max-width: 1450px) 100vw, 1450px" /></a><p id="caption-attachment-3997" class="wp-caption-text">OAuth Connection Manager: Configure the settings for LinkedIn</p></div>
<p>also, Enter your Callback URL in Advanced Tab.</p>
<div id="attachment_3998" style="width: 597px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-oauth-connection-manager-for-linkedin-advanced-tab.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3998" class="size-full wp-image-3998" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-oauth-connection-manager-for-linkedin-advanced-tab.png" alt="OAuth Connection Manager: Configurations settings for LinkedIn in Advanced Tab" width="587" height="510" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-oauth-connection-manager-for-linkedin-advanced-tab.png 587w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-oauth-connection-manager-for-linkedin-advanced-tab-300x261.png 300w" sizes="(max-width: 587px) 100vw, 587px" /></a><p id="caption-attachment-3998" class="wp-caption-text">OAuth Connection Manager: Configurations settings for LinkedIn in Advanced Tab</p></div></li>
<li>After successfully establishing the Connection with LinkedIn, you can Click on Test Connection button.
<div id="attachment_3999" style="width: 878px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-test-connection-for-linkedin-api-request.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3999" class="size-full wp-image-3999" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-test-connection-for-linkedin-api-request.png" alt="ODBC JSON Driver: Test Connection for LinkedIn API Request" width="868" height="712" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-test-connection-for-linkedin-api-request.png 868w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-test-connection-for-linkedin-api-request-300x246.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-test-connection-for-linkedin-api-request-768x630.png 768w" sizes="(max-width: 868px) 100vw, 868px" /></a><p id="caption-attachment-3999" class="wp-caption-text">ODBC JSON Driver: Test Connection for LinkedIn API Request</p></div></li>
<li>now, let&#8217;s go to Preview tab and click on the Preview data
<div id="attachment_4000" style="width: 878px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-preview-screen-for-linkedin-api-request.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4000" class="size-full wp-image-4000" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-preview-screen-for-linkedin-api-request.png" alt="ODBC JSON Driver: Preview Screen of LinkedIn API Request" width="868" height="713" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-preview-screen-for-linkedin-api-request.png 868w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-preview-screen-for-linkedin-api-request-300x246.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-json-driver-preview-screen-for-linkedin-api-request-768x631.png 768w" sizes="(max-width: 868px) 100vw, 868px" /></a><p id="caption-attachment-4000" class="wp-caption-text">ODBC JSON Driver: Preview Screen of LinkedIn API Request</p></div></li>
<li>And that&#8217;s it, Now we will move forward to the next Phase i.e To Load data in Power BI</li>
</ol>
<h2>Load data into Power BI</h2>
<p>In the preview section, we configured and added the ZappySys drivers in the ODBC Driver Administrator with information to connect to LinkedIn REST API. We queried the REST API data in JSON format. Now we will open Power BI and import the information from ODBC.</p>
<ol>
<li>Open Power BI Desktop and select the option <strong><strong><strong>Get data<br />
</strong></strong></strong></p>
<div id="attachment_4029" style="width: 1609px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-start-up-screen.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4029" class="size-full wp-image-4029" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-start-up-screen.png" alt="Power BI : Click on Get Data for Loading from ODBC DSN" width="1599" height="899" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-start-up-screen.png 1599w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-start-up-screen-300x169.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-start-up-screen-768x432.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-start-up-screen-1024x576.png 1024w" sizes="(max-width: 1599px) 100vw, 1599px" /></a><p id="caption-attachment-4029" class="wp-caption-text">Power BI: Click on Get Data for Loading from ODBC DSN</p></div></li>
<li>Get Data will allow adding the ZappySys ODBC driver. Go to <strong>Other</strong> and select <strong><strong>ODBC.<br />
</strong></strong></p>
<div id="attachment_4179" style="width: 1248px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-get-data-screen.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4179" class="wp-image-4179 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-get-data-screen.png" alt="Select ODBC from Get Data Popup in Power BI" width="1238" height="838" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-get-data-screen.png 1238w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-get-data-screen-300x203.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-get-data-screen-768x520.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-get-data-screen-1024x693.png 1024w" sizes="(max-width: 1238px) 100vw, 1238px" /></a><p id="caption-attachment-4179" class="wp-caption-text">Select ODBC from Get Data Popup in Power BI</p></div></li>
<li>Select ODBC DSN name from the DSN dropdown, and click on OK button for Import data
<div id="attachment_4182" style="width: 710px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-get-data-from-odbc-screen-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4182" class="wp-image-4182 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-get-data-from-odbc-screen-1.png" alt="Get data from ODBC Driver" width="700" height="523" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-get-data-from-odbc-screen-1.png 700w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-get-data-from-odbc-screen-1-300x224.png 300w" sizes="(max-width: 700px) 100vw, 700px" /></a><p id="caption-attachment-4182" class="wp-caption-text">Get data from ODBC Driver</p></div></li>
<li>Select data to import and click OK (Below screenshot is for the Table mode import when no SQL specified. You can pick the desired table to import)
<div id="attachment_4184" style="width: 912px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-load-linked-in-data-from-odbc-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4184" class="wp-image-4184 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-load-linked-in-data-from-odbc-driver.png" alt="see the Preview of Linked In data" width="902" height="711" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-load-linked-in-data-from-odbc-driver.png 902w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-load-linked-in-data-from-odbc-driver-300x236.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-load-linked-in-data-from-odbc-driver-768x605.png 768w" sizes="(max-width: 902px) 100vw, 902px" /></a><p id="caption-attachment-4184" class="wp-caption-text">see the Preview of Linked In data</p></div></li>
<li>See the Imported data in table visualization mode. you can select any visualizations as per your need.
<div id="attachment_4192" style="width: 1610px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-imported-linked-in-data-in-table-visualizationpng.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4192" class="size-full wp-image-4192" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-imported-linked-in-data-in-table-visualizationpng.png" alt="Power BI Imported LinkedIn data in Table Visualization" width="1600" height="794" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-imported-linked-in-data-in-table-visualizationpng.png 1600w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-imported-linked-in-data-in-table-visualizationpng-300x149.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-imported-linked-in-data-in-table-visualizationpng-768x381.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-imported-linked-in-data-in-table-visualizationpng-1024x508.png 1024w" sizes="(max-width: 1600px) 100vw, 1600px" /></a><p id="caption-attachment-4192" class="wp-caption-text">Power BI Imported LinkedIn data in Table Visualization</p></div></li>
<li>That&#8217;s All 🙂 you have successfully imported the LinkedIn data in Power BI dashboard.</li>
</ol>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>In this blog, we have learned how to retrieve the basic profile data from LinkedIn using ODBC JSON Driver and then Load those data in Power BI with ODBC DSN in a very simple way. You can achieve many more functionalities with the use of <a href="https://zappysys.com/products/odbc-powerpack/">ODBC PowerPack</a>. Check our blogs/articles on <b></b><strong>How to import REST API in Power BI (Load JSON / SOAP XML) </strong>to find out what <em>these ODBC Drivers are</em> capable of more.</p>
<blockquote class="wp-embedded-content" data-secret="VJ88PKPx6y"><p><a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/">How to import REST API in Power BI (Load JSON / SOAP XML)</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" src="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/embed/#?secret=VJ88PKPx6y" data-secret="VJ88PKPx6y" width="600" height="338" title="&#8220;How to import REST API in Power BI (Load JSON / SOAP XML)&#8221; &#8212; ZappySys Blog" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<h2><span id="References">References</span></h2>
<p>Finally, you can use the following links for more information about the use of LinkedIn API with our <a href="https://zappysys.com/products/odbc-powerpack/">ODBC PowerPack</a>:</p>
<ul>
<li><a href="https://developer.linkedin.com/docs">LinkedIn Documentation for API</a></li>
<li><a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/">https://zappysys.com/blog/howto-import-json-rest-api-power-bi/</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/how-to-import-linkedin-data-in-powerbi/">How to Import LinkedIn data in Power BI</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<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 loading="lazy" 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>Calling SOAP API in Power BI (Read XML Web Service data)</title>
		<link>https://zappysys.com/blog/call-soap-api-power-bi-read-xml-web-service-data/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Thu, 14 Jun 2018 13:36:33 +0000</pubDate>
				<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[Reporting - Microsoft Power BI]]></category>
		<category><![CDATA[XML File / SOAP API Driver]]></category>
		<category><![CDATA[workday]]></category>
		<category><![CDATA[wsdl]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=3933</guid>

					<description><![CDATA[<p>Introduction In our previous post, we saw in general how to call REST API in Power BI. Now let&#8217;s look at how to call SOAP API in Power BI (e.g. WorkDay, Google AdWords services). SOAP API is in XML format so we will be using ZappySys XML Driver for a demonstration in this article. To [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/call-soap-api-power-bi-read-xml-web-service-data/">Calling SOAP API in Power BI (Read XML Web Service data)</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 loading="lazy" 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="109" height="109" 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: 109px) 100vw, 109px" /></a>In our <a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/" target="_blank" rel="noopener">previous post</a>, we saw in general how to <strong>call REST API in Power BI</strong>. Now let&#8217;s look at how to <strong>call SOAP API in Power BI</strong> (e.g. <a href="https://zappysys.com/blog/get-data-from-workday-in-ssis-using-soap-or-rest-api/" target="_blank" rel="noopener">WorkDay</a>, Google AdWords services). SOAP API is in XML format so we will be using ZappySys XML Driver for a demonstration in this article.</p>
<p>To learn how to automate dataset refresh on a scheduled basis you can again refer to the <a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/" target="_blank" rel="noopener">previous post</a> because that won&#8217;t be covered in this article.</p>
<p>So let&#8217;s get started !!!</p>
<h2 style="text-align: left;">Requirements</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 <a href="https://zappysys.com/products/odbc-powerpack/">ZappySys ODBC Power Pack</a> installed</li>
</ol>
<h2>Creating SQL Queries to call SOAP API in Power BI (Using XML Driver)</h2>
<p>Very first step to call SOAP API in Power BI is to understand how to craft SOAP Requests using ZappySys XML Driver. Once you play with sample SOAP queries you can copy/paste that into Power BI.</p>
<div class="content_block" id="custom_post_widget-3870">To call SOAP API you need to know Request XML Body Structure. If you are not sure how to create SOAP Request body then no worries. <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/" target="_blank" rel="noopener">Check this article</a> to learn how to generate SOAP Request body using the Free tool <a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI</a>. Basically, you have to use SoapUI to generate Request XML and after that, you can replace parameters as needed in the generated body.
<h3>What is SOAP Web Service?</h3>
If you are new to SOAP Web Service sometimes referred as XML Web Service then please read some concept about SOAP Web service standard <a href="https://msdn.microsoft.com/en-us/library/ms996507.aspx?f=255&amp;MSPPError=-2147217396" target="_blank" rel="noopener">from this link</a>

There are two important aspects in SOAP Web service.
<ol>
 	<li>Getting WSDL file or URL</li>
 	<li>Knowing exact Web Service URL</li>
</ol>
<h3>What is WSDL</h3>
In very simple term WSDL (often pronounced as whiz-dull) is nothing but a document which describes Service metadata (e.g. Functions you can call, Request parameters, response structure etc). Some service simply give you WSDL as xml file you can download on local machine and then analyze or sometimes you may get direct URL (e.g. http://api.mycompany.com/hr-soap-service/?wsdl )
<h3>Example SQL Query for SOAP API call using ZappySys XML Driver</h3>
Here is an example SQL query you can write to call SOAP API. If you not sure about many details then check next few sections on how to use XML Driver User Interface to build desired SQL query to POST data to XML SOAP Web Service without any coding.
<pre class="lang:tsql decode:true">SELECT * FROM $
WITH(
	 Src='http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx'
	,DataConnectionType='HTTP'
	,CredentialType='Basic' --OR SoapWss
	,SoapWssPasswordType='PasswordText'
	,UserName='myuser'
	,Password='pass$$w123'
	,Filter='$.soap:Envelope.soap:Body.GetHolidaysAvailableResponse.GetHolidaysAvailableResult.HolidayCode[*]'
	,ElementsToTreatAsArray='HolidayCode'	
	,RequestMethod='POST'	
	,Header='Content-Type: text/xml;charset=UTF-8 || SOAPAction: "http://www.holidaywebservice.com/HolidayService_v2/GetHolidaysAvailable"'
	,RequestData='
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hol="http://www.holidaywebservice.com/HolidayService_v2/"&gt;
   &lt;soapenv:Header/&gt;
   &lt;soapenv:Body&gt;
      &lt;hol:GetHolidaysAvailable&gt;
         &lt;!--type: Country - enumeration: [Canada,GreatBritain,IrelandNorthern,IrelandRepublicOf,Scotland,UnitedStates]--&gt;
         &lt;hol:countryCode&gt;UnitedStates&lt;/hol:countryCode&gt;
      &lt;/hol:GetHolidaysAvailable&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;'
)</pre>
Now let's look at steps to create SQL query to call SOAP API. Later we will see how to generate code for your desired programming language (e.g. C# or SQL Server)
<h3>Video Tutorial - Introduction to SOAP Web Service and SoapUI tool</h3>
Before we dive into details about calling SOAP API using ZappySys XML Driver, lets first understand what is SOAP API and how to create SOAP requests using SoapUI tool. You will learn more about this process in the later section. The video contains some fragment about using SOAP API in SSIS but just ignore that part because we will be calling Soap API using ZappySys ODBC Driver rather than SSIS Components.

&nbsp;

<iframe loading="lazy" width="560" height="315" src="https://www.youtube.com/embed/d_x5bgGjg0Y?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="allowfullscreen" data-mce-fragment="1"></iframe>
<h3>Using SoapUI to test SOAP API call / Create Request Body XML</h3>
Assuming you have downloaded and installed <a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI from here</a>, now we are ready to use WSDL for your SOAP Web Service Calls. If you do not have WSDL file or URL handy then contact your API provider (sometimes you just have to add <strong>?wsdl </strong>at the end of your Service URL to get WSDL so try that. Example: http://mycompany/myservice?wsdl ).

If you don't know what is WSDL then in short, WSDL is <strong>Web service Description Language</strong> (i.e. XML file which describes your SOAP Service). WSDL helps to craft SOAP API request Body for ZappySys XML Driver. So Let's get started.
<ol>
 	<li>Open SoapUI and click SOAP button to create new SOAP Project</li>
 	<li>Enter WSDL URL or File Path of WSDLFor example WSDL for our sample service can be accessed via this URL
<pre class="lang:default highlight:0 decode:true">http://www.dneonline.com/calculator.asmx?wsdl</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-import-wsdl-new-soapui-project.png"><img loading="lazy" decoding="async" class="size-full wp-image-3871" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-14.png" alt="Create new SOAP API Project in SoapUI tool for SOAP API Testing" width="486" height="349" /></a>
<div style="margin-bottom: 1em;">Create new SOAP API Project in SoapUI tool for SOAP API Testing</div></li>
 	<li>Once WSDL is loaded you will see possible operations you can call for your SOAP Web Service.</li>
 	<li>If your web service requires credentials then you have to configure it. There are two common credential types for public services (<strong>SOAP WSS</strong> or <strong>BASIC</strong> )
<ol>
 	<li>
<div style="margin-bottom: 1em;">To use <strong>SOAP WSS Credentials</strong> select request node and enter UserId, Password, and <strong>WSS-PasswordType</strong> (PasswordText or PasswordHash)</div>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-pass-soap-wss-credentials-userid-password.png"><img loading="lazy" decoding="async" class="size-full wp-image-3872 alignnone" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-2.png" alt="Configure SOAP WSS Credentials for SoapUI (SOAP API Testing Tool)" width="294" height="544" /></a>
<div style="display: block;">Configure SOAP WSS Credentials for SoapUI (SOAP API Testing Tool)</div></li>
 	<li>To use <strong>BASIC Auth</strong> Credentials select request node and double-click it. At the bottom click on Auth (Basic) and From Authorization dropdown click Add New and Select Basic.<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-pass-basic-authentication-userid-password.png"><img loading="lazy" decoding="async" class="size-full wp-image-3873" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-2.png" alt="Configure Basic Authorization for SoapUI (SOAP API Testing Tool)" width="616" height="653" /></a>
<div style="margin-bottom: 1em;">Configure Basic Authorization for SoapUI (SOAP API Testing Tool)</div></li>
</ol>
</li>
 	<li>Now you can test your request first Double-click on the request node to open request editor.</li>
 	<li>Change necessary parameters, remove optional or unwanted parameters. If you want to regenerate request you can click on <strong>Recreate default request toolbar icon</strong>.
<a href="https://zappysys.com/blog/wp-content/uploads/2016/06/create-soap-request-with-optional-parameters-soapui.png"><img loading="lazy" decoding="async" class="size-full wp-image-2812" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-4.png" alt="Create SOAP Request XML (With Optional Parameters)" width="807" height="315" /></a>
<div style="margin-bottom: 1em;">Create SOAP Request XML (With Optional Parameters)</div></li>
 	<li>Once your SOAP Request XML is ready, <strong>Click the Play button</strong> in the toolbar to execute SOAP API Request and Response will appear in Right side panel.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soapui-test-soap-api-request-response-edit-xml-body.png"><img loading="lazy" decoding="async" class="size-full wp-image-3874" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-5.png" alt="Test SOAP API using SoapUI Tool (Change Default XML Body / Parameters, Execute and See Response)" width="1216" height="511" /></a>
Test SOAP API using SoapUI Tool (Change Default XML Body / Parameters, Execute and See Response)</li>
</ol>
<h3>Create DSN using ZappySys XML Driver to call SOAP API</h3>
Once you have tested your SOAP API in SoapUI tool, we are ready to use ZappySys XML driver to call SOAP API in your preferred BI tool or Programming language.
<ol>
 	<li>First open <strong>ODBC Data Sources</strong> (search ODBC in your start menu or go under ZappySys &gt; ODBC PowerPack &gt; <strong>ODBC 64 bit</strong>)</li>
 	<li>Goto <strong>System DSN</strong> Tab (or User DSN which is not used by Service account)</li>
 	<li>Click <strong>Add</strong> and Select ZappySys XML Driver
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-odbc-xml-soap-api-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3875" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-6.png" alt="ZappySys ODBC Driver for XML / SOAP API" width="593" height="459" /></a>
ZappySys ODBC Driver for XML / SOAP API</li>
 	<li>Configure API URL, Request Method and Request Body as below
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-web-service-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3876" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-7.png" alt="ZappySys XML Driver - Calling SOAP API - Configure URL, Method, Body" width="916" height="874" /></a>
ZappySys XML Driver - Calling SOAP API - Configure URL, Method, Body</li>
 	<li><strong>(This step is Optional)</strong> If your SOAP API requires credentials then Select Connection Type to HTTP and configure as below.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soap-api-call-credential-basic-soap-wss-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3877" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-8.png" alt="ZappySys XML Driver - Configure SOAP WSS Credentials or Basic Authorization (Userid, Password)" width="564" height="483" /></a>
<div style="display: block;">ZappySys XML Driver - Configure SOAP WSS Credentials or Basic Authorization (Userid, Password)</div></li>
 	<li>Configure-Request Headers as below (You can get it from Request &gt; Raw tab from SoapUI after you test the request by clicking the Play button)
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/set-soap-api-request-headers-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3881" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-9.png" alt="Configure SOAP API Request Headers - ZappySys XML Driver" width="1009" height="747" /></a>
Configure SOAP API Request Headers - ZappySys XML Driver</li>
 	<li>Once credentials entered you can select Filter to extract data from the desired node. Make sure to select array node (see special icon) or select the node which contains all necessary columns if you don't have array node.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soap-api-query-select-filter-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3882" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-10.png" alt="Select Filter - Extract data from nested XML / SOAP API Response (Denormalize Hierarchy)" width="809" height="594" /></a>
Select Filter - Extract data from nested XML / SOAP API Response (Denormalize Hierarchy)</li>
 	<li>If prompted select yes to treat selected node as Array (This is helpful when you expect one or more record for selected node)
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/xml-api-array-handling-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3883" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-11.png" alt="Treat selected node as XML Array Option for SOAP API Response XML" width="655" height="572" /></a>
Treat selected node as XML Array Option for SOAP API Response XML</li>
</ol>
<h3>Preview SOAP API Response / Generate SQL Code for SOAP API Call</h3>
Once you configure settings for XML Driver now you can preview data or generate example code for desired language (e.g. C#, Python, Java, SQL Server).

Go to Preview tab and you will see default query generated based on settings you entered in previous sections. Attributes listed in WITH clause are optional. If you omit attribute in WITH clause it will use it from Properties tab.
<h3>Preview Data</h3>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-web-service-zappysys-xml-api-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3884" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-12.png" alt="Preview SOAP API Response in ZappySys XML Driver" width="808" height="780" /></a>
Preview SOAP API Response in ZappySys XML Driver
<h3>Generate Code Option</h3>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-driver-code-generator.png"><img loading="lazy" decoding="async" class="size-full wp-image-3885" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-13.png" alt="Generate Example Code for ZappySys Driver" width="572" height="618" /></a>
<div style="display: block;">Generate Example Code for ZappySys Driver</div></div>
<h2>Import XML SOAP Web Service in Power BI (Using XML Driver)</h2>
<p>Once you know how to craft SQL Queries for SOAP API calls, and you save created DSN as per the previous section we are ready to load data into Power BI from XML Web Service.</p>
<p>So let&#8217;s get started.</p>
<ol>
<li>First launch Power BI and Click on Get Data &gt;&gt; More Data &gt;&gt; Other &gt;&gt; ODBC
<div id="attachment_3945" style="width: 545px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-data-xml-soap-web-service-call-odbc-xml-api-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3945" class="size-full wp-image-3945" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-data-xml-soap-web-service-call-odbc-xml-api-driver.png" alt="Import SOAP API in Power BI (Using ZappySys XML ODBC Driver)" width="535" height="590" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-data-xml-soap-web-service-call-odbc-xml-api-driver.png 535w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-data-xml-soap-web-service-call-odbc-xml-api-driver-272x300.png 272w" sizes="(max-width: 535px) 100vw, 535px" /></a><p id="caption-attachment-3945" class="wp-caption-text">Import SOAP API in Power BI (Using ZappySys XML ODBC Driver)</p></div></li>
<li>Select your ODBC DSN Source from the dropdown (Assuming you have created a ODBC Data Source using ZappySys XML Driver &#8211; See the previous Section)</li>
<li>Expand Advanced Options to enter custom Query.</li>
<li>Enter your SOAP API call SQL query here. For example purpose, we will use below query to try demo SOAP web service.<br />
<pre class="crayon-plain-tag">SELECT * FROM $
WITH(
	 Src='http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx'
	,DataConnectionType='HTTP'
	,CredentialType='Basic' --OR SoapWss
	,SoapWssPasswordType='PasswordText'
	,UserName='myuser'
	,Password='pass$$w123'
	,Filter='$.soap:Envelope.soap:Body.GetHolidaysAvailableResponse.GetHolidaysAvailableResult.HolidayCode[*]'
	,ElementsToTreatAsArray='HolidayCode'	
	,RequestMethod='POST'	
	,Header='Content-Type: text/xml;charset=UTF-8 || SOAPAction: "http://www.holidaywebservice.com/HolidayService_v2/GetHolidaysAvailable"'
	,RequestData='
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hol="http://www.holidaywebservice.com/HolidayService_v2/"&gt;
   &lt;soapenv:Header/&gt;
   &lt;soapenv:Body&gt;
      &lt;hol:GetHolidaysAvailable&gt;
         &lt;!--type: Country - enumeration: [Canada,GreatBritain,IrelandNorthern,IrelandRepublicOf,Scotland,UnitedStates]--&gt;
         &lt;hol:countryCode&gt;UnitedStates&lt;/hol:countryCode&gt;
      &lt;/hol:GetHolidaysAvailable&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;'
)</pre>
<div id="attachment_3946" style="width: 952px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-soap-api-xml-web-service-advanced-options-sql.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3946" class="size-full wp-image-3946" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-soap-api-xml-web-service-advanced-options-sql.png" alt="Enter custom SQL to load SOAP Web Service Data in Power BI (ZappySys XML Driver)" width="942" height="713" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-soap-api-xml-web-service-advanced-options-sql.png 942w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-soap-api-xml-web-service-advanced-options-sql-300x227.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-soap-api-xml-web-service-advanced-options-sql-768x581.png 768w" sizes="(max-width: 942px) 100vw, 942px" /></a><p id="caption-attachment-3946" class="wp-caption-text">Enter custom SQL to load SOAP Web Service Data in Power BI (ZappySys XML Driver)</p></div></li>
<li>Once you see data preview click OK to import.</li>
<li>After data import is done you can edit your dataset (e.g. remove unwanted columns)</li>
<li>You can also edit Source query after data is imported (See below)
<div id="attachment_3947" style="width: 829px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3947" class="size-full wp-image-3947" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import.png" alt="Edit Power BI Data Source SQL after SOAP Web Service Import" width="819" height="502" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import.png 819w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import-300x184.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import-768x471.png 768w" sizes="(max-width: 819px) 100vw, 819px" /></a><p id="caption-attachment-3947" class="wp-caption-text">Edit Power BI Data Source SQL after SOAP Web Service Import</p></div></li>
<li>That&#8217;s it. Use your dataset to build Power BI dashboard and when you ready to publish just hit Publish Button.</li>
</ol>
<h2></h2>
<h2>Using Parameters in Power BI (Dynamic Query)</h2>
<div class="content_block" id="custom_post_widget-3954">In the real world, many values of your REST / SOAP API call may be coming from Parameters. If that's the case for you can try to edit script manually as below. In below example its calling SQL Query with POST method and passing some parameters. Notice below where paraAPIKey is Power BI Parameter (string type). You can use parameters anywhere in your script just like the normal variable.
<p />
<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-odbc-sql-query-pass-parameters-dynamically.png"><img loading="lazy" decoding="async" class="wp-image-3121 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-odbc-sql-query-pass-parameters-dynamically.png" alt="Import REST API in Power BI - Using parameters in SQL Query (Edit code - Advanced Mode)" width="629" height="467" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-odbc-sql-query-pass-parameters-dynamically.png 629w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-odbc-sql-query-pass-parameters-dynamically-300x223.png 300w" sizes="(max-width: 629px) 100vw, 629px" /></a>
<p />
&nbsp;
<pre class="lang:default highlight:0 decode:true">let
    vKey=paraAPIKey,
    Source = Odbc.Query(
"dsn=ZS - OData Customers", 
"SELECT * FROM $ WITH (SRC='http://httpbin.org/post'," 
&amp; "METHOD='POST'," 
&amp; "HEADER='Content-Type:application/json'," 
&amp; "BODY=@'{""CallerId"":1111, ""ApiKey"":""" &amp; vKey &amp; """}')")
in
    Source</pre>
&nbsp;
</div>
<h2>SOAP XML / 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>SOAP XML / REST API Error Handling 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>Security / Connection Types (Options for HTTP, OAuth, SOAP) in Power BI</h2>
<div class="content_block" id="custom_post_widget-3896"><div style="margin-bottom: 1em;">If you need to authenticate or authorize your user to access a web resource, you will need to use one of the <em>Connections:</em></div>
<ul>
 	<li>HTTP</li>
 	<li>OAuth</li>
</ul>
<img loading="lazy" decoding="async" class="wp-image-4078 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252.png" alt="ZappySys XML Driver - HTTP and OAuth Connection Types" width="577" height="302" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252.png 577w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252-300x157.png 300w" sizes="(max-width: 577px) 100vw, 577px" />
<h3>HTTP Connection</h3>
<div style="margin-bottom: 1em;">Use <em>HTTP Connection</em> for simple Windows, Basic, NTLM or Kerberos authentication. Just fill in a username and a password and you are good to go!</div>
<div style="margin-bottom: 1em;">You can also use <em>HTTP Connection</em> for more sophisticated authentication like:</div>
<ul>
 	<li><strong>SOAP WSS</strong> (when accessing a SOAP WebService)</li>
 	<li><strong>Static Token / API Key</strong> (when need to pass an API key in HTTP header)</li>
 	<li><strong>Dynamic Token</strong> (same as Static Token method except that each time you need to log in and retrieve a fresh API key)</li>
 	<li><strong>JWT Token</strong> (As per RFC 7519)</li>
</ul>
<img loading="lazy" decoding="async" class="alignnone wp-image-4091 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-connection-type-1.png" alt="" width="622" height="570" />
<h3>OAuth</h3>
If you are trying to access REST API resource, it is a huge chance, you will need to use <em>OAuth Connection</em>. <a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">Read this article</a> to understand how OAuth authentication and authorization works and how to use it (article originally was written for <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a>, but the concepts and UI stay the same): <br/>
<a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/</a>
<img loading="lazy" decoding="async" class="alignnone size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-connection-type-2.png" width="721" height="708" /></div>
<h2>Other Considerations for Calling Web 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 explored possibilities to load SOAP API data in Power BI without any coding or ETL approach. You can build powerful dashboards and reports by consuming data from any REST / XML SOAP API services using ZappySys Drivers. You can <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">download ZappySys ODBC Drivers</a> and try yourself to learn many other features not covered in this article.</p>
<p>The post <a href="https://zappysys.com/blog/call-soap-api-power-bi-read-xml-web-service-data/">Calling SOAP API in Power BI (Read XML Web Service data)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to import REST API in Power BI (Load JSON / SOAP XML)</title>
		<link>https://zappysys.com/blog/howto-import-json-rest-api-power-bi/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 07 Mar 2018 03:38:27 +0000</pubDate>
				<category><![CDATA[JSON File / REST API Driver]]></category>
		<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[Reporting - Microsoft Power BI]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[power bi]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=2822</guid>

					<description><![CDATA[<p>Introduction In this article, we will learn how to import REST API in Power BI. Power BI is a very popular Business Analytic tool used to get business information. It is very popular because it is easy to install, simple to learn and very intuitive. Also, REST API is very popular these days and we [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/">How to import REST API in Power BI (Load JSON / SOAP 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/03/json-to-power-biimport-export.png"><img loading="lazy" decoding="async" class="alignleft wp-image-2900 size-thumbnail" src="https://zappysys.com/blog/wp-content/uploads/2018/03/json-to-power-biimport-export-150x150.png" alt="Introduction icon json to power bi" width="150" height="150" /></a></p>
<p>In this article, we will learn how to <strong>import REST API in Power BI</strong>.</p>
<p>Power BI is a very popular Business Analytic tool used to get business information. It is very popular because it is easy to install, simple to learn and very intuitive. Also, REST API is very popular these days and we wanted to show you a way to integrate them in Power BI with the help of the <a href="https://zappysys.com/products/odbc-powerpack/">ZappySys ODBC PowerPack</a>. This software includes powerful drivers to <strong>query REST API</strong> URL, Local <strong>XML / JSON files</strong> and <strong>XML SOAP Web Service</strong> with simple SQL queries.</p>
<p>The following video will show how to import REST API in Power BI (JSON or XML Data):<br />
[youtube https://www.youtube.com/watch?v=-3OPfhMY1aI&amp;w=720&amp;h=405]
<h2 style="text-align: left;">Requirements</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>In the second place, you will need to have internet access</li>
<li>On third place, our <a href="https://zappysys.com/products/odbc-powerpack/">ZappySys ODBC Power Pack</a></li>
</ol>
<h2>Step-by-Step: Import REST API into Power BI</h2>
<p>We&#8217;ll walk through the steps to import a REST API into Power BI. The steps outlined below focus on working with JSON APIs, but the same principles can be applied when importing SOAP XML Web Services or local JSON/XML files.</p>
<p>For demonstration purposes, we will utilize a REST API to retrieve data in JSON format. The example URL we&#8217;ll use is:</p><pre class="crayon-plain-tag">https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json</pre><p>
This URL leverages OData and presents information in JSON format. Our objective is to use the ZappySys ODBC Power Pack to establish a connection to this URL and retrieve the information seamlessly into Power BI.</p>
<h3>Create ODBC DSN &#8211; JSON Driver</h3>
<div class="content_block" id="custom_post_widget-3331">Once <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> is installed our next step is to Create and configure ODBC DSN. For example purpose, we will use ZappySys JSON Driver but steps are identical for most of ZappySys ODBC Drivers (e.g. XML Driver or CSV Driver)
<ol>
 	<li>Search for "odbc" in your start menu and click on ODBC (64 bits).
* If you cant find this then you can also go to <span class="lang:default highlight:0 decode:true crayon-inline">Start Menu &gt; ZappySys &gt; ODBC PowerPack &gt; Click on ODBC Data Sources (64-Bit)</span>. If you don't see ODBC 64 bit then most likely you are running 32-bit OS (So just click first ODBC Data Source)
<div class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/odbc-data-source-64-bits.png"><img loading="lazy" decoding="async" class="alignnone" src="https://zappysys.com/blog/wp-content/uploads/2018/03/odbc-data-source-64-bits.png" alt="Open ODBC Data Source" width="340" height="434" /></a>
<p class="wp-caption-text">Open ODBC Data Source</p>

</div></li>
 	<li>Go to <strong>User DSN Tab</strong> and press <strong>Add</strong>. If your DSN needs to be accessed by all users or some service account (like SQL Task Scheduler) then click on <a href="https://zappysys.com/blog/wp-content/uploads/2018/03/odb-data-source-administrator-add.png" target="_blank" rel="noopener">System Tab</a> rather than User Tab.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/add-new-data-source-odbc-administrator.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/03/add-new-data-source-odbc-administrator.png" alt="Create new ODBC DSN (User DSN Tab)" />
</a>
<p class="wp-caption-text">Create new ODBC DSN (User DSN Tab)</p>

</div></li>
 	<li>Add the ZappySys JSON Driver. It is installed with the ZappySys ODBC PowerPack.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/add-zappysys-json-driver.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/03/add-zappysys-json-driver.png" alt="Add ZappySys JSON / REST Driver Connection" />
</a>
<p class="wp-caption-text">Add ZappySys JSON / REST Driver Connection</p>

</div></li>
 	<li>Enter a name for the Data source and configure other necessary properties (e.g. URL / Credentials). You can configure properties in two different modes (<strong>Simple Mode (Default)</strong> or <strong>Advanced Mode</strong>). For Our JSON Driver Example enter URL and Set Data Format as <strong>OData</strong> (For Simple Mode Check Input / Output Format Tab, For Advanced Mode Check. HTTP Advanced Settings). <strong> If your API is not OData compliant or you are not sure then keep it DEFAULT</strong>.
<pre class="lang:default highlight:0 decode:true">https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json</pre>
&nbsp;
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/configure-odbc-dsn-rest-api-connection-simple-view.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/05/powerbi1.png" alt="Configure API Connection - Simple Mode (User Interface Mode)" />
</a>
<p class="wp-caption-text">Configure API Connection - Simple Mode (User Interface Mode)</p>

</div>
&nbsp;</li>
 	<li>Here is the Advanced view with all properties in Grid mode.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/configure-odbc-dsn-rest-api-connection-advanced-view.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/05/powerbi2.png" alt="Configure API Connection - Advanced Mode (Property Grid Mode)" />
</a>
<p class="wp-caption-text">Configure API Connection - Advanced Mode (Property Grid Mode)</p>

</div></li>
 	<li>Finally, you can go to preview tab. Click on the select table to generate your default SQL Query for API service and press <strong>Preview data</strong> to see the magic :).When you click Preview data it parses your SQL Query and sends HTTP Request to fetch Data from JSON service. Once the response is returned it parse nested JSON structure and turns into rows/columns.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/zappysys-select-table-preview.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/05/powerbi4.png" alt="Select Table for preview" />
</a>
<p class="wp-caption-text">Select Table for preview</p>

</div>
&nbsp;</li>
 	<li>
<div style="display: block; margin-bottom: 1em;">Once you select Table name from drop down, UI generates default query for you with all possible column names for selected table like below.</div>
<div style="margin-bottom: 1em;"><strong>Sample Query</strong></div>
<pre class="lang:tsql decode:true">select 
	"CustomerID",
	"CompanyName",
	"ContactName",
	"ContactTitle",
	"Address",
	"City",
	"Region",
	"PostalCode",
	"Country",
	"Phone",
	"Fax"
 from [value]</pre>
&nbsp;</li>
 	<li>To review more examples, make sure to <strong>click on View Examples</strong> button to see many more ways to call API services and extract/transform data
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/examples-call-rest-api-json-sql-server-zappysys-odbc-driver.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/05/powerbi3.png" alt="ZappySys ODBC Driver Examples - Call JSON / REST API" />
</a>
<p class="wp-caption-text">ZappySys ODBC Driver Examples - Call JSON / REST API</p>

</div></li>
 	<li>Now last thing you can try is use Query Builder. Query Builder is an easy way to Build Queries by Overriding certain setting defined on DSN. ZappySys API SQL Query language support WITH Clause which can override settings defined on DSN UI. Usually you can Define Connection related settings on DSN and override Dynamic Settings in your SQL Query so you dont have to create many DSN for each API URL.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/zappysys-api-sql-query-builder.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/05/powerbi5.png" alt="Using API SQL Query Builder" />
</a>
<p class="wp-caption-text">Using API SQL Query Builder</p>

</div></li>
</ol>
<strong>Transfer DSN settings</strong>

There will be a time when you like to create similar ODBC DSN on a totally different machine. If you wish to copy settings of one DSN to different DSN then you can use Load Connection String Feature.

First copy Connection string produced by UI settings on DSN configuration by clicking <strong>Copy Connection String Button</strong> (Found at the bottom of UI). Then you can go to new DSN and click Load connection string to new DSN by clicking <strong>Load Connection String Button</strong>.

<strong>Understanding ODBC Connection String Format</strong>

ZappySys ODBC Drivers can be called in two different ways from your Application (e.g. <a href="https://zappysys.com/blog/calling-rest-api-in-c/" target="_blank" rel="noopener">C#</a>, <a href="https://zappysys.com/blog/set-rest-python-client/" target="_blank" rel="noopener">Python</a>, <a href="https://zappysys.com/blog/connect-java-to-rest-api-json-soap-xml/" target="_blank" rel="noopener">JAVA</a> )
<ol>
 	<li>Using <strong>Driver Name</strong> in the Connection String (You can use Copy Connection String option)</li>
 	<li>Using <strong>DSN Name</strong> in the Connection String</li>
</ol>
<strong>Using Driver Name in the Connection String</strong>

<strong>Syntax:</strong>
<pre class="lang:default highlight:0 decode:true">DRIVER={DRIVER-NAME-GOES-HERE}[;Prop1=xxxxxx][;Prop2=xxxxxx] .... [;PropN=xxxxxx]</pre>
<strong>Examples:</strong>
<pre class="lang:default highlight:0 decode:true">DRIVER={ZappySys JSON Driver}
DRIVER={ZappySys JSON Driver};DataPath='c:\mydata.json'
DRIVER={ZappySys XML Driver};DataPath='http://myserver/api/xml/getOrders'
DRIVER={ZappySys XML Driver};DataPath='c:\mydata.xml'</pre>
<strong>Using DSN Name in the Connection String</strong>

<strong>Syntax:</strong>
<pre class="lang:default highlight:0 decode:true">DRIVER={DRIVER-NAME-GOES-HERE}[;Prop1=xxxxxx][;Prop2=xxxxxx] .... [;PropN=xxxxxx]</pre>
<strong>Examples:</strong>
<pre class="lang:default highlight:0 decode:true">DSN=MyJsonAPI_DSN
DSN=MyJsonAPI_DSN;DataPath='http://myserver/api/json/getOrders'</pre></div>
<h3>Connect to REST API data source in Power BI (Connect JSON / XML data)</h3>
<div class="content_block" id="custom_post_widget-6247">In the previous section, we configured and added the ZappySys drivers in the ODBC Driver Administrator with information to connect to REST API. We queried the REST API data in JSON / XML format. Now let's look at how to import REST API data in Power BI using from ODBC connection.
<ol>
 	<li>Open Power BI Desktop and select the <strong>Get data </strong>option.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/Get-data-Power-bi-desktop.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/03/Get-data-Power-bi-desktop.png" alt="Get data using power bi" />
</a>
<p class="wp-caption-text">Get data using Power BI</p>

</div></li>
</ol>
<ol>
 	<li>Once Get data is clicked, Go to <strong>Other</strong> and select <strong>ODBC.</strong>
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-odbc-other-data-source.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-2-1.png" alt="Import ODBC data source in power bi" />
</a>
<p class="wp-caption-text">Import ODBC data source in Power BI</p>

</div></li>
 	<li>After that select ODBC DSN name from the DSN dropdown</li>
 	<li>Now it's time to import data. Basically, there are two modes to import data. <strong>Table Mode</strong> and <strong>Query Mode</strong>. Query mode is the most common but we will show you both ways.</li>
 	<li><strong>Import using Power BI Query Mode:  </strong>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 query like below. If you are not sure use Query builder (Found on Driver Preview Window)
<pre class="lang:tsql decode:true">SELECT * FROM $
WITH(SRC='https://my-api-url')</pre>
<div 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 decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-1-1.png" alt="Import JSON / REST API data in Power BI using SQL Query Mode" />
</a>
<p class="wp-caption-text">Import JSON / REST API data in Power BI using SQL Query Mode</p>

</div>
&nbsp;</li>
 	<li><strong>Import using Power BI Table Mode:  </strong>If you don't specify SQL query under advanced options then you may get a chance to select Table name to import and Credentials. If Power BI asks for credentials then select <strong>Windows</strong> and connect.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/select-credentials-zappysys.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-3.png" alt="Select credentials for ODBC Source" />
</a>
<p class="wp-caption-text">Select credentials for ODBC Source</p>

</div></li>
 	<li>Once you enter select table, you can choose Select data to import and click OK (Below screeenshot is for the Table mode import when no SQL specified. You can pick desired table to import)
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/Navigator-odbc-json-get-values.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-4.png" alt="Select Table to import in Power BI" />
</a>
<p class="wp-caption-text">Select Table to import in Power BI</p>

</div></li>
 	<li>You can also display data in map using Map visualization like below. Press the map and check Address this option will display the addresses in a map.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/maps-power-view.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-5.png" alt="see address in power bi map" />
</a>
<p class="wp-caption-text">See Address data in power bi map</p>

</div>
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/maps-address-power-bi.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-6.png" alt="Map visualization in Power BI" />
</a>
<p class="wp-caption-text">Map visualization in Power BI</p>

</div></li>
 	<li>Now, let's display data in Table Format. Select in values more columns and select the data grid to visualize the data.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/visualization-power-bi-select-columns.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-7.png" alt="Select columns in Power BI" />
</a>
<p class="wp-caption-text">Select columns in Power BI</p>

</div></li>
 	<li>Once data is displayed, Right click on the data and select <strong>Show Data</strong>.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-show-data.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-8.png" alt="show data in power bi" />
</a>
<p class="wp-caption-text">Show data in Power BI</p>

</div></li>
 	<li>The data will be displayed
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-read-data.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-9.png" alt="View Power BI Table data" />
</a>
<p class="wp-caption-text">read json information data</p>

</div></li>
</ol></div>
<h3>Publish Power BI dashboard</h3>
<ol>
<li>In order to publish the report, press <strong>Publish</strong></li>
<li>Press <strong>Save</strong>
<div id="attachment_2839" style="width: 467px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/save-power-bi-report.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2839" class="size-full wp-image-2839" src="https://zappysys.com/blog/wp-content/uploads/2018/03/howto-import-json-rest-api-power-bi-1.png" alt="Save changes in power bi" width="457" height="159" /></a><p id="caption-attachment-2839" class="wp-caption-text">Save changes in Power BI<span style="font-size: 16px;">:</span></p></div>
<p>&nbsp;</li>
<li><span style="font-size: 16px;">Select a workspace for the report</span>
<div id="attachment_2838" style="width: 604px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/publish-Power-bi-select-workplace.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2838" class="size-full wp-image-2838" src="https://zappysys.com/blog/wp-content/uploads/2018/03/howto-import-json-rest-api-power-bi-2.png" alt="choose power bi workplace" width="594" height="340" /></a><p id="caption-attachment-2838" class="wp-caption-text">Select Power BI workplace<span style="font-size: 16px;">.</span></p></div></li>
<li>And that is all. You have now your report ready.</li>
</ol>
<h2></h2>
<h2>Import data using ODBC ConnectionString (DSN-less)</h2>
<p>Let&#8217;s explore the process of importing data using the ODBC Driver without the need for configuring an ODBC DSN.</p>
<p>When importing data, you have the option to either use an ODBC DSN or a Direct ConnectionString. This section will guide you through the steps of utilizing the ODBC ConnectionString.</p>
<p>After opting for the ODBC option to retrieve data, you will encounter the &#8220;Select ODBC Data Source&#8221; screen. To proceed without a DSN, follow these steps:</p>
<ol>
<li>Change the DSN dropdown to &#8220;(none).&#8221;</li>
<li>Enter the full ODBC ConnectionString, adhering to the syntax below. You can construct your own connection string using the ODBC Driver UI and utilize the &#8220;Copy ConnectionString&#8221; option.<br />
<strong>Syntax:</strong>  <pre class="crayon-plain-tag">Driver={Your Driver Name}[;Property1=value][;Property2=value]......</pre></li>
<li>Here is a screenshot with ConnectionString Setting
<div id="attachment_9388" style="width: 824px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-dsnless-import-odbc-connectionstring.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9388" class="size-full wp-image-9388" src="https://zappysys.com/blog/wp-content/uploads/2018/03/howto-import-json-rest-api-power-bi-3-1.png" alt="Import Data from ODBC Driver - DSN less mode (Use Connection String)" width="814" height="716" /></a><p id="caption-attachment-9388" class="wp-caption-text">Import Data from ODBC Driver &#8211; DSN less mode (Use Connection String)</p></div></li>
<li>Click &#8220;Next&#8221; to select the authentication method. Choose &#8220;Windows&#8221; and input the password value if necessary. If your connection string already includes the Password attribute, there&#8217;s no need to worry.
<div id="attachment_9389" style="width: 718px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-odbc-connectionstring-enter-password.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9389" class="size-full wp-image-9389" src="https://zappysys.com/blog/wp-content/uploads/2018/03/howto-import-json-rest-api-power-bi-4.png" alt="Import Data from ODBC Driver - using Connection String - With Password Attribute" width="708" height="383" /></a><p id="caption-attachment-9389" class="wp-caption-text">Import Data from ODBC Driver &#8211; using Connection String &#8211; With Password Attribute</p></div></li>
</ol>
<h2>POST data to REST API URL</h2>
<p>Up until now, we&#8217;ve explored the process of fetching data from URLs and importing it into Power BI. However, in certain scenarios, APIs may necessitate the use of the PUT or POST method. These methods involve submitting parameters in the body and receiving a response.</p>
<p>For a more in-depth understanding of how to seamlessly POST data to a URL in Power BI, watch the informative video below.</p>
<a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FK7qV_PJup1g%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<h2>Calling XML SOAP Web Service in Power BI</h2>
<p>So far, we have looked at examples to consume data using JSON driver. Now let&#8217;s look at an example, to call XML SOAP Web Service in Power BI.</p>
<div class="content_block" id="custom_post_widget-3870">To call SOAP API you need to know Request XML Body Structure. If you are not sure how to create SOAP Request body then no worries. <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/" target="_blank" rel="noopener">Check this article</a> to learn how to generate SOAP Request body using the Free tool <a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI</a>. Basically, you have to use SoapUI to generate Request XML and after that, you can replace parameters as needed in the generated body.
<h3>What is SOAP Web Service?</h3>
If you are new to SOAP Web Service sometimes referred as XML Web Service then please read some concept about SOAP Web service standard <a href="https://msdn.microsoft.com/en-us/library/ms996507.aspx?f=255&amp;MSPPError=-2147217396" target="_blank" rel="noopener">from this link</a>

There are two important aspects in SOAP Web service.
<ol>
 	<li>Getting WSDL file or URL</li>
 	<li>Knowing exact Web Service URL</li>
</ol>
<h3>What is WSDL</h3>
In very simple term WSDL (often pronounced as whiz-dull) is nothing but a document which describes Service metadata (e.g. Functions you can call, Request parameters, response structure etc). Some service simply give you WSDL as xml file you can download on local machine and then analyze or sometimes you may get direct URL (e.g. http://api.mycompany.com/hr-soap-service/?wsdl )
<h3>Example SQL Query for SOAP API call using ZappySys XML Driver</h3>
Here is an example SQL query you can write to call SOAP API. If you not sure about many details then check next few sections on how to use XML Driver User Interface to build desired SQL query to POST data to XML SOAP Web Service without any coding.
<pre class="lang:tsql decode:true">SELECT * FROM $
WITH(
	 Src='http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx'
	,DataConnectionType='HTTP'
	,CredentialType='Basic' --OR SoapWss
	,SoapWssPasswordType='PasswordText'
	,UserName='myuser'
	,Password='pass$$w123'
	,Filter='$.soap:Envelope.soap:Body.GetHolidaysAvailableResponse.GetHolidaysAvailableResult.HolidayCode[*]'
	,ElementsToTreatAsArray='HolidayCode'	
	,RequestMethod='POST'	
	,Header='Content-Type: text/xml;charset=UTF-8 || SOAPAction: "http://www.holidaywebservice.com/HolidayService_v2/GetHolidaysAvailable"'
	,RequestData='
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hol="http://www.holidaywebservice.com/HolidayService_v2/"&gt;
   &lt;soapenv:Header/&gt;
   &lt;soapenv:Body&gt;
      &lt;hol:GetHolidaysAvailable&gt;
         &lt;!--type: Country - enumeration: [Canada,GreatBritain,IrelandNorthern,IrelandRepublicOf,Scotland,UnitedStates]--&gt;
         &lt;hol:countryCode&gt;UnitedStates&lt;/hol:countryCode&gt;
      &lt;/hol:GetHolidaysAvailable&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;'
)</pre>
Now let's look at steps to create SQL query to call SOAP API. Later we will see how to generate code for your desired programming language (e.g. C# or SQL Server)
<h3>Video Tutorial - Introduction to SOAP Web Service and SoapUI tool</h3>
Before we dive into details about calling SOAP API using ZappySys XML Driver, lets first understand what is SOAP API and how to create SOAP requests using SoapUI tool. You will learn more about this process in the later section. The video contains some fragment about using SOAP API in SSIS but just ignore that part because we will be calling Soap API using ZappySys ODBC Driver rather than SSIS Components.

&nbsp;

<iframe loading="lazy" width="560" height="315" src="https://www.youtube.com/embed/d_x5bgGjg0Y?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="allowfullscreen" data-mce-fragment="1"></iframe>
<h3>Using SoapUI to test SOAP API call / Create Request Body XML</h3>
Assuming you have downloaded and installed <a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI from here</a>, now we are ready to use WSDL for your SOAP Web Service Calls. If you do not have WSDL file or URL handy then contact your API provider (sometimes you just have to add <strong>?wsdl </strong>at the end of your Service URL to get WSDL so try that. Example: http://mycompany/myservice?wsdl ).

If you don't know what is WSDL then in short, WSDL is <strong>Web service Description Language</strong> (i.e. XML file which describes your SOAP Service). WSDL helps to craft SOAP API request Body for ZappySys XML Driver. So Let's get started.
<ol>
 	<li>Open SoapUI and click SOAP button to create new SOAP Project</li>
 	<li>Enter WSDL URL or File Path of WSDLFor example WSDL for our sample service can be accessed via this URL
<pre class="lang:default highlight:0 decode:true">http://www.dneonline.com/calculator.asmx?wsdl</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-import-wsdl-new-soapui-project.png"><img loading="lazy" decoding="async" class="size-full wp-image-3871" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-14.png" alt="Create new SOAP API Project in SoapUI tool for SOAP API Testing" width="486" height="349" /></a>
<div style="margin-bottom: 1em;">Create new SOAP API Project in SoapUI tool for SOAP API Testing</div></li>
 	<li>Once WSDL is loaded you will see possible operations you can call for your SOAP Web Service.</li>
 	<li>If your web service requires credentials then you have to configure it. There are two common credential types for public services (<strong>SOAP WSS</strong> or <strong>BASIC</strong> )
<ol>
 	<li>
<div style="margin-bottom: 1em;">To use <strong>SOAP WSS Credentials</strong> select request node and enter UserId, Password, and <strong>WSS-PasswordType</strong> (PasswordText or PasswordHash)</div>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-pass-soap-wss-credentials-userid-password.png"><img loading="lazy" decoding="async" class="size-full wp-image-3872 alignnone" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-2.png" alt="Configure SOAP WSS Credentials for SoapUI (SOAP API Testing Tool)" width="294" height="544" /></a>
<div style="display: block;">Configure SOAP WSS Credentials for SoapUI (SOAP API Testing Tool)</div></li>
 	<li>To use <strong>BASIC Auth</strong> Credentials select request node and double-click it. At the bottom click on Auth (Basic) and From Authorization dropdown click Add New and Select Basic.<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-pass-basic-authentication-userid-password.png"><img loading="lazy" decoding="async" class="size-full wp-image-3873" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-2.png" alt="Configure Basic Authorization for SoapUI (SOAP API Testing Tool)" width="616" height="653" /></a>
<div style="margin-bottom: 1em;">Configure Basic Authorization for SoapUI (SOAP API Testing Tool)</div></li>
</ol>
</li>
 	<li>Now you can test your request first Double-click on the request node to open request editor.</li>
 	<li>Change necessary parameters, remove optional or unwanted parameters. If you want to regenerate request you can click on <strong>Recreate default request toolbar icon</strong>.
<a href="https://zappysys.com/blog/wp-content/uploads/2016/06/create-soap-request-with-optional-parameters-soapui.png"><img loading="lazy" decoding="async" class="size-full wp-image-2812" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-4.png" alt="Create SOAP Request XML (With Optional Parameters)" width="807" height="315" /></a>
<div style="margin-bottom: 1em;">Create SOAP Request XML (With Optional Parameters)</div></li>
 	<li>Once your SOAP Request XML is ready, <strong>Click the Play button</strong> in the toolbar to execute SOAP API Request and Response will appear in Right side panel.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soapui-test-soap-api-request-response-edit-xml-body.png"><img loading="lazy" decoding="async" class="size-full wp-image-3874" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-5.png" alt="Test SOAP API using SoapUI Tool (Change Default XML Body / Parameters, Execute and See Response)" width="1216" height="511" /></a>
Test SOAP API using SoapUI Tool (Change Default XML Body / Parameters, Execute and See Response)</li>
</ol>
<h3>Create DSN using ZappySys XML Driver to call SOAP API</h3>
Once you have tested your SOAP API in SoapUI tool, we are ready to use ZappySys XML driver to call SOAP API in your preferred BI tool or Programming language.
<ol>
 	<li>First open <strong>ODBC Data Sources</strong> (search ODBC in your start menu or go under ZappySys &gt; ODBC PowerPack &gt; <strong>ODBC 64 bit</strong>)</li>
 	<li>Goto <strong>System DSN</strong> Tab (or User DSN which is not used by Service account)</li>
 	<li>Click <strong>Add</strong> and Select ZappySys XML Driver
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-odbc-xml-soap-api-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3875" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-6.png" alt="ZappySys ODBC Driver for XML / SOAP API" width="593" height="459" /></a>
ZappySys ODBC Driver for XML / SOAP API</li>
 	<li>Configure API URL, Request Method and Request Body as below
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-web-service-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3876" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-7.png" alt="ZappySys XML Driver - Calling SOAP API - Configure URL, Method, Body" width="916" height="874" /></a>
ZappySys XML Driver - Calling SOAP API - Configure URL, Method, Body</li>
 	<li><strong>(This step is Optional)</strong> If your SOAP API requires credentials then Select Connection Type to HTTP and configure as below.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soap-api-call-credential-basic-soap-wss-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3877" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-8.png" alt="ZappySys XML Driver - Configure SOAP WSS Credentials or Basic Authorization (Userid, Password)" width="564" height="483" /></a>
<div style="display: block;">ZappySys XML Driver - Configure SOAP WSS Credentials or Basic Authorization (Userid, Password)</div></li>
 	<li>Configure-Request Headers as below (You can get it from Request &gt; Raw tab from SoapUI after you test the request by clicking the Play button)
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/set-soap-api-request-headers-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3881" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-9.png" alt="Configure SOAP API Request Headers - ZappySys XML Driver" width="1009" height="747" /></a>
Configure SOAP API Request Headers - ZappySys XML Driver</li>
 	<li>Once credentials entered you can select Filter to extract data from the desired node. Make sure to select array node (see special icon) or select the node which contains all necessary columns if you don't have array node.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soap-api-query-select-filter-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3882" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-10.png" alt="Select Filter - Extract data from nested XML / SOAP API Response (Denormalize Hierarchy)" width="809" height="594" /></a>
Select Filter - Extract data from nested XML / SOAP API Response (Denormalize Hierarchy)</li>
 	<li>If prompted select yes to treat selected node as Array (This is helpful when you expect one or more record for selected node)
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/xml-api-array-handling-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3883" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-11.png" alt="Treat selected node as XML Array Option for SOAP API Response XML" width="655" height="572" /></a>
Treat selected node as XML Array Option for SOAP API Response XML</li>
</ol>
<h3>Preview SOAP API Response / Generate SQL Code for SOAP API Call</h3>
Once you configure settings for XML Driver now you can preview data or generate example code for desired language (e.g. C#, Python, Java, SQL Server).

Go to Preview tab and you will see default query generated based on settings you entered in previous sections. Attributes listed in WITH clause are optional. If you omit attribute in WITH clause it will use it from Properties tab.
<h3>Preview Data</h3>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-web-service-zappysys-xml-api-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3884" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-12.png" alt="Preview SOAP API Response in ZappySys XML Driver" width="808" height="780" /></a>
Preview SOAP API Response in ZappySys XML Driver
<h3>Generate Code Option</h3>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-driver-code-generator.png"><img loading="lazy" decoding="async" class="size-full wp-image-3885" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-13.png" alt="Generate Example Code for ZappySys Driver" width="572" height="618" /></a>
<div style="display: block;">Generate Example Code for ZappySys Driver</div></div>
<h2>SOAP / 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>SOAP / REST API Error Handling 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>Security / Connection Types (Options for HTTP, OAuth, SOAP) in Power BI</h2>
<div class="content_block" id="custom_post_widget-3896"><div style="margin-bottom: 1em;">If you need to authenticate or authorize your user to access a web resource, you will need to use one of the <em>Connections:</em></div>
<ul>
 	<li>HTTP</li>
 	<li>OAuth</li>
</ul>
<img loading="lazy" decoding="async" class="wp-image-4078 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252.png" alt="ZappySys XML Driver - HTTP and OAuth Connection Types" width="577" height="302" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252.png 577w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252-300x157.png 300w" sizes="(max-width: 577px) 100vw, 577px" />
<h3>HTTP Connection</h3>
<div style="margin-bottom: 1em;">Use <em>HTTP Connection</em> for simple Windows, Basic, NTLM or Kerberos authentication. Just fill in a username and a password and you are good to go!</div>
<div style="margin-bottom: 1em;">You can also use <em>HTTP Connection</em> for more sophisticated authentication like:</div>
<ul>
 	<li><strong>SOAP WSS</strong> (when accessing a SOAP WebService)</li>
 	<li><strong>Static Token / API Key</strong> (when need to pass an API key in HTTP header)</li>
 	<li><strong>Dynamic Token</strong> (same as Static Token method except that each time you need to log in and retrieve a fresh API key)</li>
 	<li><strong>JWT Token</strong> (As per RFC 7519)</li>
</ul>
<img loading="lazy" decoding="async" class="alignnone wp-image-4091 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-connection-type-1.png" alt="" width="622" height="570" />
<h3>OAuth</h3>
If you are trying to access REST API resource, it is a huge chance, you will need to use <em>OAuth Connection</em>. <a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">Read this article</a> to understand how OAuth authentication and authorization works and how to use it (article originally was written for <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a>, but the concepts and UI stay the same): <br/>
<a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/</a>
<img loading="lazy" decoding="async" class="alignnone size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-connection-type-2.png" width="721" height="708" /></div>
<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>Import data into Power BI from SQL Query</h2>
<p>If you prefer to import data from an SQL query instead of selecting a table name, you can leverage advanced options during the import steps. Here&#8217;s a step-by-step guide:</p>
<ol>
<li>After selecting the DSN, proceed to the import steps.</li>
<li>Click on the &#8220;Advanced Options&#8221; to access the SQL Query editor.</li>
</ol>
<p>By utilizing these advanced options, you gain the flexibility to tailor your import process by specifying custom SQL queries to retrieve the exact data you need.</p>
<div id="attachment_3120" style="width: 395px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-rest-api-sql-query-odbc-data-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3120" class="size-full wp-image-3120" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-rest-api-sql-query-odbc-data-source.png" alt="Import data into Power BI using SQL Query (ODBC Data source)" width="385" height="316" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-rest-api-sql-query-odbc-data-source.png 385w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-rest-api-sql-query-odbc-data-source-300x246.png 300w" sizes="(max-width: 385px) 100vw, 385px" /></a><p id="caption-attachment-3120" class="wp-caption-text">Import data into Power BI using SQL Query (ODBC Data source)</p></div>
<h2>Edit Query / Using Parameters in Power BI (Dynamic Query)</h2>
<div class="content_block" id="custom_post_widget-3954">In the real world, many values of your REST / SOAP API call may be coming from Parameters. If that's the case for you can try to edit script manually as below. In below example its calling SQL Query with POST method and passing some parameters. Notice below where paraAPIKey is Power BI Parameter (string type). You can use parameters anywhere in your script just like the normal variable.
<p />
<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-odbc-sql-query-pass-parameters-dynamically.png"><img loading="lazy" decoding="async" class="wp-image-3121 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-odbc-sql-query-pass-parameters-dynamically.png" alt="Import REST API in Power BI - Using parameters in SQL Query (Edit code - Advanced Mode)" width="629" height="467" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-odbc-sql-query-pass-parameters-dynamically.png 629w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-odbc-sql-query-pass-parameters-dynamically-300x223.png 300w" sizes="(max-width: 629px) 100vw, 629px" /></a>
<p />
&nbsp;
<pre class="lang:default highlight:0 decode:true">let
    vKey=paraAPIKey,
    Source = Odbc.Query(
"dsn=ZS - OData Customers", 
"SELECT * FROM $ WITH (SRC='http://httpbin.org/post'," 
&amp; "METHOD='POST'," 
&amp; "HEADER='Content-Type:application/json'," 
&amp; "BODY=@'{""CallerId"":1111, ""ApiKey"":""" &amp; vKey &amp; """}')")
in
    Source</pre>
&nbsp;
</div>
<h2>Edit Query Settings after Import</h2>
<p>There will be a time you need to change initial Query after dataset import in Power BI. Not to worry, just follow these steps to edit your SQL.</p>
<div id="attachment_3947" style="width: 829px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3947" class="size-full wp-image-3947" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import.png" alt="Edit Power BI Data Source SQL after SOAP Web Service Import" width="819" height="502" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import.png 819w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import-300x184.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import-768x471.png 768w" sizes="(max-width: 819px) 100vw, 819px" /></a><p id="caption-attachment-3947" class="wp-caption-text">Edit Power BI Data Source SQL after REST / SOAP Web Service Import</p></div>
<div class="content_block" id="custom_post_widget-7081"><h2>Using DirectQuery Option rather than Import</h2>
So far we have seen how to Import REST API data into Power BI but what if you have too much data and you dont want to import but link it. Power BI Offers very useful feature for this scenario. Its  called <a href="https://docs.microsoft.com/en-us/power-bi/desktop-use-directquery" target="_blank" rel="noopener">DirectQuery</a> Option. In this section we will explore how to use DirectQuery along with ZappySys Drivers.

Out of the box ZappySys Drivers wont work in ODBC Connection Mode so you have to use SQL Server Connection rather than ODBC if you wish to use Live data using DirectQuery option. See below step by step instructions to enable DirectQuery mode in Power BI for REST API data.

Basically we will use <a href="https://zappysys.com/products/odbc-powerpack/data-gateway/">ZappySys Data Gateway</a> its part of ODBC PowerPack. We will then use Linked Server in SQL Server to Link API Service and then we will issue OPENROWSET queries from Power BI to SQL Server and it will then call REST API via ZappySys Data Gateway.
<h3>Step-By-Step</h3>
<ol>
 	<li>First <a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">read this article carefully</a> how to query REST API in SQL Server.</li>
 	<li>Once linked server is configured we are ready to issue API query in Power BI.</li>
 	<li>Click <strong>Get Data</strong> in Power BI, select <strong>SQL Server Database</strong></li>
 	<li>Enter your server name and any database name</li>
 	<li>Select Mode as <strong>DirectQuery</strong></li>
 	<li>Click on <strong>Advanced</strong> and enter query like below (we are assuming you have created JSON Data Source in Data Gateway and defined linked server (Change name below).
<pre>select * from OPENQUERY(YOUR_LINKED_SERVER_NAME,
'SELECT * FROM value WITH( SRC=''https://services.odata.org/V3/Northwind/Northwind.svc/Orders?$format=json''  )'
)</pre>

<div class="wp-caption alignnone">
 <a   href="https://zappysys.com/blog/wp-content/uploads/2019/05/power-bi-directquery-option-import-rest-api.png">
  <img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/05/power-bi-directquery-option-import-rest-api.png"
         alt="DirectQuery option for Power BI (Read REST API Data Example using SQL Server Linked Server and ZappySys Data Gateway)" >
 </a> 
<p class="wp-caption-text">DirectQuery option for Power BI (Read REST API Data Example using SQL Server Linked Server and ZappySys Data Gateway)</p>
</div>

</li>
 	<li>Click OK and Load data ... That's it. Now your REST API data is linked rather than imported.</li>
</ol></div>
<h2>Performance Tips for REST API / XML SOAP Calls</h2>
<div class="content_block" id="custom_post_widget-4455">While calling APIs you may face some performance issues. There are a few tips you can consider to speed up things.
<h4><span style="font-size: 14pt;"><strong>Use Server-side filtering if possible in URL or Body Parameters</strong></span></h4>
Many API supports filtering your data by URL parameters or via Body. Whenever possible try to use such features.  Here is an example of <a href="http://www.odata.org/getting-started/basic-tutorial/" target="_blank" rel="noopener">odata API</a>, In the below query the first query is faster than the second query because in the first query we filter at the server.
<pre class="lang:tsql decode:true">SELECT * FROM value
WITH(
	 Src='https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json&amp;$filter=Country eq ''USA'''
	,DataFormat='Odata'
)

-- Slow query - Client-side filtering
SELECT * FROM value
WHERE Country ='USA'
WITH(
	 Src='https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json'
	,DataFormat='Odata'
)</pre>
<h4><span style="font-size: 14pt;"><strong>Avoid Special features in SQL Query (e.g. WHERE, Group By, Order By)</strong></span></h4>
ZappySys API engine triggers client-side processing if special features are used in Query. Following SQL Features will trigger Client-Side processing which is several times slower than server-side processing. So always try to use simple query (Select col1, col2 .... from mytable )
<ul>
 	<li>WHERE Clause</li>
 	<li>GROUP BY Clause</li>
 	<li>HAVING Clause</li>
 	<li>ORDER BY</li>
 	<li>FUNCTIONS (e.g. Math, String, DateTime, Regex... )</li>
</ul>
LIMIT clause does not trigger client-side processing.
<h4><span style="font-size: 14pt;"><strong>Consider using pre-generated Metadata / Cache File</strong></span></h4>
Use META option in WITH Clause to use static metadata (Pre-Generated)There are two more options to speedup query processing time. Check <a href="https://zappysys.com/blog/caching-metadata-odbc-drivers-performance/" target="_blank" rel="noopener">this article</a> for details.
<ol>
 	<li>
<pre class="lang:default decode:true">select * from value WITH( meta='c:\temp\meta.txt' )
--OR--
select * from value WITH( meta='my-meta-name' )
--OR--
select * from value WITH( meta='[ {"Name": "col1",&amp;nbsp;"Type": "String", Length: 100},&amp;nbsp;{"Name": "col2",&amp;nbsp;"Type": "Int32"} ...... ]' )</pre>
</li>
 	<li>Enable Data Caching Options (Found on <strong>Property Grid</strong> &gt; <strong>Advanced</strong> Mode Only )</li>
</ol>
<h4><span style="font-size: 14pt;"><strong>Consider using Metadata / Data Caching Option</strong></span></h4>
ZappySys API drivers support Caching Metadata and Data rows to speed up query processing. If your data doesn't change often then you can enable this option to speed up processing significantly.

Check <a href="https://zappysys.com/blog/caching-metadata-odbc-drivers-performance/" target="_blank" rel="noopener">this article</a> for details how to enable Data cache / metadata cache feature for datasource level or query level.

To define cache option at query level you can use like below.
<pre class="">SELECT * FROM $
WITH 
(  SRC='https://myhost.com/some-api'
  ,CachingMode='All'  --cache metadata and data rows both
  ,CacheStorage='File' --or Memory
  ,CacheFileLocation='c:\temp\myquery.cache'
  ,CacheEntryTtl=300 --cache for 300 seconds
)
</pre>
&nbsp;

&nbsp;
<h4><strong><span style="font-size: 14pt;">Use --FAST Option to enable Stream Mode</span></strong></h4>
ZappySys JSON / XML drivers support <strong>--FAST</strong> suffix for Filter. By using this suffix after Filter driver enables Stream Mode, <a href="https://zappysys.com/blog/caching-metadata-odbc-drivers-performance/#Reading_Large_Files_Streaming_Mode_for_XML_JSON" target="_blank" rel="noopener">Read this article</a> to understand how this works.
<pre class="lang:default decode:true">SELECT * FROM $ 
LIMIT 10 --//add this just to test how fast you can get 10 rows
WITH(
  Filter='$.LargeArray[*]--FAST' --//Adding --FAST option turn on STREAM mode (large files)
 ,SRC='https://zappysys.com/downloads/files/test/large_file_100k_largearray_prop.json.gz'
 --,SRC='c:\data\large_file.json.gz'
 ,IncludeParentColumns='False'  --//This Must be OFF for STREAM mode (read very large files)
 ,FileCompressionType='GZip' --Zip or None (Zip format only available for Local files)
)</pre>
&nbsp;</div>
<div class="content_block" id="custom_post_widget-5891"><h2>Working with Gateways in Power BI (Schedule Import)</h2>
If the data needs to be updated, it is necessary to create a gateway on-premises. In this new section, we will install a Power BI Gateway and in the next section schedule it to update the REST API information.
<ol>
 	<li>In the last section, we Published the report. Power BI may ask you to <strong>SIGN IN.</strong>
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/sign-in-power-bi.png"><img loading="lazy" decoding="async" class="size-full wp-image-2879" src="https://zappysys.com/blog/wp-content/uploads/2018/03/sign-in-power-bi.png" alt="Sign in Power BI" width="762" height="361" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/sign-in-power-bi.png 762w, https://zappysys.com/blog/wp-content/uploads/2018/03/sign-in-power-bi-300x142.png 300w" sizes="(max-width: 762px) 100vw, 762px" /></a>
<p class="wp-caption-text">Sign in in Power BI</p>

</div></li>
 	<li>Select the Workspace and select Datasets
<div class="wp-caption">

[caption id="attachment_10110" align="alignnone" width="702"]<a href="https://zappysys.com/blog/wp-content/uploads/2019/01/power-bi-my-workspace-dataset.png"><img loading="lazy" decoding="async" class="wp-image-10110 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/power-bi-my-workspace-dataset.png" alt="power-bi-my-workspace-dataset" width="702" height="372" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/power-bi-my-workspace-dataset.png 702w, https://zappysys.com/blog/wp-content/uploads/2019/01/power-bi-my-workspace-dataset-300x159.png 300w" sizes="(max-width: 702px) 100vw, 702px" /></a> Go to workspace and dataset[/caption]
<p class="wp-caption-text">Go to workspace and dataset</p>

</div></li>
 	<li>Right-click the report and select <strong>Settings</strong>.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/report-power-bi-settings.png"><img loading="lazy" decoding="async" class="size-full wp-image-2877" src="https://zappysys.com/blog/wp-content/uploads/2018/03/report-power-bi-settings.png" alt="Define settings for Power BI report" width="535" height="325" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/report-power-bi-settings.png 535w, https://zappysys.com/blog/wp-content/uploads/2018/03/report-power-bi-settings-300x182.png 300w" sizes="(max-width: 535px) 100vw, 535px" /></a>
<p class="wp-caption-text">Specify settings for the report</p>

</div></li>
 	<li>The system will ask for a Gateway. Stay here.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway.png"><img loading="lazy" decoding="async" class="size-full wp-image-2862" src="https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway.png" alt="add power bi gateway" width="1068" height="380" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway.png 1068w, https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway-300x107.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway-768x273.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway-1024x364.png 1024w" sizes="(max-width: 1068px) 100vw, 1068px" /></a>
<p class="wp-caption-text">Add Power BI Gateway</p>

</div></li>
 	<li>Use the following link to install a Data Gateway:
<pre class="lang:php highlight:0 decode:true">https://docs.microsoft.com/en-us/power-bi/service-gateway-onprem</pre>
</li>
 	<li>Run the installer and press <strong>Next</strong>
<div class="wp-caption">

<img loading="lazy" decoding="async" class="size-full wp-image-2888" src="https://zappysys.com/blog/wp-content/uploads/2018/03/on-premises-gateway-installer-PB.png" alt="Initial gateway window for installation" width="634" height="504" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/on-premises-gateway-installer-PB.png 634w, https://zappysys.com/blog/wp-content/uploads/2018/03/on-premises-gateway-installer-PB-300x238.png 300w" sizes="(max-width: 634px) 100vw, 634px" />
<p class="wp-caption-text">Gateway installer</p>

</div></li>
 	<li>Select the option On-premises data gateway (recommended). This option allows access to multiple users and can be used by more applications than Power BI.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/choose-power-bi-on-premises-data-pb.png"><img loading="lazy" decoding="async" class="size-full wp-image-2889" src="https://zappysys.com/blog/wp-content/uploads/2018/03/choose-power-bi-on-premises-data-pb.png" alt="Choose Power BI gateway" width="631" height="501" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/choose-power-bi-on-premises-data-pb.png 631w, https://zappysys.com/blog/wp-content/uploads/2018/03/choose-power-bi-on-premises-data-pb-300x238.png 300w" sizes="(max-width: 631px) 100vw, 631px" /></a>
<p class="wp-caption-text">Choose Power BI option</p>

</div></li>
 	<li>The installer will show a warning message.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-warning-PB-msg.png"><img loading="lazy" decoding="async" class="size-full wp-image-2891" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-warning-PB-msg.png" alt="Warning message gateway installation" width="628" height="447" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-warning-PB-msg.png 628w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-warning-PB-msg-300x214.png 300w" sizes="(max-width: 628px) 100vw, 628px" /></a>
<p class="wp-caption-text">Warning message during installation</p>

</div></li>
 	<li>Select the path to install and check the I accept the terms.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-accept.png"><img loading="lazy" decoding="async" class="size-full wp-image-2916" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-accept.png" alt="accept terms" width="636" height="441" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-accept.png 636w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-accept-300x208.png 300w" sizes="(max-width: 636px) 100vw, 636px" /></a>
<p class="wp-caption-text">Accept terms</p>

</div></li>
 	<li>Specify the email address to use the gateway.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-email-address.png"><img loading="lazy" decoding="async" class="size-full wp-image-2895" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-email-address.png" alt="Register email in gateway installation" width="627" height="578" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-email-address.png 627w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-email-address-300x277.png 300w" sizes="(max-width: 627px) 100vw, 627px" /></a>
<p class="wp-caption-text">Register email address</p>

</div></li>
 	<li>After entering the email, write the gateway name and a recovery key. Make sure to confirm the recovery key.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-name-recovery-key-confirm.png"><img loading="lazy" decoding="async" class="size-full wp-image-2896" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-name-recovery-key-confirm.png" alt="Specify name and recovery key" width="629" height="487" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-name-recovery-key-confirm.png 629w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-name-recovery-key-confirm-300x232.png 300w" sizes="(max-width: 629px) 100vw, 629px" /></a>
<p class="wp-caption-text">Enter recovery key</p>

</div></li>
</ol>
&nbsp;</div>
<div class="content_block" id="custom_post_widget-5892"><h2>Manage gateways and configure the schedule</h2>
Once that the gateway is installed we will configure it and add the connection strings.
<ol>
 	<li>The next step is to go to manage gateway
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway.png"><img loading="lazy" decoding="async" class="size-full wp-image-2912" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway.png" alt="Power BI - Manage Gateway Setting" width="1068" height="380" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway.png 1068w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway-300x107.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway-768x273.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway-1024x364.png 1024w" sizes="(max-width: 1068px) 100vw, 1068px" /></a>
<p class="wp-caption-text">Power BI - Manage Gateway Setting</p>

</div></li>
 	<li>In order to get the connection string, we will need the connection string of the ZappySys JSON Driver. In the first section of this post, we explained how to configure it. Press<strong> Copy Connection String</strong>
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-data-source-copy-connection-string.png"><img loading="lazy" decoding="async" class="size-full wp-image-2866" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-data-source-copy-connection-string.png" alt="ZappySys connection properties" width="607" height="599" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-data-source-copy-connection-string.png 607w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-data-source-copy-connection-string-300x296.png 300w" sizes="(max-width: 607px) 100vw, 607px" /></a>
<p class="wp-caption-text">Connection properties</p>

</div></li>
 	<li>Once that the data is copied, add a New data Source. In <strong>Data Source Name</strong>, enter the Data Source Name of the ZappySys JSON driver in step 13 and in Data Source Type, select ODBC. In connection string copy and paste from the clipboard of the step 13 and press <strong>Add</strong>.
<div class="wp-caption">

[caption id="attachment_10113" align="alignnone" width="720"]<a href="https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string.png"><img loading="lazy" decoding="async" class="wp-image-10113 size-large" src="https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string-1024x536.png" alt="gateway-data-source-name-connection-string" width="720" height="377" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string-1024x536.png 1024w, https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string-300x157.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string-768x402.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string.png 1043w" sizes="(max-width: 720px) 100vw, 720px" /></a> ZappySys connection properties in Power BI[/caption]
<p class="wp-caption-text">ZappySys connection properties in Power BI</p>

</div></li>
 	<li>Once added the gateway. You can see the schedule refresh to <strong>On </strong>and Add another time to add the time where you want to refresh the data.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-schedule.png"><img loading="lazy" decoding="async" class="size-full wp-image-2875" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-schedule.png" alt="Schedule gateway" width="451" height="401" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-schedule.png 451w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-schedule-300x267.png 300w" sizes="(max-width: 451px) 100vw, 451px" /></a>
<p class="wp-caption-text">Schedule gateway</p>

</div></li>
</ol>
&nbsp;</div>
<h2>Conclusion</h2>
<p>In this article, we guide you through the process of configuring the ZappySys Power Pack, focusing on the ZappySys driver for JSON. This driver is instrumental in extracting data from REST APIs or JSON files. Follow these steps to seamlessly add the extracted data to Power BI and generate insightful reports.</p>
<p>Additionally, we&#8217;ll walk you through the configuration of the Power BI gateway, ensuring that the data is refreshed on a specified schedule for up-to-date and accurate reporting. To try this configuration yourself, <a href="//zappysys.com/products/odbc-powerpack/download/">download ODBC PowerPack</a> and embark on a journey of efficient data extraction and reporting.</p>
<h2>References</h2>
<ul>
<li><a href="https://powerbi.microsoft.com/en-us/">What is Power BI?</a></li>
<li><a href="https://powerbi.microsoft.com/en-us/gateway/">Keep your dashboards and reports up-to-date with your on-premises data sources</a></li>
<li><a href="https://www.youtube.com/watch?v=PL7wffKeOrc">Power BI &#8211; Read REST API / JSON File / XML File / SOAP (Pagination, OAuth, OData)</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/">How to import REST API in Power BI (Load JSON / SOAP XML)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
