<?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>power bi Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/power-bi/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/power-bi/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Wed, 19 Mar 2025 07:03:31 +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>power bi Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/power-bi/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Import Google Analytics data into SQL Server / Reporting / ETL</title>
		<link>https://zappysys.com/blog/import-google-analytics-data-sql-server-reporting-etl/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 25 May 2019 19:17:14 +0000</pubDate>
				<category><![CDATA[Google API]]></category>
		<category><![CDATA[ODBC Gateway]]></category>
		<category><![CDATA[REST API]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[T-SQL (SQL Server)]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[openquery]]></category>
		<category><![CDATA[power bi]]></category>
		<category><![CDATA[ssms]]></category>
		<category><![CDATA[ssrs]]></category>
		<category><![CDATA[t-sql]]></category>
		<category><![CDATA[tableau]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7003</guid>

					<description><![CDATA[<p>Introduction In our previous article we saw how to read Google Analytics data using SSIS. But what if you don&#8217;t use SSIS and you still like to Import Google Analytics data into SQL Server or Read inside other Reporting / ETL Apps (e.g. Excel, Power BI, MS Access &#8230; and many more). Not all BI [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/import-google-analytics-data-sql-server-reporting-etl/">Import Google Analytics data into SQL Server / Reporting / ETL</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/google-analytics-logo.png"><img decoding="async" class=" wp-image-7056 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/05/google-analytics-logo.png" alt="" width="162" height="162" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/google-analytics-logo.png 250w, https://zappysys.com/blog/wp-content/uploads/2019/05/google-analytics-logo-150x150.png 150w" sizes="(max-width: 162px) 100vw, 162px" /></a>In our previous article we saw how to <a href="https://zappysys.com/blog/get-data-from-google-analytics-in-ssis-using-rest-api-call/">read Google Analytics data using SSIS</a>. But what if you don&#8217;t use SSIS and you still like to Import Google Analytics data into SQL Server or Read inside other Reporting / ETL Apps (e.g. Excel, Power BI, MS Access &#8230; and many more). Not all BI tools comes with native driver / connectivity for Google Analytics. Sometimes they do offer Google Analytics connectivity but don&#8217;t offer feature you looking for (e.g. Sort, Segment Filter). In such case you have to look for solution outside.</p>
<p>Well not to worry we will show you how simple it is to connect to Google Analytics using <a href="https://zappysys.com/products/odbc-powerpack/odbc-json-rest-api-driver/" target="_blank" rel="noopener">ZappySys JSON Driver (For REST API / Files)</a> in few mins. This driver is one of the best REST API drivers you can find in the market. It is so generic that it can virtually access any REST API you may find internally or on public sites (e.g. Facebook, Salesforce, Azure, AWS). Check <a href="https://zappysys.com/blog/category/odbc-powerpack/odbc-drivers/json-rest-api-driver/" target="_blank" rel="noopener">these articles</a> to see many more use cases of JSON Driver.</p>
<p>At the end of this article you will learn how to Query Google Analytics data in <strong>SSMS</strong> like below (Yes that&#8217;s correct .. Pretty Awesome!!! ).</p>
<div id="attachment_7046" style="width: 649px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7046" class="size-full wp-image-7046" src="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png" alt="Import Google Analytics Data into SQL Server Table (using T-SQL Code)" width="639" height="538" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png 639w, https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server-300x253.png 300w" sizes="(max-width: 639px) 100vw, 639px" /></a><p id="caption-attachment-7046" class="wp-caption-text">Import Google Analytics Data into SQL Server Table (using T-SQL Code)</p></div>
<div class="content_block" id="custom_post_widget-7048"><h2>Requirements</h2>
This article talks about few tools and techniques in order to load API data in SQL Server. Please make sure following prerequisites are met.
<ol>
 	<li>Download and Install <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> (This includes XML / JSON / REST API and few other drivers for SQL Server and ODBC connectivity in tools like Excel, Power BI, SSRS)</li>
 	<li>Make sure you have access to SQL Server Instance. If you cant find one still want to try what is mentioned in this article then install <a href="https://www.microsoft.com/en-us/sql-server/sql-server-editions-express" target="_blank" rel="noopener">FREE SQL Express Edition</a></li>
 	<li>Confirm that you have SSMS Installed. If you don't have then you can download <a href="https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-2017">from here</a>.</li>
</ol></div>
<h2>Testing Google Analytics API</h2>
<p>If you are new to Google Analytics API then read little bit about <a href="https://developers.google.com/analytics/devguides/reporting/core/v3/reference#data_request" target="_blank" rel="noopener">Google Analytics REST API here</a>. Google also offers a really good way to test Analytics API using <a href="https://ga-dev-tools.appspot.com/query-explorer/" target="_blank" rel="noopener">Query Explorer Tool here</a>. So please check that and understand how to craft correct REST API URL which will be used in the next section.</p>
<div id="attachment_7021" style="width: 908px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7021" class="size-full wp-image-7021" src="https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer.png" alt="Using Google Analytics Query Explorer Tool - Create REST API Url (Dimension / Metrics Selection Browser)" width="898" height="1379" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer.png 898w, https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer-195x300.png 195w, https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer-768x1179.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer-667x1024.png 667w" sizes="(max-width: 898px) 100vw, 898px" /></a><p id="caption-attachment-7021" class="wp-caption-text">Using Google Analytics Query Explorer Tool &#8211; Create REST API Url (Dimension / Metrics Selection Browser)</p></div>
<h3>Sample Google Analytics API Response</h3>
<p>Behind the scene here is how API Request and Response Looks like for Google Analytics REST API. Notice that <strong>Authorization</strong> Header in below request is automatically added by ZappySys Driver or Query Testing tool above. Also notice <strong>nextLink</strong> attribute in response, its used to fetch more data. By default each response contains upto 10000 rows.</p>
<p><strong>Request</strong></p><pre class="crayon-plain-tag">GET https://www.googleapis.com/analytics/v3/data/ga?ids=ga:185737326&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:avgSessionDuration&amp;dimensions=ga:date
Authorization: Bearer ya29.GlwUxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</pre><p>
<strong>Response</strong></p><pre class="crayon-plain-tag">{
    "kind": "analytics#gaData",
    "id": "https://www.googleapis.com/analytics/v3/data/ga?ids=ga:123456789&amp;dimensions=ga:date&amp;metrics=ga:avgSessionDuration&amp;start-date=30daysAgo&amp;end-date=yesterday",
    "query": {
        "start-date": "30daysAgo",
        "end-date": "yesterday",
        "ids": "ga:123456789",
        "dimensions": "ga:date",
        "metrics": ["ga:avgSessionDuration"],
        "start-index": 1,
        "max-results": 1000
    },
    "itemsPerPage": 1000,
    "totalResults": 30,
    "selfLink": "https://www.googleapis.com/analytics/v3/data/ga?ids=ga:123456789&amp;dimensions=ga:date&amp;metrics=ga:avgSessionDuration&amp;start-date=30daysAgo&amp;end-date=yesterday",
    "nextLink": "https://www.googleapis.com/analytics/v3/data/ga?ids=ga:123456789&amp;dimensions=ga:date&amp;metrics=ga:avgSessionDuration&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;start-index=10001&amp;max-results=10000",
    "profileInfo": {
        "profileId": "123456789",
        "accountId": "33445566",
        "webPropertyId": "UA-33445566-3",
        "internalWebPropertyId": "454545454",
        "profileName": "All Web Site Data",
        "tableId": "ga:123456789"
    },
    "containsSampledData": false,
    "columnHeaders": [
        {
            "name": "ga:date",
            "columnType": "DIMENSION",
            "dataType": "STRING"
        },
        {
            "name": "ga:avgSessionDuration",
            "columnType": "METRIC",
            "dataType": "TIME"
        }
    ], "totalsForAllResults": {
        "ga:avgSessionDuration": "49.3779488037477"
    },
    "rows": [ 
		["20190425", "401.38912133891213"], 
		["20190426", "512.49723756906077"], 
		["20190427", "11.53488372093024"], 
		["20190428", "432.148648648648646"], 
		["20190429", "234.650735294117645"],
		.......
		.......
		.......
		.......
		["20190525", "74.123435294117645"]
	]
}</pre><p>
&nbsp;</p>
<h2>Creating Google API Project (Obtain Client ID / Secret)</h2>
<p>Very first step to call any Google API including Google Analytics is to create Google API Project and register OAuth App to obtain <strong>Client ID</strong> and <strong>Client Secret</strong>. If you dont want to go through this hassle and start easy way then ZappySys offers Inbuilt Default App on <strong>OAuth</strong> Connection UI but <strong>we strongly recommend</strong> you create your own app rather than using Default App because in Default App API call limit is shared by many. Your data is never shared with ZappySys in any case even you use Default App.</p>
<p>Here is how to <a href="https://zappysys.com/blog/register-google-oauth-application-get-clientid-clientsecret/">create API Project to call Google API</a>. Once you create Google API Project make sure you <strong>enable</strong> <strong>Google Analytics API</strong>.</p>
<p>So once you have <strong>Client ID</strong> and <strong>Client Secret</strong> we can move forward to the next step.</p>
<h2>Loading Google Analytics data into SQL Server</h2>
<p>In our previous article we saw in depth general idea on how to <a href="https://zappysys.com/blog/import-rest-api-json-sql-server/">import REST API data in SQL Server (T-SQL Script)</a> without relying on any ETL tools.  Now lets look at step by step on <strong>how to load Google Analytics data into SQL Server</strong>.</p>
<p>In this example, our goal is to extract a Google Analytics report which shows average session duration and new users count by date (For last 30 days).</p>
<h3>Setup ZappySys Data Gateway</h3>
<p>Very first step to access any REST API Data inside SQL Server is to configure ZappySys Data Gateway. We covered this in <a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">previous article</a>.  But here are high level steps for initial setup of Data Gateway.</p>
<ol>
<li>Search for Gateway in Start menu and  Select ZappySys Data Gateway
<div id="attachment_5283" style="width: 410px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5283" class="size-full wp-image-5283" src="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png" alt="Open ZappySys Data Gateway" width="400" height="315" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png 400w, https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway-300x236.png 300w" sizes="(max-width: 400px) 100vw, 400px" /></a><p id="caption-attachment-5283" class="wp-caption-text">Open ZappySys Data Gateway</p></div></li>
<li>Create <strong>new User</strong> in Data gateway on Users tab. Enter username and password (we will use this when we create Linked Server) . <strong><strong><strong>Check Admin Option</strong></strong></strong>
<div id="attachment_5285" style="width: 426px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-user.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5285" class="size-full wp-image-5285" src="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-user.png" alt="Add Data Gateway User" width="416" height="444" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-user.png 416w, https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-user-281x300.png 281w" sizes="(max-width: 416px) 100vw, 416px" /></a><p id="caption-attachment-5285" class="wp-caption-text">Add Data Gateway User</p></div></li>
</ol>
<h3>Setup Google Analytics API Data Source in Gateway / ODBC</h3>
<p>Once gateway user is setup, now lets create a new Data Source for Google Analytics API. In this section we will talk how to create data source in gateway but most instructions can be used to create data source in ODBC too. At the end of this article we explained how to Launch ODBC Datasource UI. Step#1 and 2 are only different, all other steps same in ODBC DSN creation.</p>
<ol>
<li>Click Add Data Source option (Select Native &#8211; JSON Driver )
<div id="attachment_5284" style="width: 568px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-data-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5284" class="size-full wp-image-5284" src="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-data-source.png" alt="Add Gateway Data Source (Native JSON Driver)" width="558" height="533" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-data-source.png 558w, https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-data-source-300x287.png 300w" sizes="(max-width: 558px) 100vw, 558px" /></a><p id="caption-attachment-5284" class="wp-caption-text">Add Gateway Data Source (Native JSON Driver)</p></div></li>
<li>Click Edit to configure data source
<div id="attachment_5440" style="width: 572px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-2-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5440" class="size-full wp-image-5440" src="https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-2-2.png" alt="Edit Gateway Data Source Settings" width="562" height="385" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-2-2.png 562w, https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-2-2-300x206.png 300w" sizes="(max-width: 562px) 100vw, 562px" /></a><p id="caption-attachment-5440" class="wp-caption-text">Edit Gateway Data Source Settings</p></div></li>
<li>Now lets configure Driver settings.  Click on Load Connection String button.
<div id="attachment_7024" style="width: 996px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/zappysys-driver-load-connectionstring.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7024" class="size-full wp-image-7024" src="https://zappysys.com/blog/wp-content/uploads/2019/05/zappysys-driver-load-connectionstring.png" alt="Load ZappySys Driver ConnectionString to configure UI" width="986" height="454" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/zappysys-driver-load-connectionstring.png 986w, https://zappysys.com/blog/wp-content/uploads/2019/05/zappysys-driver-load-connectionstring-300x138.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/zappysys-driver-load-connectionstring-768x354.png 768w" sizes="(max-width: 986px) 100vw, 986px" /></a><p id="caption-attachment-7024" class="wp-caption-text">Load ZappySys Driver ConnectionString to configure UI</p></div></li>
<li>Enter the following ConnectionString to get started with predefined settings.<br />
Change ids (<strong>111223344</strong> to your own Profile ID in <strong>DataPath URL</strong>). Other URL Parameters explained in next section.<br />
<pre class="crayon-plain-tag">DRIVER={ZappySys JSON Driver};
DataPath='https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:avgSessionDuration,ga:newUsers&amp;dimensions=ga:date';
DataConnectionType=OAuth;
ScopeSeparator='{space}';
Scope='https://www.googleapis.com/auth/analytics https://www.googleapis.com/auth/analytics.readonly';
ServiceProvider=Google;
Filter='$.rows[*]';
ArrayTransformType=TransformSimpleTwoDimensionalArray;
ArrayTransColumnNameFilter='$.columnHeaders[*].name';
RequestMethod='GET';
NextUrlAttributeOrExpr='$.nextLink';
ClientId='xxxxxxxxxxxx';
ClientSecret='yyyyyyyyyyyyyy';
UseCustomApp='True'</pre>
&nbsp;</li>
<li>URL used in DataPath is most important (parameters explained below) . You can use   <a href="https://ga-dev-tools.appspot.com/query-explorer/" target="_blank" rel="noopener">Query Explorer Tool here</a> to build same URL.<br />
<pre class="crayon-plain-tag">https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:avgSessionDuration,ga:newUsers&amp;dimensions=ga:date</pre>
<strong><span style="text-decoration: underline;">Parameters Explained </span><br />
</strong><br />
Here is some required parameters used in above REST API URL.<br />
<strong>ids</strong>=ga:11223344<br />
This is your Profile ID which you like to extract.  <a href="https://developers.google.com/analytics/devguides/reporting/core/v3/reference#ids">Read more</a><strong><br />
start-date</strong>=30daysAgo<br />
This can be yyyy-MM-dd or some other some predefined date keywords (e.g today, yesterday 10daysAgo). <a href="https://developers.google.com/analytics/devguides/reporting/core/v3/reference#startDate" target="_blank" rel="noopener">Read more</a>.<br />
<strong>end-date</strong>=yesterday<br />
Same as above<br />
<strong>metrics</strong>=ga:avgSessionDuration,ga:newUsers<br />
This can be comma separated list of metrics you like to extract (max 10). <a href="https://developers.google.com/analytics/devguides/reporting/core/v3/reference#metrics" target="_blank" rel="noopener">Read more</a>.<br />
<strong>dimensions</strong>=ga:date<br />
This can be comma separated list of metrics you like to extract (max 7). <a href="https://developers.google.com/analytics/devguides/reporting/core/v3/reference#dimensions" target="_blank" rel="noopener">Read more</a>.</li>
<li>Now its time to configure <a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">OAuth</a> settings. Click on Configure Connection. Enter Client ID and Client Secret Obtained in the previous section (<a href="https://zappysys.com/blog/register-google-oauth-application-get-clientid-clientsecret/" target="_blank" rel="noopener">see here</a>) and then click Generate Token as below.
<div id="attachment_7043" style="width: 1006px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/configure-google-analytics-api-driver-data-source-oauth.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7043" class="size-full wp-image-7043" src="https://zappysys.com/blog/wp-content/uploads/2019/05/configure-google-analytics-api-driver-data-source-oauth.png" alt="Configure Google API Data Source / DSN (Google Analytics API Example)" width="996" height="870" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/configure-google-analytics-api-driver-data-source-oauth.png 996w, https://zappysys.com/blog/wp-content/uploads/2019/05/configure-google-analytics-api-driver-data-source-oauth-300x262.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/configure-google-analytics-api-driver-data-source-oauth-768x671.png 768w" sizes="(max-width: 996px) 100vw, 996px" /></a><p id="caption-attachment-7043" class="wp-caption-text">Configure Google API Data Source / DSN (Google Analytics API Example)</p></div></li>
<li>Thats it now can click on Preview Tab and run sample query like below.<br />
<pre class="crayon-plain-tag">select * from $</pre>
<strong>&#8211;OR&#8211;</strong><br />
(Select Table name from dropdown and generate default query and then you can add alias , remove unwanted columns)<br />
<pre class="crayon-plain-tag">SELECT 
"ga:date" date, 
"ga:avgSessionDuration" avgSessionDuration,
"ga:newUsers" newUsers
FROM "rows"</pre>
<strong>&#8211;OR&#8211;</strong><br />
(Type custom query with your own URL generated <a href="https://ga-dev-tools.appspot.com/query-explorer/" target="_blank" rel="noopener">from here</a>, Change Profile ID &#8211; from 11223344 to your own id)<br />
<pre class="crayon-plain-tag">SELECT * FROM $
WITH(
	 Src='https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:avgSessionDuration,ga:newUsers&amp;dimensions=ga:date'
	,IncludeParentColumns='False'
)</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2019/05/query-google-analytics-data.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-7045" src="https://zappysys.com/blog/wp-content/uploads/2019/05/query-google-analytics-data.png" alt="" width="652" height="608" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/query-google-analytics-data.png 652w, https://zappysys.com/blog/wp-content/uploads/2019/05/query-google-analytics-data-300x280.png 300w" sizes="(max-width: 652px) 100vw, 652px" /></a></li>
</ol>
<h3>Create Linked Server in SQL Server using T-SQL Script</h3>
<p>Once our Gateway Data Source is configured we can now move to SQL Server Part to define Linked Server.</p>
<p>Here is how you can define linked server to access Google Analytics Data inside SQL Server. There are two ways to create Linked Server (1)  via T-SQL script (2) via SSMS UI)</p>
<p>Here is how to create using Script.</p><pre class="crayon-plain-tag">USE [master]
GO

--drop existing linked server for same name if already found
EXEC master.dbo.sp_dropserver @server=N'GOOGLE_ANALYTICS_LS', @droplogins='droplogins'
GO

EXEC master.dbo.sp_addlinkedserver 
	@server = N'GOOGLE_ANALYTICS_LS', 
	@srvproduct=N'', 
	@provider=N'SQLNCLI', 
	@datasrc=N'localhost,5000', --this is host name and port number where  ZappySys Data Gateway is running
	@catalog=N'ZS-GA' --this must be same name as defined on Data Source tab Grid on ZappySys Data Gateway

EXEC master.dbo.sp_addlinkedsrvlogin 
	@rmtsrvname=N'GOOGLE_ANALYTICS_LS',
	@useself=N'False',
	@locallogin=NULL,
	@rmtuser=N'SOME-GATEWAY-USER', -- user name created on ZappySys Data Gateway
	@rmtpassword='SOME-GATEWAY-PASSWORD' -- password for ZappySys Data Gateway user
GO</pre><p>
&nbsp;</p>
<h3>Create Microsoft SQL Server Linked Server using SSMS UI</h3>
<div class="content_block" id="custom_post_widget-5289">Once you configured data source in Gateway, we can now setup Linked Server in SQL Server to query API data.
<ol style="margin-left: 10px;">
 	<li>Assuming you have installed SQL Server and SSMS. If not then get both for FREE from here: <a href="https://www.microsoft.com/en-us/sql-server/sql-server-editions-express">Get SQL Server Express</a> and  <a href="https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms" target="_blank" rel="noopener">Get SSMS</a></li>
 	<li>Open SSMS and connect to SQL Server.</li>
 	<li>Go to Root &gt; Server Objects &gt; Linked Servers node. Right click and click <strong>New Linked Server...
</strong>
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/create-new-linked-server-ssms.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/03/create-new-linked-server-ssms.png" alt="Add Linked Server in SQL Server" />
</a>
<p class="wp-caption-text">Add Linked Server in SQL Server</p>

</div></li>
 	<li> Now enter linked server name, select Provider as SQL Native Client</li>
 	<li>Enter data source as <strong><span class="lang:default decode:true crayon-inline">GatewayServerName,PORT_NUMBER</span></strong> where server name is where ZappySys Gateway is running (Can be same as SQL Server machine or remote machine). Default PORT_NUMBER is 5000 but confirm on Data gateway &gt; General tab incase its different.</li>
 	<li>Enter Catalog Name. This must match name from Data gateway Data sources grid &gt; Name column
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssms-sql-server-configure-linked-server-2.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssms-sql-server-configure-linked-server-2.png" alt="Configure Linked Server Provider, Catalog, Server, Port for ZappySys Data Gateway Connection" />
</a>
<p class="wp-caption-text">Configure Linked Server Provider, Catalog, Server, Port for ZappySys Data Gateway Connection</p>
</div>
<div style="color: #31708f;background-color: #d9edf7;border-color: #bce8f1;padding: 15px;margin-bottom: 20px;border: 1px solid transparent;border-radius: 4px;">
<strong>INFO:</strong><br/>
<ul>
    <li>
      For <strong>SQL Server 2012, 2014, 2016, 2017, and 2019</strong>, use the <em>SQL Server Native Client 11.0</em> as the Provider.
    </li>
    <li>
      For <strong>SQL Server 2022 or higher</strong>, use the <em>Microsoft OLE DB Driver for SQL Server</em> as the Provider.
    </li>
  </ul>
</div></li>
 	<li>Click on Security Tab and select last option "<strong>Be made using this security context</strong>". Enter your gateway user account here.</li>
<li>
        <p>Optional: Under the Server Options Tab, Enable <b>RPC</b> and <b>RPC Out</b> and Disable Promotion of Distributed Transactions<b>(MSDTC)</b>.</p>
		<div class="wp-caption alignnone">
			<img decoding="async" class="block margin-bottom-10 img-thumbnail" src="https://zappysys.com/blog/wp-content/uploads/2018/11/linked-server-options-rpc-msdtc.png" title="RPC and MSDTC Settings" alt="RPC and MSDTC Settings" />
			<p class="wp-caption-text">RPC and MSDTC Settings</p>
		</div>
        <hr />
        <p>
            You need to enable RPC Out if you plan to use <b><i>EXEC(...) AT [MY_LINKED_SERVER_NAME]</i></b> rather than OPENQUERY.
            <br />
            If don't enabled it, you will encounter the <i>'Server "MY_LINKED_SERVER_NAME" is not configured for RPC'</i> error.
        </p>
        <p>
            Query Example:
            <code class="sql">EXEC('Select * from Products') AT [MY_LINKED_SERVER_NAME]</code>
        </p>
        <hr />
        <p>
            If you plan to use <b><i>'INSERT INTO...EXEC(....) AT [MY_LINKED_SERVER_NAME]'</i></b> in that case you need to Disable Promotion of Distributed Transactions(MSDTC).
            <br />
            If don't disabled it, you will encounter the <i>'The operation could not be performed because OLE DB provider "SQLNCLI11/MSOLEDBSQL" for linked server "MY_LINKED_SERVER_NAME" was unable to begin a distributed transaction.'</i> error.
        </p>
        <p>
            Query Example:
<pre class="">Insert Into dbo.Products 
EXEC('Select * from Products') AT [MY_LINKED_SERVER_NAME]</pre>
        </p>
        <hr />
</li>
 	<li>Click OK to save Linked Server</li>
 	<li>In SSMS execute below SQL query to test your connectivity.
<pre class="">SELECT * FROM OPENQUERY( MY_LINKED_SERVER_NAME, 'SELECT * FROM $')</pre>
--OR--
<pre class="">SELECT * FROM OPENQUERY( MY_LINKED_SERVER_NAME, 
'SELECT * FROM $
 WITH (Src=''https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json''
 ,Filter=''$.value[*]''
 ,DataFormat=''OData''
)');</pre>
</li>
 	<li>Here is the preview after you run some REST API query in SQL Server. Notice that you can override default configuration by supplying <a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/json-odbc-driver-connectionstring.htm" target="_blank" rel="noopener">many parameters</a> in WITH clause (second query example in screenshot).
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/query-rest-api-sql-server-linked-server-openquery-zappysys-data-gateway.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/query-rest-api-sql-server-linked-server-openquery-zappysys-data-gateway.png" alt="SSMS Output - Query REST API via Linked Server OPENQUERY statement (Connect to ZappySys Data Gateway)" />
</a>
<p class="wp-caption-text">SSMS Output - Query REST API via Linked Server OPENQUERY statement (Connect to ZappySys Data Gateway)</p>

</div></li>
 	<li>You can wrap your queries inside View or wrap inside Stored procedure to parameterize. Here is an example of create view which calls REST API queries. Below View can be consumed like a normal table from any Tools or Programming Language which supports connectivity to SQL Server.
<pre class="lang:tsql decode:true ">CREATE VIEW dbo.vwApiInvoices 
AS 
/*Call REST API inside SQL Server View*/
SELECT * FROM OPENQUERY( LS , 
'SELECT * FROM $
WITH (Src=''https://services.odata.org/V3/Northwind/Northwind.svc/Invoices?$format=json''
	 ,Filter=''$.value[*]''
	 ,DataFormat=''OData''
)');

GO
</pre>
&nbsp;</li>
 	<li>Notice in above approach if you parameterize Stored Procedure then <a href="https://zappysys.com/blog/create-csv-list-sql-server-table-columns-datatypes/" target="_blank" rel="noopener">check this article to understand Dynamic Metadata</a>.</li>
 	<li>That's it. We are now ready to move forward with more interesting things in next section.</li>
</ol></div>
<h3>Import Google Analytics Data into SQL Server Table (T-SQL Code)</h3>
<p>Now lets see how to run sample query to import Google Analytics Data into SQL Server. Notice that how we have escaped quotes in <strong>OPENQUERY</strong>.<br />
<strong>NOTE:</strong> Change id 11223344 with your own Id (<a href="https://ga-dev-tools.appspot.com/query-explorer/" target="_blank" rel="noopener">use this tool</a> to create URL)</p><pre class="crayon-plain-tag">select * into GaApiLoad from OPENQUERY([GOOGLE_ANALYTICS_LS] ,
'SELECT * FROM "rows"
WITH 
 (
   SRC=''https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:avgSessionDuration,ga:newUsers&amp;dimensions=ga:date''
  ,IncludeParentColumns=''False''
 )
')
select * from GaApiLoad</pre><p>
<div id="attachment_7046" style="width: 649px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7046" class="size-full wp-image-7046" src="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png" alt="Import Google Analytics Data into SQL Server Table (using T-SQL Code)" width="639" height="538" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png 639w, https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server-300x253.png 300w" sizes="(max-width: 639px) 100vw, 639px" /></a><p id="caption-attachment-7046" class="wp-caption-text">Import Google Analytics Data into SQL Server Table (using T-SQL Code)</p></div>
<h2>Expose Google Analytics Data as View</h2>
<p>To make it simple you can expose above query as SQL Server views so you can access them from any Reporting / ETL Tools.</p><pre class="crayon-plain-tag">CREATE VIEW vw_Google_Analytics_BounceRate_PageViews_Last30Days
AS
--change ids to your own Profile ID
select * from OPENQUERY([GOOGLE_ANALYTICS_LS] ,
'SELECT * FROM "rows"
WITH 
 (
   SRC=''https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=2019-04-01&amp;end-date=2019-04-30&amp;metrics=ga:bounceRate,ga:uniquePageviews&amp;dimensions=ga:date''
  ,IncludeParentColumns=''False''
 )
')
GO</pre><p>
<h2>Making things Dynamic using Stored Procedure with Parameters</h2>
<p>Now let&#8217;s make few things dynamic. We will change above query so we can pass Id, Dimensions and Metrics as parameters.</p>
<p>Run below script to Create a stored proc and fetch google analytics data in SQL Server.</p><pre class="crayon-plain-tag">use MyDatabase
go
create proc usp_GoogleAnalyticsData
	@ids varchar(1000),
	@startDate varchar(50)='30daysAgo',
	@endDate varchar(50)='yesterday',
	@metrics varchar(200)='ga:avgSessionDuration,ga:newUsers',
	@dimensions varchar(200)='ga:date'	
as

declare @sql varchar(4000)

set @sql='select * from OPENQUERY([GOOGLE_ANALYTICS_LS] ,
''SELECT * FROM "rows"
WITH 
 (
   SRC=''''https://www.googleapis.com/analytics/v3/data/ga?ids=ga:' + @ids 
   +'&amp;start-date='+ @startDate 
   +'&amp;end-date='+ @endDate 
   +'&amp;metrics='+ @metrics 
   +'&amp;dimensions='+ @dimensions 
   +'''''
  ,IncludeParentColumns=''''False''''
 )
'')'

print @sql
execute(@sql)

go

--Example: query google analytics data
exec usp_GoogleAnalyticsData 
	@ids='11223344',  --Change this ID - Obtain from here https://ga-dev-tools.appspot.com/query-explorer/
	@startDate ='30daysAgo',  --or like this 2019-04-01
	@endDate   ='yesterday', --or like this 2019-04-30
	@dimensions='ga:date', 
	@metrics   ='ga:bounceRate,ga:uniquePageviews'</pre><p>
<h3>Insert Google Analytics Data into table (Save Stored Procedure Output)</h3>
<p>Now what if you like to save Stored Proc output into a table? Well for that you must create table with same structure as stored proc output and then use <strong>INSERT INTO</strong> sql like below.</p><pre class="crayon-plain-tag">--import google analytics data in a table
if(object_id('GaDataLoad') is not null)
	drop table GaDataLoad
create table GaDataLoad([Date] date, BounceRate numeric(10,5), PageViews numeric(10,5))  

insert into GaDataLoad
exec usp_GoogleAnalyticsData 
	@ids='11223344',  --Change this ID - Obtain from here https://ga-dev-tools.appspot.com/query-explorer/
	@startDate ='30daysAgo',  --or like this 2019-04-01
	@endDate   ='yesterday', --or like this 2019-04-30
	@dimensions='ga:date', 
	@metrics='ga:bounceRate,ga:uniquePageviews'

select * from GaDataLoad</pre><p>
&nbsp;</p>
<h2>Performance Tips / Handling data errors due to missing rows</h2>
<p>By default ZappySys API Drivers sends minimum 2 API requests. First one to fetch metadata and second, third&#8230; for Data. There will be a time when you wont have any data and it may throw error about no records found because it fails to parse metadata. You can avoid such issue by supplying metadata before hand so you can avoid expensive API calls. <a href="https://zappysys.com/blog/caching-metadata-odbc-drivers-performance/" target="_blank" rel="noopener">Check this article</a> see how you can supply cached metadata in your SQL Query as below. This will avoid Metadata call and speedup significantly. It will also avoid errors due to no rows found for specified criteria.</p><pre class="crayon-plain-tag">select * from OPENQUERY([GOOGLE_ANALYTICS_LS] ,
'SELECT * FROM "rows"
WITH 
 (
   SRC=''https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:bounceRate,ga:uniquePageviews&amp;dimensions=ga:date''
  ,IncludeParentColumns=''False''
  ,Meta=''[ 
     {"Name": "ga:date","Type": "String", "Length": 16 },
     {"Name": "ga:bounceRate", "Type": "String", "Length": 36 },
     {"Name": "ga:uniquePageviews", "Type": "String", "Length": 10 }
    ]''
 )
')</pre><p>
&nbsp;</p>
<h2>ODBC Connection &#8211; Google Analytics Data in Other Apps (e.g. SSRS / Power BI / Excel / Tableau)</h2>
<p>So far we have talked accessing data inside SQL Server using Data Gateway Approach but what if you like to access in other apps ? Well you have three options.</p>
<ol>
<li>Use Microsoft SQL Server Driver to call Linked Server Queries (OPENQUERY approach we saw earlier)</li>
<li>Access Google Analytics Data using ODBC connectivity</li>
<li>Use Microsoft SQL Server Driver to send direct SQL queries to Gateway (Bypass Linked Server &#8211; Use inner SQL query without OPENQUERY in this case)</li>
</ol>
<h3><strong>Method-1 : Linked Server Approach</strong></h3>
<p>First approach most likely works in all cases because most apps will support connecting to SQL Server using OLEDB / ADO.net / ODBC / JDBC Drivers. So calling SQL Queries which uses Linked Server (i.e. OPENQUERY statement)  is advisable.</p>
<h3><strong>Method-2 : ODBC Driver Approach</strong></h3>
<p>However in some cases this may not be possible (e.g. You don&#8217;t have SQL Server inhouse or you don&#8217;t want to rely on SQL Server to access API). In such case you can use ODBC connectivity in your app. Since ODBC is widely adopted standard most app out there (Except JAVA apps) should support ODBC Drivers. If you like to use this approach then create ODBC DSN rather than Data Gateway Data source and use it in your Reporting / ETL / Custom Apps.</p>
<p>&nbsp;</p>
<div id="attachment_6213" style="width: 404px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/how-to-open-odbc-data-source-administrator-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6213" class="wp-image-6213 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/how-to-open-odbc-data-source-administrator-2.png" alt="Open ODBC Data Sources (Create DSN)" 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" /></a><p id="caption-attachment-6213" class="wp-caption-text">Open ODBC Data Sources (Create DSN)</p></div>
<div id="attachment_3993" style="width: 1067px" class="wp-caption alignnone"><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>
<p>&nbsp;</p>
<h3><strong>Method-3 : Direct connection to Data Gateway (By pass Linked Server)</strong></h3>
<p>Last option we suggest for cases like JAVA Apps / Linux / Mac machines where you cannot install ZappySys ODBC Drivers and you dont have option to use SQL Server Linked Server either. In such case you can try to send SQL Queries to Gateway directly using Microsoft SQL Server Compatible Drivers (i.e. ODBC /JDBC). <a href="https://zappysys.com/blog/connect-java-to-rest-api-json-soap-xml/" target="_blank" rel="noopener">See this example</a> how we called API Queries inside JAVA Apps.</p>
<h3>Google Analytics / REST API Integration in various apps</h3>
<div class="content_block" id="custom_post_widget-7051">ZappySys ODBC Drivers built using ODBC standard which is widely adopted by industry for a long time. Which mean the majority of BI Tools / Database Engines / ETL Tools already there will support native / 3rd party ODBC Drivers. Below is the small list of most popular tools / programming languages our Drivers support. If your tool / programming language doesn't appear in the below list, which means we have not documented use case but as long as your tool supports ODBC Standard, our drivers should work fine.

&nbsp;

<img loading="lazy" decoding="async" class="" src="//zappysys.com/images/odbc-powerpack/odbc-powerpack-integration.jpg" alt="ZappySys ODBC Drivers for REST API, JSON, XML - Integrate with Power BI, Tableau, QlikView, QlikSense, Informatica PowerCenter, Excel, SQL Server, SSIS, SSAS, SSRS, Visual Studio / WinForm / WCF, Python, C#, VB.net, PHP. PowerShell " width="750" height="372" />
<table style="valign: top;">
<tbody>
<tr>
<td>
<p style="text-align: center;"><strong>BI / Reporting Tools
Integration</strong></p>
</td>
<td style="text-align: center;"><strong>ETL Tools
Integration
</strong></td>
<td style="text-align: center;"><strong>Programming Languages</strong>
<strong>Integration</strong></td>
</tr>
<tr>
<td>
<ul>
 	<li><a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/" target="_blank" rel="noopener">Microsoft Power BI</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-tableau-read-json-soap-xml-csv/">Tableau</a></li>
 	<li><a href="https://zappysys.com/blog/read-rest-api-using-ssrs-reports-call-json-xml-web-service/" target="_blank" rel="noopener">SSRS (SQL Reporting Services)</a></li>
 	<li><a href="https://zappysys.com/blog/qlik-rest-connector-examples-read-json-xml-api/" target="_blank" rel="noopener">QlikView /Qlik Sense</a></li>
 	<li><a href="https://zappysys.com/blog/call-rest-api-in-microstrategy-json-soap-xml/" target="_blank" rel="noopener">MicroStrategy</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-google-sheet-call-appscript-load-json-soap-xml-csv/" target="_blank" rel="noopener">Google Sheet</a></li>
 	<li><a href="https://zappysys.com/blog/import-json-excel-load-file-rest-api/" target="_blank" rel="noopener">Microsoft Excel</a></li>
 	<li><a href="https://zappysys.com/api/integration-hub/rest-api-connector/access?context=connector" target="_blank" rel="noopener">Microsoft Access</a></li>
 	<li>Oracle OBIEE</li>
 	<li>Many more (not in this list).....</li>
</ul>
</td>
<td>
<ul>
 	<li><a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/" target="_blank" rel="noopener">Informatica PowerCenter</a> (Windows)</li>
 	<li>Informatica Cloud</li>
 	<li>SSIS (SQL Integration Services)</li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">SQL Server</a></li>
 	<li><a href="https://zappysys.com/blog/read-write-rest-api-data-in-talend-json-xml-soap/" target="_blank" rel="noopener">Talend Data Studio</a></li>
 	<li><a href="https://zappysys.com/blog/pentaho-read-rest-api-in-pentaho/" target="_blank" rel="noopener">Pentaho Kettle</a></li>
 	<li>Oracle OBIEE</li>
 	<li>Many more (not in this list).....</li>
</ul>
</td>
<td>
<ul>
 	<li>Visual Studio</li>
 	<li><a href="https://zappysys.com/blog/calling-rest-api-in-c/" target="_blank" rel="noopener">C#</a></li>
 	<li>C++</li>
 	<li><a href="https://zappysys.com/blog/connect-java-to-rest-api-json-soap-xml/" target="_blank" rel="noopener">JAVA</a></li>
 	<li><a href="https://zappysys.com/blog/set-rest-python-client/" target="_blank" rel="noopener">Python</a></li>
 	<li>PHP</li>
 	<li><a href="https://zappysys.com/blog/call-rest-api-powershell-script-export-json-csv/" target="_blank" rel="noopener">PowerShell</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">T-SQL (Using Linked Server)</a></li>
</ul>
</td>
</tr>
</tbody>
</table>
&nbsp;</div>
<p>&nbsp;</p>
<h2>Conclusion</h2>
<p>In this article we explored many ideas of JSON / API integration in SQL Server.  We saw how to create OAuth App for Google API and import Google Analytics data into SQL Server Table without doing any ETL using pure T-SQL code (Query / Views /Stored Procs). You can <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">Download  FREE Trial of ODBC PowerPack</a> and try yourself see how easy it is to query any API inside SQL Server and avoid expensive ETL processes.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/import-google-analytics-data-sql-server-reporting-etl/">Import Google Analytics data into SQL Server / Reporting / ETL</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to refresh Power BI dataset with REST API using SSIS</title>
		<link>https://zappysys.com/blog/refresh-power-bi-dataset-rest-api-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 22 May 2019 16:06:40 +0000</pubDate>
				<category><![CDATA[REST API]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS Connection Manager]]></category>
		<category><![CDATA[SSIS OAuth Connection]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[SSIS REST API Task]]></category>
		<category><![CDATA[SSIS Tasks]]></category>
		<category><![CDATA[dataset]]></category>
		<category><![CDATA[power bi]]></category>
		<category><![CDATA[refresh]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=6963</guid>

					<description><![CDATA[<p>Introduction In this article, you will learn how to refresh a Power BI dataset with Power BI REST API using SSIS and ZappySys SSIS PowerPack. Power BI is a Microsoft reporting product that can get data from virtually any source and display it nicely in a report or a dashboard. Each Power BI report contains a dataset, which can be refreshed [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/refresh-power-bi-dataset-rest-api-using-ssis/">How to refresh Power BI dataset with REST API using SSIS</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="alignleft wp-image-3951" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-logo-310x310-150x150.png" alt="Power BI Integration" width="100" height="100" srcset="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, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-logo-310x310.png 310w" sizes="(max-width: 100px) 100vw, 100px" />In this article, you will learn how to refresh a <a href="https://powerbi.microsoft.com/en-us/" target="_blank" rel="noopener">Power BI</a> dataset with <a href="https://docs.microsoft.com/en-us/rest/api/power-bi/" target="_blank" rel="noopener">Power BI REST API</a> using SSIS and <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a>. Power BI is a Microsoft reporting product that can get data from virtually any source and display it nicely in a report or a dashboard. Each Power BI report contains a dataset, which can be refreshed to show relevant data in the report. Power BI also has a <em>Scheduled refresh</em> capability, in case you want to refresh a dataset periodically. However, you are limited to only 8 specific times per day you can refresh a dataset (as of May 23, 2019). In the Power BI Premium license you can do it 48 times per day. But what if you need to refresh it more frequently? Or if you desire to refresh it at a non-predefined time; which is not known in advance? E.g. after an ETL process has finished? Here Power BI REST API comes into rescue and lets you refresh a dataset on demand.</p>
<p>Here are a few use cases when you may want to refresh a dataset from a SSIS package, using Power BI REST API:</p>
<ul>
<li>The need to refresh a dataset more often than Power BI allows.</li>
<li>The requirement to refresh a dataset just after some process is finished; e.g. after an ETL process.</li>
<li>The ability to have absolute control <em>when</em> to refresh <em>multiple</em> datasets. Sometimes, refreshing multiple huge datasets at once could cause memory problems in the Power BI service. So, having an orchestrated refresh would solve this problem.</li>
</ul>
<p>We will use these ZappySys SSIS PowerPack connectors/connections in this article:</p>
<div class="content_block" id="custom_post_widget-6991"><div style="display: table-row; background: #f7f7f7;">
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc;"><img loading="lazy" decoding="async" style="vertical-align: middle; width: 50px; height: 50px; max-width: 50px;" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/oauth-connection/ssis-oauth-connection-manager.png" alt="Web API Destination" width="50" height="50" /></div>
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc; border-left: none; width: 100%;"><a href="//zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=ssis-oauth-connection-manager.htm" target="_blank" rel="noopener">OAuth Connection Manager</a></div>
</div></div>
<div class="content_block" id="custom_post_widget-6984"><div style="display: table-row; background: #f7f7f7;">
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc;"><img loading="lazy" decoding="async" style="vertical-align: middle; width: 50px; height: 50px; max-width: 50px;" src="//zappysys.com/images/SSIS-PowerPack/ssis-rest-api-web-service-task.png" alt="Web API Destination" width="50" height="50" /></div>
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc; border-left: none; width: 100%;"><a href="//zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">REST API Task</a></div>
</div></div>
<p>Let&#8217;s begin!</p>
<h2>Prerequisites</h2>
<ol>
<li>You have a Power BI account and you have basic Power BI skills.</li>
<li>An uploaded Power BI report to Power BI service.</li>
<li>A <a href="https://azure.microsoft.com/" data-linktype="external">Microsoft Azure</a> subscription (there is a <a href="https://azure.microsoft.com/en-us/free/" target="_blank" rel="noopener">free</a> option with a 200 USD credit).</li>
<li><a href="https://azure.microsoft.com/en-us/services/active-directory/" target="_blank" rel="noopener">Azure Active Directory</a> set up.</li>
<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="SQL Server Data Tools">SSDT</abbr> or <abbr title="Business Intelligence Development Studio">BIDS</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
<li><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>).</li>
</ol>
<h2>Getting started</h2>
<p>Suppose you have a simple report and you want to refresh its dataset using Power BI REST API and SSIS. So far, the dataset has not been refreshed at all:</p>
<div id="attachment_7033" style="width: 573px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7033" class="wp-image-7033 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/05/refresh-power-bi-dataset-using-rest-api-and-ssis-e1558968134828.png" alt="Preparing to refresh Power BI dataset using SSIS and Power BI REST API." width="563" height="235" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/refresh-power-bi-dataset-using-rest-api-and-ssis-e1558968134828.png 563w, https://zappysys.com/blog/wp-content/uploads/2019/05/refresh-power-bi-dataset-using-rest-api-and-ssis-e1558968134828-300x125.png 300w" sizes="(max-width: 563px) 100vw, 563px" /><p id="caption-attachment-7033" class="wp-caption-text">Preparing to refresh the Power BI dataset using SSIS and Power BI REST API.</p></div>
<p>To start, create an SSIS package and follow the steps below to accomplish the goal.</p>
<h2>Step By Step &#8211; How to refresh a Power BI dataset with REST API using SSIS</h2>
<h3>Create an OAuth application</h3>
<div class="content_block" id="custom_post_widget-7035"><h4>Create an Azure Active Directory OAuth application</h4>
<ol>
 	<li>Firstly, go to <a href="https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview" target="_blank" rel="noopener">Azure Active Directory, click App Registrations</a>, and then register a new application:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-10621" src="https://zappysys.com/blog/wp-content/uploads/2019/05/20-register-azure-active-directory-application-to-use-in-ssis-or-odbc-wider.png" alt="" width="646" height="802" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/20-register-azure-active-directory-application-to-use-in-ssis-or-odbc-wider.png 646w, https://zappysys.com/blog/wp-content/uploads/2019/05/20-register-azure-active-directory-application-to-use-in-ssis-or-odbc-wider-242x300.png 242w" sizes="(max-width: 646px) 100vw, 646px" />Select option <em>Web</em> and enter this URL into the <em>Redirect URI</em> field:
<code>https://login.microsoftonline.com/common/oauth2/nativeclient</code></li>
 	<li>Once created, copy/paste the <em>Application (client) ID</em> into a notepad, we will need it later:
<img loading="lazy" decoding="async" class="alignnone wp-image-7041 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/05/21-save-client-id-of-azure-active-directory-application-to-use-from-ssis-or-odbc-e1696948772287.png" alt="" width="691" height="164" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/21-save-client-id-of-azure-active-directory-application-to-use-from-ssis-or-odbc-e1696948772287.png 691w, https://zappysys.com/blog/wp-content/uploads/2019/05/21-save-client-id-of-azure-active-directory-application-to-use-from-ssis-or-odbc-e1696948772287-300x71.png 300w" sizes="(max-width: 691px) 100vw, 691px" /></li>
 	<li>Next, go to <em>Certificates &amp; secrets</em> and create a new client secret. Copy a new client secret, we will need it later:
<img loading="lazy" decoding="async" class="alignnone wp-image-7038 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/05/40-create-a-new-client-secret-in-azure-active-directory-oauth-application-to-use-from-ssis-or-odbc-e1696949525459.png" alt="" width="499" height="460" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/40-create-a-new-client-secret-in-azure-active-directory-oauth-application-to-use-from-ssis-or-odbc-e1696949525459.png 499w, https://zappysys.com/blog/wp-content/uploads/2019/05/40-create-a-new-client-secret-in-azure-active-directory-oauth-application-to-use-from-ssis-or-odbc-e1696949525459-300x277.png 300w" sizes="(max-width: 499px) 100vw, 499px" /></li>
 	<li>Then go to <i>Overview </i>and hit <em>Endpoints. </em>Proceed by copying the <em>Authorization</em> and <em>Token</em> URLs and paste them into a notepad; we will use them later:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-10616" src="https://zappysys.com/blog/wp-content/uploads/2019/05/90-copy-azure-active-directory-oauth-application-authorization-and-token-endpoints-2.png" alt="" width="646" height="621" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/90-copy-azure-active-directory-oauth-application-authorization-and-token-endpoints-2.png 646w, https://zappysys.com/blog/wp-content/uploads/2019/05/90-copy-azure-active-directory-oauth-application-authorization-and-token-endpoints-2-300x288.png 300w" sizes="(max-width: 646px) 100vw, 646px" /></li>
</ol></div>
<h3>Create OAuth Connection Manager in SSIS package</h3>
<ol>
<li>Drag and drop <em>REST API Task</em> from SSIS Toolbox, double click, select <strong>Url from connection,</strong> and then select <strong>&lt;New ZS-OAUTH Connection&gt;</strong> item:
<div id="attachment_7096" style="width: 604px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7096" class="wp-image-7096 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/05/110-create-ssis-oauth-connection-for-powerbi-rest-api-application-1-e1559316589109.png" alt="Creating OAuth Connection Manager to connect to Power BI OAuth Application from SSIS." width="594" height="399" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/110-create-ssis-oauth-connection-for-powerbi-rest-api-application-1-e1559316589109.png 594w, https://zappysys.com/blog/wp-content/uploads/2019/05/110-create-ssis-oauth-connection-for-powerbi-rest-api-application-1-e1559316589109-300x202.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/110-create-ssis-oauth-connection-for-powerbi-rest-api-application-1-e1559316589109-272x182.png 272w" sizes="(max-width: 594px) 100vw, 594px" /><p id="caption-attachment-7096" class="wp-caption-text">Creating OAuth Connection Manager to connect to Power BI OAuth Application from SSIS.</p></div></li>
<li>Input <strong>Client ID</strong> from <em>Step 2</em> when we were creating an Azure Active Directory OAuth Application.
<div class="mceTemp"></div>
<div id="attachment_10630" style="width: 652px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10630" class="wp-image-10630 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/05/120-configure-ssis-oauth-connection-manager-for-powerbi-rest-api-application-1.png" alt="" width="642" height="652" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/120-configure-ssis-oauth-connection-manager-for-powerbi-rest-api-application-1.png 642w, https://zappysys.com/blog/wp-content/uploads/2019/05/120-configure-ssis-oauth-connection-manager-for-powerbi-rest-api-application-1-295x300.png 295w" sizes="(max-width: 642px) 100vw, 642px" /><p id="caption-attachment-10630" class="wp-caption-text">Configuring OAuth Connection Manager to authenticate to Power BI OAuth Application using SSIS.</p></div></li>
<li>Then proceed and input the <em>Client Secret</em> from <em style="font-style: italic;">Step 3, </em><em>Create an Azure Active Directory OAuth application</em> section.</li>
<li>Please go on, and fill in <em>Authorization Url </em>and <em>Access Token Url </em>properties with values we copied in <em>Step 4</em><em style="font-style: italic;">, </em><em>Create an Azure Active Directory OAuth application</em> section.</li>
<li>In <em>Scopes / Permissions</em> field input these scopes:<br />
<code>https://analysis.windows.net/powerbi/api/Dataset.ReadWrite.All<br />
offline_access</code></li>
<li>Then go to the <em>Advanced</em> tab and in the <em>Callback/Return Url</em> field input this value:<br />
<code>https://login.microsoftonline.com/common/oauth2/nativeclient</code></p>
<div id="attachment_10631" style="width: 652px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10631" class="wp-image-10631 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/05/130-configure-redirect-url-for-ssis-oauth-connection-manager-for-powerbi-rest-api-application-1.png" alt="" width="642" height="384" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/130-configure-redirect-url-for-ssis-oauth-connection-manager-for-powerbi-rest-api-application-1.png 642w, https://zappysys.com/blog/wp-content/uploads/2019/05/130-configure-redirect-url-for-ssis-oauth-connection-manager-for-powerbi-rest-api-application-1-300x179.png 300w" sizes="(max-width: 642px) 100vw, 642px" /><p id="caption-attachment-10631" class="wp-caption-text">Setting Callback/Return Url (Redirect URI) in OAuth Connection Manager to authenticate to Power BI OAuth Application using SSIS.</p></div></li>
<li>Then go back to the tab <em>General </em>and click the <em>Generate Token</em> button.</li>
<li>Once asked for credentials, log in with your organization user; this will generate <em>Refresh</em> and <em>Access</em> tokens.</li>
</ol>
<h3>Retrieve the ID of the Power BI dataset you want to refresh</h3>
<ol>
<li>Go to <a href="https://app.powerbi.com/groups/me/settings/datasets" target="_blank" rel="noopener">Power BI datasets</a>.</li>
<li>Then click on <strong>Datasets</strong>.</li>
<li>Proceed and click the dataset you want to refresh.</li>
<li>Finally, copy the ID of the dataset from the URL, we will use it in the next section.</li>
</ol>
<div id="attachment_7114" style="width: 723px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7114" class="wp-image-7114 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/05/140-get-the-id-of-the-dataset-in-power-bi-to-refresh-it-using-rest-api-and-ssis-e1559663902796.png" alt="Getting Power BI dataset ID to refresh it in an HTTP request to Power BI REST API." width="713" height="396" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/140-get-the-id-of-the-dataset-in-power-bi-to-refresh-it-using-rest-api-and-ssis-e1559663902796.png 713w, https://zappysys.com/blog/wp-content/uploads/2019/05/140-get-the-id-of-the-dataset-in-power-bi-to-refresh-it-using-rest-api-and-ssis-e1559663902796-300x167.png 300w" sizes="(max-width: 713px) 100vw, 713px" /><p id="caption-attachment-7114" class="wp-caption-text">Getting Power BI dataset ID to refresh it in an HTTP request to Power BI REST API.</p></div>
<h3>Configure REST API Task to refresh a Power BI dataset</h3>
<p>We configured OAuth Connection Manager and retrieved the ID of the dataset we want to refresh, now it&#8217;s time to configure REST API Task and refresh the dataset. So do the following:</p>
<ol>
<li>Go to the <strong>SSIS package</strong> and open the <strong>REST API Task</strong> for configuration.</li>
<li>Input <em>URL</em> in such a format:<br />
<code><strong>https://api.powerbi.com/v1.0/myorg/datasets/DATASET-ID/refreshes</strong></code> Replace <em>DATASET-ID</em> with an actual ID of the dataset. E.g.:<br />
<code>https://api.powerbi.com/v1.0/myorg/datasets/a38c78fc-8c87-45e3-b961-6dcd3ac1eada/refreshes</code> <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 your dataset resides in a Workspace, use this format instead:<br />
<code><strong>https://api.powerbi.com/v1.0/WORKSPACE-ID/datasets/DATASET-ID/refreshes</strong></code></div></div></li>
<li>Then set <strong>POST</strong> as <em>HTTP Request Method.</em></li>
<li>In the <em>Body</em> field, input this JSON:<br />
<code><strong>{ "notifyOption": "MailOnFailure" }</strong></code></li>
<li>Press the <em>Test Request/Response</em> button to test the request and refresh the dataset at the same time.</li>
</ol>
<div id="attachment_7117" style="width: 671px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7117" class="wp-image-7117 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/05/150-configure-REST-API-Task-to-refresh-power-bi-dataset-using-rest-api-and-ssis.png" alt="Configuring REST API Task to refresh Power BI dataset using Power BI REST API and SSIS." width="661" height="610" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/150-configure-REST-API-Task-to-refresh-power-bi-dataset-using-rest-api-and-ssis.png 661w, https://zappysys.com/blog/wp-content/uploads/2019/05/150-configure-REST-API-Task-to-refresh-power-bi-dataset-using-rest-api-and-ssis-300x277.png 300w" sizes="(max-width: 661px) 100vw, 661px" /><p id="caption-attachment-7117" class="wp-caption-text">Configuring a REST API Task to refresh a Power BI dataset using Power BI REST API and SSIS.</p></div>
<h3>Run the package</h3>
<p>Hit <strong>F5</strong> and execute the package:</p>
<div id="attachment_7123" style="width: 297px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7123" class="wp-image-7123 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/05/160-run-SSIS-package-to-refresh-power-bi-dataset-rest-api.png" alt="Executing SSIS package and refreshing Power BI dataset." width="287" height="147" /><p id="caption-attachment-7123" class="wp-caption-text">Executing SSIS package and refreshing Power BI dataset.</p></div>
<h2>The Results</h2>
<p>Now it&#8217;s time to check the results and see if the dataset was refreshed successfully:</p>
<ol style="margin-left: 0;">
<li>Again, go to <a href="https://app.powerbi.com/groups/me/settings/datasets" target="_blank" rel="noopener">Power BI datasets</a>.</li>
<li>Then click on <strong>Datasets</strong>.</li>
<li>Click the dataset you refreshed.</li>
<li>Then click &#8220;Refresh history&#8221; to check the refresh history. We expect two manual refreshes to be there.</li>
</ol>
<div id="attachment_7124" style="width: 667px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7124" class="wp-image-7124 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/05/170-checking-the-result-of-refreshing-power-bi-dataset-using-ssis-and-rest-api.png" alt="Results: Successful Power BI dataset refresh using Power BI REST API and SSIS." width="657" height="234" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/170-checking-the-result-of-refreshing-power-bi-dataset-using-ssis-and-rest-api.png 657w, https://zappysys.com/blog/wp-content/uploads/2019/05/170-checking-the-result-of-refreshing-power-bi-dataset-using-ssis-and-rest-api-300x107.png 300w" sizes="(max-width: 657px) 100vw, 657px" /><p id="caption-attachment-7124" class="wp-caption-text">Results: Successful Power BI dataset refresh using Power BI REST API and SSIS.</p></div>
<div class="content_block" id="custom_post_widget-6976"><h2>Debugging HTTP requests</h2>
<p style="text-align: justify;">A common thing you have to do when working with HTTP requests is to debug those requests; e.g. to check what headers, body or URL was passed. <span id="Debug_Web_API_call_using_Fiddler"></span>To test how things look behind the scenes we strongly suggest to use <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">Fiddler</a> - a popular web debugging tool.</p>
<p style="text-align: justify;">Inside it, you can double-click the URL entry (Right side) to see Request and Response Panels. The top panel is Request (URL, Headers, Body) and Bottom Panel is Response. For https:// (secure URL) make sure you enable HTTPS option in Fiddler (Tools &gt; Options &gt; HTTPS &gt; Check Decrypt https request):</p>

<div id="attachment_2344" class="wp-caption alignnone">

<a href="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?ssl=1" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-2344 size-full" style="border: 0px; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.176) 0px 1px 2px;" src="https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png" alt="Debugging Web API call using Fiddler in SSIS" width="1287" height="564" data-attachment-id="2344" data-permalink="https://zappysys.com/blog/pass-authorization-header-redirected-location/ssis-rest-api-call-debug-via-fiddler/#main" data-orig-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=1287%2C564&amp;ssl=1" data-orig-size="1287,564" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ssis-rest-api-call-debug-via-fiddler" data-image-description="&lt;p&gt;Debugging Web API call using Fiddler in SSIS&lt;/p&gt; " data-medium-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=300%2C131&amp;ssl=1" data-large-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=720%2C316&amp;ssl=1" srcset="https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png 1287w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler-300x131.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler-768x337.png 768w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler-1024x449.png 1024w" sizes="(max-width: 1287px) 100vw, 1287px" /></a>

</div></div>
<h2><span id="Deployment_to_Production">Deployment to Production</span></h2>
<div class="content_block" id="custom_post_widget-1932"><p style="text-align: justify;">In SSIS package <a href="https://docs.microsoft.com/en-us/sql/integration-services/security/access-control-for-sensitive-data-in-packages" target="_blank" rel="noopener">sensitive data such as tokens and passwords are by default encrypted by SSIS</a> with your Windows account which you use to create a package. So SSIS will fail to decrypt tokens/passwords when you run it from another machine using another Windows account. To circumvent this when you are creating an SSIS package which uses authentication components (e.g. an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-oauth-connection-manager.htm" target="_blank" rel="noopener">OAuth Connection Manager</a> or an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-http-connection-manager.htm" target="_blank" rel="noopener">HTTP Connection Manager</a> with credentials, etc.), consider using parameters/variables to pass tokens/passwords. In this way, you won’t face authentication related errors when a package is deployed to a production server.</p>
<p style="text-align: justify;">Check our article on <a href="https://zappysys.com/blog/how-to-run-an-ssis-package-with-sensitive-data-on-sql-server/" target="_blank" rel="noopener">how to configure packages with sensitive data on your production or development server</a>.</p></div>
<h2>Conclusion</h2>
<p style="text-align: justify;">You learned how to refresh a Power BI dataset with REST API using SSIS. To accomplish the goal, firstly, we created the Azure Active Directory application and configured OAuth Connection Manager based on it. Then we retrieved the Power BI dataset ID and used it in the ZappySys SSIS PowerPack connector REST API Task. Finally, using the same REST API Task we made the HTTP request to Power BI REST API &#8220;<em>refreshes&#8221;</em> method and successfully refreshed the dataset. If you need to make a call to another <a href="https://docs.microsoft.com/en-us/rest/api/power-bi/" target="_blank" rel="noopener">Power BI REST API</a> method, then just configure the REST API Task according to the documentation (for getting data use <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">JSON Source</a> or <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">Web API Destination</a> instead). Finally, if you make many requests to the Power BI REST API service, make sure you check its <a href="https://docs.microsoft.com/en-us/power-bi/developer/api-rest-api-limitations" target="_blank" rel="noopener">limitations</a>.</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://docs.microsoft.com/en-us/rest/api/power-bi/datasets/refreshdataset" target="_blank" rel="noopener">https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/refreshdataset</a></p>
<p><a href="https://docs.microsoft.com/en-us/rest/api/power-bi/" target="_blank" rel="noopener">https://docs.microsoft.com/en-us/rest/api/power-bi/</a></p>
<p><a href="https://docs.microsoft.com/en-us/power-bi/developer/api-rest-api-limitations" target="_blank" rel="noopener">https://docs.microsoft.com/en-us/power-bi/developer/api-rest-api-limitations</a></p>
<p>The post <a href="https://zappysys.com/blog/refresh-power-bi-dataset-rest-api-using-ssis/">How to refresh Power BI dataset with REST API using SSIS</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>Push data into a Power BI dataset from SQL Server</title>
		<link>https://zappysys.com/blog/push-data-into-power-bi-dataset-from-sql-server/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Tue, 27 Nov 2018 16:31:05 +0000</pubDate>
				<category><![CDATA[JSON File / REST API Driver]]></category>
		<category><![CDATA[ODBC Gateway]]></category>
		<category><![CDATA[T-SQL (SQL Server)]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[power bi]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[sql server]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=5408</guid>

					<description><![CDATA[<p>Introduction In this article, you will learn how to push data into a Power BI dataset from SQL Server. Power BI is a Microsoft reporting product that can get data from virtually any source and display it nicely in a report or a dashboard. Among its dataset types, it has a streaming dataset into which [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/push-data-into-power-bi-dataset-from-sql-server/">Push data into a Power BI dataset from SQL Server</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="alignleft wp-image-3951" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-logo-310x310-150x150.png" alt="Power BI Integration" width="100" height="100" srcset="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, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-logo-310x310.png 310w" sizes="(max-width: 100px) 100vw, 100px" />In this article, you will learn how to push data into a <a href="https://powerbi.microsoft.com/en-us/" target="_blank" rel="noopener">Power BI</a> dataset from SQL Server. Power BI is a Microsoft reporting product that can get data from virtually any source and display it nicely in a report or a dashboard. Among its dataset types, it has a streaming dataset into which you can push data from a <a href="https://docs.microsoft.com/en-us/rest/api/power-bi/" target="_blank" rel="noopener">Power BI REST API</a>. Once pushed, data will be immediately refreshed in a visual, pinned to a dashboard. Thus this approach of sending data to a streaming dataset is a perfect way for displaying real-time data. Yet it is not possible to push data to a dataset straight from SQL Server out of the box. However, with <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> it is possible to achieve that quite easily. We will employ one of its apps &#8211; <a href="https://zappysys.com/products/odbc-powerpack/data-gateway/" target="_blank" rel="noopener">ZappySys Data Gateway</a> &#8211; to make HTTP requests and push data to a streaming dataset.</p>
<p>The use cases when you may want to push data to a streaming dataset from a SQL Server are:</p>
<ul>
<li>Displaying real-time data from many SQL Server instances at once (and you cannot use the <em>DirectQuery</em> option in a report).</li>
<li>Displaying real-time data when many sources write to a dataset, and a SQL Server is one of them.</li>
<li>Any other case.</li>
</ul>
<p>Let&#8217;s begin and write some data to a Power BI streaming dataset!</p>
<h2>Prerequisites</h2>
<ol>
<li>You have a Power BI account and you have basic Power BI skills.</li>
<li>SQL Server instance installed (can be a <a href="https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-2016-express-localdb" target="_blank" rel="noopener">SQL Server Express LocalDB</a> instance).</li>
<li><a href="https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms" target="_blank" rel="noopener">SQL Server Management Studio</a> (SSMS) installed.</li>
<li><a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> installed (must be installed on a Windows machine; can be a different machine than SQL Server is installed on).</li>
</ol>
<h2>Step By Step &#8211; Push data into a Power BI dataset from a SQL Server</h2>
<div class="content_block" id="custom_post_widget-5441"><h3>Create a streaming dataset in Power BI</h3>
The first thing you need to do is to create a streaming dataset. We will create a simple dataset for demo purposes which will have two columns: <strong>Timestamp</strong> and <strong>Temperature</strong>.
<ol style="margin-left: 0;">
 	<li>Go to Power BI portal, hit <strong>My Workspace</strong>, <strong>+ Create</strong> and then click <strong>Streaming dataset</strong>:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-5424" src="https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-streaming-dataset-1.png" alt="" width="945" height="443" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-streaming-dataset-1.png 945w, https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-streaming-dataset-1-300x141.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-streaming-dataset-1-768x360.png 768w" sizes="(max-width: 945px) 100vw, 945px" /></li>
 	<li>Then select <strong>API</strong> and click <strong>Next</strong>:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-5425" src="https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-streaming-dataset-2-select-api.png" alt="" width="550" height="419" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-streaming-dataset-2-select-api.png 550w, https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-streaming-dataset-2-select-api-300x229.png 300w" sizes="(max-width: 550px) 100vw, 550px" /></li>
 	<li>Give dataset a name, add two columns and check <strong>Historic data analysis</strong> to enable data history and the ability to create report easily (otherwise you will be able to create a tile in a dashboard only):
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-5426" src="https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-streaming-dataset-3-give-a-name.png" alt="" width="550" height="740" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-streaming-dataset-3-give-a-name.png 550w, https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-streaming-dataset-3-give-a-name-223x300.png 223w" sizes="(max-width: 550px) 100vw, 550px" /></li>
 	<li>Once a dataset is created, copy <strong>Push URL</strong> to a notepad so we can use it later. Also, note the structure of the JSON we will have to use to submit live data into the created dataset:<img loading="lazy" decoding="async" class="alignnone size-full wp-image-5427" src="https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-streaming-dataset-4-created.png" alt="" width="547" height="462" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-streaming-dataset-4-created.png 547w, https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-streaming-dataset-4-created-300x253.png 300w" sizes="(max-width: 547px) 100vw, 547px" /></li>
</ol></div>
<div class="content_block" id="custom_post_widget-5411"><h3><span style="font-size: 14pt;">Configure ZappySys Data Gateway</span></h3>
Now let's look at steps to configure Data Gateway after installation.
<ol style="margin-left: 0;">
 	<li style="text-align: left;">Assuming you have installed <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> using default options (Which also enables Data Gateway Service)</li>
 	<li style="text-align: left;">Search "Gateway" in your start menu and click ZappySys Data Gateway
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png" alt="Open ZappySys Data Gateway" /></a>
<p class="wp-caption-text">Opening ZappySys Data Gateway</p>

</div></li>
 	<li>First, make sure Gateway Service is running (Verify Start icon is disabled)</li>
 	<li>Also, verify Port on General Tab
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ZappySys-data-gateway-port-5000.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ZappySys-data-gateway-port-5000.png" alt="Port Number setting on ZappySys Data Gateway" /></a>
<p class="wp-caption-text">Checking port number setting on ZappySys Data Gateway</p>

</div></li>
 	<li>Now go to Users tab. <strong>Click Add</strong> icon to add a new user. Check Is admin to give access to all data sources you add in future. If you don't check admin then you have to manually configure user permission for each data source.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-user.png">
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-5453" src="https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-configure-add-user.png" alt="" width="564" height="438" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-configure-add-user.png 564w, https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-configure-add-user-300x233.png 300w" sizes="(max-width: 564px) 100vw, 564px" /></a>
<p class="wp-caption-text">Adding the Gateway user</p>

</div></li>
</ol>
&nbsp;</div>
<h3>Add a data source in the Gateway</h3>
<p>It&#8217;s time to add a data source, which we will use to POST data to Power BI REST API:</p>
<ol>
<li>In the Gateway, click on <strong>Data sources</strong> tab, click <strong>Add</strong>, give data source a name and set <em>Connector Type</em> to <strong>Native &#8211; ZappySys JSON Driver</strong>:<img loading="lazy" decoding="async" class="alignnone size-full wp-image-5439" src="https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-1-1.png" alt="" width="562" height="573" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-1-1.png 562w, https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-1-1-294x300.png 294w" sizes="(max-width: 562px) 100vw, 562px" /></li>
<li>Then click <strong>Edit</strong> to modify the data source:<br />
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-5440" src="https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-2-2.png" alt="" width="562" height="385" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-2-2.png 562w, https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-2-2-300x206.png 300w" sizes="(max-width: 562px) 100vw, 562px" /></li>
<li>Finally, paste into <em>Url </em>textbox <strong>Push URL</strong> of the dataset which we saved in a previous step. Also, set <em>HTTP Request Method</em> to <strong>POST</strong>:
<div id="attachment_5430" style="width: 812px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5430" class="wp-image-5430 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-3.png" alt="Configure REST API Connection for Power BI dataset insert (Using ZappySys JSON / REST Driver)" width="802" height="702" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-3.png 802w, https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-3-300x263.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-3-768x672.png 768w" sizes="(max-width: 802px) 100vw, 802px" /><p id="caption-attachment-5430" class="wp-caption-text">Configure REST API Connection for Power BI dataset insert (Using ZappySys JSON / REST Driver)</p></div></li>
</ol>
<h3>Add a Linked Server to the Gateway</h3>
<div class="content_block" id="custom_post_widget-5432">Once you configured the data source in Gateway, we can now set up a Linked Server in a SQL Server.
<ol style="margin-left: 10px;">
 	<li>Open SSMS and connect to a SQL Server.</li>
 	<li>Go to Root &gt; Server Objects &gt; Linked Servers node. Right click and click <strong>New Linked Server...
</strong>
<div class="wp-caption alignnone">
<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/create-new-linked-server-ssms.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/03/create-new-linked-server-ssms.png" alt="Add Linked Server in SQL Server" />
</a>
<p class="wp-caption-text">Adding Linked Server in SQL Server</p>

</div></li>
 	<li>Now enter the linked server name, select Provider as SQL Native Client.</li>
 	<li>Enter data source as <strong><span class="lang:default decode:true crayon-inline">GatewayServerName,PORT_NUMBER</span></strong> where server name is where ZappySys Gateway is running (can be the same as SQL Server machine or a remote machine). Default PORT_NUMBER is 5000 but confirm that on the Gateway &gt; General tab in case it's different.</li>
 	<li>Enter Catalog Name. This must match name from Data gateway Data sources grid &gt; Name column
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssms-sql-server-configure-linked-server-2.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssms-sql-server-configure-linked-server-2.png" alt="Configure Linked Server Provider, Catalog, Server, Port for ZappySys Data Gateway Connection" />
</a>
<p class="wp-caption-text">Configure Linked Server Provider, Catalog, Server, Port for ZappySys Data Gateway Connection</p>
</div>
<div style="color: #31708f;background-color: #d9edf7;border-color: #bce8f1;padding: 15px;margin-bottom: 20px;border: 1px solid transparent;border-radius: 4px;">
<strong>INFO:</strong><br/>
<ul>
    <li>
      For <strong>SQL Server 2012, 2014, 2016, 2017, and 2019</strong>, use the <em>SQL Server Native Client 11.0</em> as the Provider.
    </li>
    <li>
      For <strong>SQL Server 2022 or higher</strong>, use the <em>Microsoft OLE DB Driver for SQL Server</em> as the Provider.
    </li>
  </ul>
</div></li>
 	<li>Click on Security Tab and select the last option "<strong>Be made using this security context</strong>". Enter your gateway user account here.
<div class="wp-caption alignnone">
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-5456" src="https://zappysys.com/blog/wp-content/uploads/2018/11/add-linked-server-sql-server-3-security-2.png" alt="" width="690" height="625" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/add-linked-server-sql-server-3-security-2.png 690w, https://zappysys.com/blog/wp-content/uploads/2018/11/add-linked-server-sql-server-3-security-2-300x272.png 300w" sizes="(max-width: 690px) 100vw, 690px" />
<p class="wp-caption-text">Configuring Linked Server credentials</p>
</li>
<li>
        <p>Optional: Under the Server Options Tab, Enable <b>RPC</b> and <b>RPC Out</b> and Disable Promotion of Distributed Transactions<b>(MSDTC)</b>.</p>
		<div class="wp-caption alignnone">
			<img decoding="async" class="block margin-bottom-10 img-thumbnail" src="https://zappysys.com/blog/wp-content/uploads/2018/11/linked-server-options-rpc-msdtc.png" title="RPC and MSDTC Settings" alt="RPC and MSDTC Settings" />
			<p class="wp-caption-text">RPC and MSDTC Settings</p>
		</div>
        <hr />
        <p>
            You need to enable RPC Out if you plan to use <b><i>EXEC(...) AT [MY_LINKED_SERVER_NAME]</i></b> rather than OPENQUERY.
            <br />
            If don't enabled it, you will encounter the <i>'Server "MY_LINKED_SERVER_NAME" is not configured for RPC'</i> error.
        </p>
        <p>
            Query Example:
            <code class="sql">EXEC('Select * from Products') AT [MY_LINKED_SERVER_NAME]</code>
        </p>
        <hr />
        <p>
            If you plan to use <b><i>'INSERT INTO...EXEC(....) AT [MY_LINKED_SERVER_NAME]'</i></b> in that case you need to Disable Promotion of Distributed Transactions(MSDTC).
            <br />
            If don't disabled it, you will encounter the <i>'The operation could not be performed because OLE DB provider "SQLNCLI11/MSOLEDBSQL" for linked server "MY_LINKED_SERVER_NAME" was unable to begin a distributed transaction.'</i> error.
        </p>
        <p>
            Query Example:
<pre class="">Insert Into dbo.Products 
EXEC('Select * from Products') AT [MY_LINKED_SERVER_NAME]</pre>
        </p>
        <hr />
</li>
 	<li>Click OK to save the Linked Server.</li>
</ol></div>
<h3>Writing data into Power BI dataset from SQL Server</h3>
<p>Once you add a Linked Server you can execute a query to push data into a Power BI streaming dataset:</p>
<ol style="margin-left: 0;">
<li>In the same SQL Server Management Studio create a new query and paste the code below. In <em>Body</em> attribute, we pass the JSON in the same format which was shown when we created a Power BI dataset:<br />
<pre class="crayon-plain-tag">SELECT * FROM
OPENQUERY([GATEWAY], 'SELECT * FROM $
WITH (Body=''[ 
	{ "Timestamp" :"2018-11-15T02:57:04.547Z", "Temperature" : 50.5 },
	{ "Timestamp" :"2018-11-16T02:57:04.547Z", "Temperature" : 55.5 },
	{ "Timestamp" :"2018-11-17T02:57:04.547Z", "Temperature" : 60.5 },
	{ "Timestamp" :"2018-11-18T02:57:04.547Z", "Temperature" : 57.5 },
	{ "Timestamp" :"2018-11-19T02:57:04.547Z", "Temperature" : 62.3 }
]''
,meta=''[ { "Name": "Dummy", "Type": "String" }]'' )')</pre>
<div class="su-note"  style="border-color:#e5da9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff4b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>Note:</strong> Use the same Linked Server name you created in a previous step. In our case, it is &#8220;GATEWAY&#8221;.</div></div></li>
<li>Execute the query.</li>
</ol>
<h2>The results: creating a Power BI report</h2>
<p>Now it&#8217;s time to check the results and see if data went through:</p>
<ol style="margin-left: 0;">
<li>Go to Power BI portal.</li>
<li>Select <strong>Datasets </strong>and click on the add new report icon:
<div id="attachment_5447" style="width: 705px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5447" class="wp-image-5447 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-report-from-streaming-dataset-1.png" alt="Create new Power BI Report for real time dataset" width="695" height="384" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-report-from-streaming-dataset-1.png 695w, https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-report-from-streaming-dataset-1-300x166.png 300w" sizes="(max-width: 695px) 100vw, 695px" /><p id="caption-attachment-5447" class="wp-caption-text">Create new Power BI Report for real time dataset</p></div></li>
<li>Add a Line Chart, a Table and link them to the dataset.</li>
<li>You should see the data we pushed to the dataset:
<div id="attachment_5448" style="width: 596px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5448" class="wp-image-5448 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-report-from-streaming-dataset-2.png" alt="Showing real time data in Power BI dashboard" width="586" height="343" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-report-from-streaming-dataset-2.png 586w, https://zappysys.com/blog/wp-content/uploads/2018/11/powerbi-create-report-from-streaming-dataset-2-300x176.png 300w" sizes="(max-width: 586px) 100vw, 586px" /><p id="caption-attachment-5448" class="wp-caption-text">Showing real time data in Power BI dashboard</p></div></li>
</ol>
<div class="su-note"  style="border-color:#e5da9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff4b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>Note:</strong> To see real-time data, pin a visual to a dashboard. Live data can be seen only in a dashboard since only there data is refreshed when a new piece of data is received. However, it does not work with reports &#8211; if you pin a whole report to a dashboard it won&#8217;t update data in real-time. </div></div>
<h2>Conclusion</h2>
<p style="text-align: justify;">You learned how to push data into a Power BI streaming dataset directly from SQL Server. It was possible to achieve that with ZappySys Data Gateway and SQL Server Linked Server option. At first, we created a streaming dataset in Power BI, then configured a datasource in the Gateway, followed with adding a Linked Server to the Gateway, executed T-SQL query in SSMS and pushed some data to the dataset and finally created a Power BI report to check the received data.</p>
<p style="text-align: justify;">When we set <strong>Historic data analysis</strong> option when creating a dataset, we, in turn, created a dataset of type <strong>Push </strong>(if we left it off, it would be of type <strong>Streaming</strong>). It allowed us to create a report easily on top of it, but it has certain <a href="https://docs.microsoft.com/en-us/power-bi/developer/api-rest-api-limitations" target="_blank" rel="noopener">limitations</a>. Just be aware when using this option and check <a href="https://docs.microsoft.com/en-us/power-bi/service-real-time-streaming" target="_blank" rel="noopener">Power BI service documentation</a> for more info.</p>
<p style="text-align: justify;">Finally, in SSMS, we executed a query with predefined data. Therefore in real life, if you want to push data from an existing table, you will have to build JSON from it. Make sure you construct <a href="https://jsonlint.com/" target="_blank" rel="noopener">a valid JSON</a> and escape the symbols that need to be escaped (<a href="https://www.json.org/" target="_blank" rel="noopener">such as a double-quote or a backslash</a>).</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://docs.microsoft.com/en-us/rest/api/power-bi/" target="_blank" rel="noopener">https://docs.microsoft.com/en-us/rest/api/power-bi/</a></p>
<p><a href="https://docs.microsoft.com/en-us/power-bi/service-real-time-streaming" target="_blank" rel="noopener">https://docs.microsoft.com/en-us/power-bi/service-real-time-streaming</a></p>
<p><a href="https://docs.microsoft.com/en-us/power-bi/developer/api-rest-api-limitations" target="_blank" rel="noopener">https://docs.microsoft.com/en-us/power-bi/developer/api-rest-api-limitations</a></p>
<p>The post <a href="https://zappysys.com/blog/push-data-into-power-bi-dataset-from-sql-server/">Push data into a Power BI dataset from SQL Server</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Connect Workday in Power BI &#8211; Import SOAP Data</title>
		<link>https://zappysys.com/blog/connect-workday-power-bi-import-soap-data/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 01 Oct 2018 16:21:43 +0000</pubDate>
				<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[XML File / SOAP API Driver]]></category>
		<category><![CDATA[power bi]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[SoapUI]]></category>
		<category><![CDATA[workday]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=4996</guid>

					<description><![CDATA[<p>Introduction In our previous blog post we saw how to import SOAP API data in Power BI. Now let&#8217;s continue to explore more use cases. In this article we will check how to Connect WorkDay in Power BI. We will show you step by step approach on how to call Workday SOAP API in Power [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/connect-workday-power-bi-import-soap-data/">Connect Workday in Power BI &#8211; Import SOAP 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/2016/01/workday-api-integration.png"><img loading="lazy" decoding="async" class=" wp-image-1665 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2016/01/workday-api-integration.png" alt="" width="96" height="96" srcset="https://zappysys.com/blog/wp-content/uploads/2016/01/workday-api-integration.png 195w, https://zappysys.com/blog/wp-content/uploads/2016/01/workday-api-integration-150x150.png 150w" sizes="(max-width: 96px) 100vw, 96px" /></a>In our previous blog post we saw how to <a href="https://zappysys.com/blog/call-soap-api-power-bi-read-xml-web-service-data/">import SOAP API data in Power BI</a>. Now let&#8217;s continue to explore more use cases. In this article we will check how to Connect WorkDay in Power BI. We will show you step by step approach on how to call <a href="https://community.workday.com/api" target="_blank" rel="noopener">Workday SOAP API</a> in Power BI and create Power BI reports / dashboards using imported datasets.</p>
<p>We will use <a href="https://zappysys.com/products/odbc-powerpack/odbc-xml-soap-api-driver/" target="_blank" rel="noopener">ZappySys XML / SOAP Driver</a> for this demonstration.</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</a> installed</li>
<li>Make sure you have <a href="https://zappysys.com/products/odbc-powerpack/">ZappySys ODBC Power Pack</a> installed</li>
<li>Download and have install <a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI</a></li>
</ol>
<h2>Get Started</h2>
<p>Once above requirements are fulfilled, let&#8217;s learn how to use Workday SOAP API and import workday data in Power BI.</p>
<p>Here are high level steps to import Workday data in Power BI using <a href="https://zappysys.com/products/odbc-powerpack/odbc-xml-soap-api-driver/" target="_blank" rel="noopener">ZappySys XML / SOAP Driver</a>.</p>
<ol>
<li>Craft Workday SOAP request XML using tool like <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/" target="_blank" rel="noopener">SoapUI</a> for desired operation (e.g <strong>Get_Employee</strong> )</li>
<li>Configure ODBC DSN for Workday SOAP API Connection using <a href="https://zappysys.com/products/odbc-powerpack/odbc-xml-soap-api-driver/" target="_blank" rel="noopener">ZappySys XML / SOAP Driver</a>. (Select HTTP Connection with SOAP WSS mode using workday Userid / password).</li>
<li>Test SQL Query for desired SOAP API call</li>
<li>Finally, Import Data in Power BI using ODBC Connection, Supply Custom SQL Query during Import Process (Crafted in previous step).</li>
</ol>
<p>Now let&#8217;s look at each step in detail in the following sections</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;"><strong>NOTE:</strong> If you are trying to get data from Workday <em><span style="text-decoration: underline;">report</span> </em>instead (your Workday admin created a report and gave you a link) then skip Soap UI part, use the URL with GET method and <em>Basic authentication</em> instead of SOAP WSS.</div></div>
<h3>Craft Workday SOAP request XML using SoapUI</h3>
<p>Now let&#8217;s look at how to use tool like SoapUI to craft SOAP API requests. It would be helpful if you can refer <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/" target="_blank" rel="noopener">this article to learn more</a> about using SoapUI tool (Check SoapUI section in that article).</p>
<h4><span id="Obtain_Workday_SOAP_WSDL_URL_API_Metadata_URL">Obtain Workday SOAP WSDL URL (API Metadata URL)</span></h4>
<p>First step to consume workday api using SSIS is download SOAP WSDL file. WSDL is an XML file which describes available API operations in Workday. It also describes the structure of XML request / response. Here is the <a href="https://community.workday.com/sites/default/files/file-hosting/productionapi/index.html" target="_blank" rel="noopener">list of available WSDL</a> for various Workday API Services. You can right click on WSDL icon and save to local disk or use Direct WSDL URL in next section for importing in <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/">SoapUI tool</a>.</p>
<p>You can find more information about Other <a href="https://community.workday.com/api" target="_blank" rel="noopener">Workday API here</a>.</p>
<h4><span id="Obtain_Workday_API_URL">Obtain Workday API URL</span></h4>
<p>Once you have WSDL file, next step is craft correct URL for API service you like to call. Service name can be obtained from <a href="https://community.workday.com/sites/default/files/file-hosting/productionapi/index.html" target="_blank" rel="noopener">here</a> (Check service column). Notice my-instance and my-tenantid placeholders (Its specific to your company).</p>
<p><strong>Syntax:  </strong><pre class="crayon-plain-tag">https://&lt;workday host name&gt;.workday.com/ccx/service/&lt;tenant name&gt;/&lt;service-name&gt;</pre> <strong><br />
Example: </strong><pre class="crayon-plain-tag">https://MY-INSTANCE.workday.com/ccx/service/MY-TenantID/Human_Resources</pre>
<h4><span id="Craft_SOAP_Body_XML_API_Request_using_SoapUI">Load WSDL in SoapUI</span></h4>
<p>Now it&#8217;s time to load WSDL and craft some SOAP Request and test. For detailed steps <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/">check this (watch Video to learn SoapUI tool)</a> .</p>
<ol>
<li>Open SoapUI tool</li>
<li>Click new File &gt; New Soap Project</li>
<li>Enter WSDL Path and Name of the project</li>
<li>You will see many different operations in the imported project. For example below screenshot shows Human_Resources service and <strong>Get Employee</strong> API call. You can fill out necessary parameters in your request / remove optional parameters from XML as needed.
<div id="attachment_2543" style="width: 745px" class="wp-caption alignnone"><a href="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/create-workday-soap-request-using-soapui-api-xml-body.png?ssl=1"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2543" class="wp-image-2543 size-full" style="border: 0px; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.176) 0px 1px 2px;" src="https://zappysys.com/blog/wp-content/uploads/2016/01/create-workday-soap-request-using-soapui-api-xml-body.png" alt="Create SOAP Request Body from WSDL (Using SoapUI tool)" width="735" height="451" data-attachment-id="2543" data-permalink="https://zappysys.com/blog/get-data-from-workday-in-ssis-using-soap-or-rest-api/create-workday-soap-request-using-soapui-api-xml-body/#main" data-orig-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/create-workday-soap-request-using-soapui-api-xml-body.png?fit=735%2C451&amp;ssl=1" data-orig-size="735,451" 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="create-workday-soap-request-using-soapui-api-xml-body" data-image-description="&lt;p&gt;Create SOAP Request Body from WSDL (Using SoapUI tool)&lt;/p&gt; " data-medium-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/create-workday-soap-request-using-soapui-api-xml-body.png?fit=300%2C184&amp;ssl=1" data-large-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/create-workday-soap-request-using-soapui-api-xml-body.png?fit=720%2C442&amp;ssl=1" srcset="https://zappysys.com/blog/wp-content/uploads/2016/01/create-workday-soap-request-using-soapui-api-xml-body.png 735w, https://zappysys.com/blog/wp-content/uploads/2016/01/create-workday-soap-request-using-soapui-api-xml-body-300x184.png 300w" sizes="(max-width: 735px) 100vw, 735px" /></a><p id="caption-attachment-2543" class="wp-caption-text">Create SOAP Request Body from WSDL (Using SoapUI tool)</p></div></li>
</ol>
<h4><span id="Craft_SOAP_Body_XML_API_Request_using_SoapUI">Configure Soap Request Body, URL and Credentials in SoapUI</span></h4>
<p>Now it&#8217;s time to configure SOAP Request service URL and Credentials. To generate correct Credentials Header in SOAP Request use tool like SoapUI. <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/" target="_blank" rel="noopener">Check this article</a> to learn more how to generate WSS Security header.</p>
<ol>
<li>Go to the API method you like to call and double click on the default Request node. <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/">Check this article to learn more</a>.</li>
<li>Change default request parameters (Add /Remove as per your need). You can click on Re-generate icon in the toolbar to reset the request and create optional parameters.</li>
<li>Enter the Service URL<br />
<strong>Example:</strong>  https://myinstance0001.workday.com/ccx/service/AB11111111/Human_Resources</li>
<li>In the properties window select WSS-Password Type as <strong>PasswordDigest</strong>, Enter workday <strong>username</strong> and <strong>password</strong></li>
<li>Once you done click Play button to execute the request. If things go well then you should see response on your right panel as below.
<div id="attachment_5006" style="width: 1059px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/10/soapui-call-workday-soap-api-test-request-response.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5006" class="wp-image-5006 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/10/soapui-call-workday-soap-api-test-request-response.png" alt="SoapUI - Call Workday SOAP API (Configure WSS Security, Service URL, Body, Test Request / Response)" width="1049" height="597" srcset="https://zappysys.com/blog/wp-content/uploads/2018/10/soapui-call-workday-soap-api-test-request-response.png 1049w, https://zappysys.com/blog/wp-content/uploads/2018/10/soapui-call-workday-soap-api-test-request-response-300x171.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/10/soapui-call-workday-soap-api-test-request-response-768x437.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/10/soapui-call-workday-soap-api-test-request-response-1024x583.png 1024w" sizes="(max-width: 1049px) 100vw, 1049px" /></a><p id="caption-attachment-5006" class="wp-caption-text">SoapUI &#8211; Call Workday SOAP API (Configure WSS Security, Service URL, Body, Test Request / Response)</p></div></li>
</ol>
<h3><span id="Creating_SSIS_Connection_for_Workday_SOAP_API_call_using_WSS_Security">Creating ODBC DSN for Workday Connection</span></h3>
<p>Once you test correct parameters in your XML Request we can create ODBC DSN for Workday.</p>
<ol>
<li>Open start menu and search for &#8220;ODBC 64&#8221;. Launch ODBC Data sources for 64 bit
<div id="attachment_3992" style="width: 996px" class="wp-caption alignnone"><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="wp-image-3992 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-data-sources-start-up-screen.png" alt="Open ODBC Data Sources from Start 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 <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 something to <strong> WorkdayDSN</strong>)</li>
<li>Enter API EndPoint URL (Get it from SoapUI) and Select connection type as HTTP.<br />
Example URL:  https://YOUR-INSTANCE.workday.com/ccx/service/YOUR-TENANT/Human_Resources</li>
<li>Configure HTTP connection as below.
<div id="attachment_5047" style="width: 692px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/10/configure-workday-soap-api-connection-odbc-xml-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5047" class="size-full wp-image-5047" src="https://zappysys.com/blog/wp-content/uploads/2018/10/configure-workday-soap-api-connection-odbc-xml-driver.png" alt="Configure Workday Connection in ODBC DSN - XML / SOAP Driver" width="682" height="488" srcset="https://zappysys.com/blog/wp-content/uploads/2018/10/configure-workday-soap-api-connection-odbc-xml-driver.png 682w, https://zappysys.com/blog/wp-content/uploads/2018/10/configure-workday-soap-api-connection-odbc-xml-driver-300x215.png 300w" sizes="(max-width: 682px) 100vw, 682px" /></a><p id="caption-attachment-5047" class="wp-caption-text">Configure Workday Connection in ODBC DSN &#8211; XML / SOAP Driver</p></div></li>
<li>Click OK to save connection.</li>
<li>Now Configure other settings as below.
<ol>
<li>Select Method as <strong>POST</strong></li>
<li>Select Content Type as <strong>text/xml</strong></li>
<li>Enter one required Header for SOAP API as below<br />
<pre class="crayon-plain-tag">SOAPAction :&nbsp; &quot;&quot;</pre>
</li>
<li>Enter Body (Get it from SoapUI ). Here is example body for Get_Employee request.<br />
<pre class="crayon-plain-tag">&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bsvc="urn:com.workday/bsvc"&gt;
   &lt;soapenv:Header/&gt;
   &lt;soapenv:Body&gt;
      &lt;bsvc:Employee_Get&gt;
         &lt;bsvc:Employee_Reference&gt;
            &lt;bsvc:Integration_ID_Reference&gt;
               &lt;bsvc:ID&gt;XXXX-1234-CHANGE-THIS-XXXXXXX&lt;/bsvc:ID&gt;
            &lt;/bsvc:Integration_ID_Reference&gt;
         &lt;/bsvc:Employee_Reference&gt;
      &lt;/bsvc:Employee_Get&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;</pre>
NOTE: Change ID to your own record id.</li>
<li><strong>( Optional )</strong> If your API returns more than one record (e.g. if you call API like <strong>Get_Workers</strong>) then select Filter as per below screenshot (Click Yes if asked to treat selection as array). For example in below screenshot we called Get_Workers request which returns multiple records under <strong>wd:Worker node</strong>. Look for <strong>Array Icon</strong> in the Filter selection. Skip this step if no array extraction needed.</li>
</ol>
</li>
<li>After Configuration your screen may look like below.
<div id="attachment_5050" style="width: 886px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/10/configure-workday-soap-api-connection-request-body-url-filter.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5050" class="size-full wp-image-5050" src="https://zappysys.com/blog/wp-content/uploads/2018/10/configure-workday-soap-api-connection-request-body-url-filter.png" alt="Configure Workday SOAP Request - URL, Body, Filter" width="876" height="749" srcset="https://zappysys.com/blog/wp-content/uploads/2018/10/configure-workday-soap-api-connection-request-body-url-filter.png 876w, https://zappysys.com/blog/wp-content/uploads/2018/10/configure-workday-soap-api-connection-request-body-url-filter-300x257.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/10/configure-workday-soap-api-connection-request-body-url-filter-768x657.png 768w" sizes="(max-width: 876px) 100vw, 876px" /></a><p id="caption-attachment-5050" class="wp-caption-text">Configure Workday SOAP Request &#8211; URL, Body, Filter</p></div></li>
<li>Now go to Preview Tab and you will see default SQL query generated for you. Here is example query (Replace Body part as per your need)<br />
<pre class="crayon-plain-tag">SELECT * FROM $
/*Below WITH clause is optional, uncomment parameter(s) values you like to set 
 which are different than DSN properties.
*/
WITH(
	Src='https://xxxxxxxxxx.workday.com/ccx/service/yyyyyyyyy/Human_Resources'
	--,ElementsToTreatAsArray='wd:Worker'
	--,DataConnectionType='HTTP'
	--,SoapWssPasswordType='PasswordDigest'
	--,UserName='testuser001'
	--,CredentialType='SoapWss'
	--,Filter='$.env:Envelope.env:Body.wd:Get_Workers_Response.wd:Response_Data.wd:Worker[*]'
	--,RequestContentTypeCode='TextXmlUtf8'
	--,RequestMethod='POST'
	--,Header='SOAPAction: ""'	
	,RequestData='
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bsvc="urn:com.workday/bsvc"&gt;
   &lt;soapenv:Header/&gt;
   &lt;soapenv:Body&gt;
        .......... .......... .......... 
        .......... FROM SOAPUI .........  
        .......... .......... ..........        
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;'
)</pre>
</li>
<li>Click Preview button to see data. Copy your SQL Query for later step.
<div id="attachment_5051" style="width: 818px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/10/query-workday-data-using-odbc-driver-xml-soap-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5051" class="wp-image-5051 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/10/query-workday-data-using-odbc-driver-xml-soap-api.png" alt="Preview Workday Data (Test SQL query for ODBC XML / SOAP Driver)" width="808" height="749" srcset="https://zappysys.com/blog/wp-content/uploads/2018/10/query-workday-data-using-odbc-driver-xml-soap-api.png 808w, https://zappysys.com/blog/wp-content/uploads/2018/10/query-workday-data-using-odbc-driver-xml-soap-api-300x278.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/10/query-workday-data-using-odbc-driver-xml-soap-api-768x712.png 768w" sizes="(max-width: 808px) 100vw, 808px" /></a><p id="caption-attachment-5051" class="wp-caption-text">Preview Workday Data (Test SQL query for ODBC XML / SOAP Driver)</p></div></li>
<li>Click OK to save DSN</li>
</ol>
<h3>Import Workday data in Power BI</h3>
<p>Now let&#8217;s move to the final step. We will use SQL query and DSN created in previous step for data load in Power BI.</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, you can use below query to get all JOB categories.<br />
<pre class="crayon-plain-tag">SELECT * FROM $
WITH(
	 Src='https://xxxxxxxxxx.workday.com/ccx/service/yyyyyyyyyy/Human_Resources'	
	--,DataConnectionType='HTTP'
	--,SoapWssPasswordType='PasswordText'
	--,UserName='testuser001'
	--,Password='###########'
	--,CredentialType='SoapWss'
	,RequestMethod='POST'
	,RequestContentTypeCode='TextXmlUtf8'
	,Filter='$.soapenv:Envelope.soapenv:Body.bsvc:Get_Job_Categories_Response.bsvc:Response_Data.bsvc:Job_Category[*]'
	,ElementsToTreatAsArray='bsvc:Job_Category'
	,RequestData='
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bsvc="urn:com.workday/bsvc"&gt;
   &lt;soapenv:Body&gt;
      &lt;bsvc:Get_Job_Categories_Request/&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;'
)</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="wp-image-3946 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-import-soap-api-xml-web-service-advanced-options-sql.png" alt="Import Workday 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 Workday 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 data we just imported. 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="wp-image-4633 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/08/import-netsuite-data-in-power-bi-dashboard.png" alt="Import Workday 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 Workday data in Power BI dashboard</p></div></li>
</ol>
<p>&nbsp;</p>
<h2>Workday API Pagination &#8211; Retrieve more than 100 rows</h2>
<p>By default Workday API will return only 100 records unless you specify Page / Count in <a href="https://community.workday.com/sites/default/files/file-hosting/productionapi/Human_Resources/v17/Get_Workers.html#Response_FilterType" target="_blank" rel="noopener">Response_Filter</a> . Regardless it will only send you 999 maximum rows. To fetch more records after first page you have to setup pagination in XML Driver. Below screenshot</p>
<ol>
<li>Select Paging Mode= POST Data Mode</li>
<li>Enter Page Number Indicator (e.g. <strong>&lt;%page%&gt;</strong> )</li>
<li>Click browse button for <strong>Max Pages Expression </strong>  (select node which indicates how many pages in response. e.g. <strong>Total_Pages</strong>)
<div id="attachment_5054" style="width: 942px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/01/ssis-workday-api-pagination-settings-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5054" class="size-full wp-image-5054" src="https://zappysys.com/blog/wp-content/uploads/2016/01/ssis-workday-api-pagination-settings-1.png" alt="Workday SOAP API Pagination Settings in ZappySys XML / SOAP Driver" width="932" height="553" srcset="https://zappysys.com/blog/wp-content/uploads/2016/01/ssis-workday-api-pagination-settings-1.png 932w, https://zappysys.com/blog/wp-content/uploads/2016/01/ssis-workday-api-pagination-settings-1-300x178.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/01/ssis-workday-api-pagination-settings-1-768x456.png 768w" sizes="(max-width: 932px) 100vw, 932px" /></a><p id="caption-attachment-5054" class="wp-caption-text">Workday SOAP API Pagination Settings in ZappySys XML / SOAP Driver</p></div></li>
<li>Once this is done go to Settings Tab. Edit your Body and make sure you supply Response_Filter. Pass Response_Filter parameter as below. See how we used <strong>&lt;%page%&gt;</strong> placeholder. You can use tool like <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">fiddler</a> to see multiple response at runtime. Run package and check fiddler. In the below example we are fetching maximum 300 rows per response. It will keep reading until all pages are done. For example if you have 1000 rows to read then it will take 4 response behind the scene.<br />
<pre class="crayon-plain-tag">&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bsvc="urn:com.workday/bsvc"&gt;
   &lt;soapenv:Body&gt;
      &lt;bsvc:Get_Job_Categories_Request bsvc:version=""&gt;
        &lt;bsvc:Response_Filter&gt;
            &lt;bsvc:Page&gt;&lt;%page%&gt;&lt;/bsvc:Page&gt;
            &lt;bsvc:Count&gt;300&lt;/bsvc:Count&gt;
         &lt;/bsvc:Response_Filter&gt;
      &lt;/bsvc:Get_Job_Categories_Request&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;</pre>
<div id="attachment_5055" style="width: 804px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/01/ssis-workday-api-pagination-settings-2-body-response-filter.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5055" class="size-full wp-image-5055" src="https://zappysys.com/blog/wp-content/uploads/2016/01/ssis-workday-api-pagination-settings-2-body-response-filter.png" alt="Workday API Pagination - Supply Response_Filter (Page Size and Current Page Number)" width="794" height="377" srcset="https://zappysys.com/blog/wp-content/uploads/2016/01/ssis-workday-api-pagination-settings-2-body-response-filter.png 794w, https://zappysys.com/blog/wp-content/uploads/2016/01/ssis-workday-api-pagination-settings-2-body-response-filter-300x142.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/01/ssis-workday-api-pagination-settings-2-body-response-filter-768x365.png 768w" sizes="(max-width: 794px) 100vw, 794px" /></a><p id="caption-attachment-5055" class="wp-caption-text">Workday API Pagination &#8211; Supply Response_Filter (Page Size and Current Page Number)</p></div></li>
</ol>
<p>That&#8217;s it. Now if you run your query it will fetch all pages and you can now read more than 1000 rows. Make sure you configure Count at reasonable size (Rows per Page) in above screenshot we use 5 just to demo small sample. We suggest you to to set around 300.</p>
<p>&nbsp;</p>
<h2>How to pass parameters to SQL query in Power BI</h2>
<div class="content_block" id="custom_post_widget-3954"><p>In the real world, many values of your REST / SOAP API call may be coming from Parameters. If that&#8217;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>
<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>
<p />
&nbsp;</p>
<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>
<p>&nbsp;</p>
</div>
<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>Conclusion</h2>
<p>Consuming data from Workday 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/connect-workday-power-bi-import-soap-data/">Connect Workday in Power BI &#8211; Import SOAP Data</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 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>
