What is a Zuar Rapid Portal?

Zuar Rapid Portal is an out-of-the-box embedded analytics application that secures and brands your Tableau environment.

Learn more about the Zuar Rapid Portal or start a trial for a Zuar Rapid Portal.

What is the Tableau REST API?

From Tableau's documentation:

With the Tableau Server REST API you can manage and change Tableau Server resources programmatically, using HTTP. The API gives you simple access to the functionality behind the data sources, projects, workbooks, site users, and sites on a Tableau server. You can use this access to create your own custom applications or to script interactions with Tableau Server resources.

How does the Zuar Rapid Portal leverage the Tableau REST API?

One of the ways the Zuar Rapid Portal leverages the Tableau REST API is by querying all the views available to the user and using the thumbnails of the views as a list of dashboard "cards". When a user clicks on one of the dashboard cards, that dashboard is embedded at the top of the page.

Below is an example of the list of dashboards a user has access to and a preview of those dashboards as clickable cards.

The Zuar Rapid Portal also allows users to explore the Tableau REST API using only their web browser. This is a critical feature that can dramatically speed up Tableau custom development. We will be exploring this feature throughout the rest of this blog post.

Use the Zuar Rapid Portal to authenticate with the Tableau REST API

The Zuar Rapid Portal authenticates with the Tableau REST API using a Tableau Server/Online URL, site, username, and password.

In the normal customer use case, a Zuar Rapid Portal is already configured to use the customer's specific Tableau Server/Online and site, but in the example below we have a slightly modified login page that allows us to specify any Tableau Server/Online we want to test against.

Learn more about authenticating with the Tableau REST API.

Tableau REST API Session information

Once logged into the Zuar Rapid Portal, you can navigate to the /about page in your browser's URL bar to see information about your current Zuar Rapid Portal session. For example: https://{your-rapid-portal-url}/about

Here's an example response:

{
  "payload": {
    ...
  },
  "tableau_server": {
    "url": "https://{tableau_server_url}",
    "site_name": "Demo",
    "product_version": "2020.1.1",
    "rest_api_version": "3.7",
    "build_number": "20201.20.0305.1738",
    "site_id": "6a2d5b20-fda8-4af1-87e6-073548996468",
    "site_content_url": "Demo",
    "site_state": null,
    "default_permissions": null
  },
  ...
}

Some critical pieces of data here include:

  • rest_api_version - The rest_api_version is the version of the Tableau REST API. This is used in all the Tableau REST API calls.
  • site_id - The site_id is used for most of the Tableau REST API calls

Exploring the Tableau REST API with the Zuar Rapid Portal

As mentioned previously, the Zuar Rapid Portal allows users to explore the Tableau REST API using only their web browser.

Important notes:

  • Only Tableau REST API GET requests will work in your browser on the Zuar Rapid Portal.
  • The Tableau REST API request URIs are exactly the same in the Zuar Rapid Portal as they would be when querying a Tableau Server/Online directly. The only difference is the "base url". You use https://{your-rapid-portal-url}/api/{api-version}/serverinfo for example instead of https://{your-tableau-server-url}/api/{api-version}/serverinfo.
  • Having an XML viewer extension in your browser is very helpful. We use XV - XML viewer for Chrome. All of the screenshots with XML below use this browser extension.

Below are a few example questions a user may have and the corresponding Tableau REST API request using the Zuar Rapid Portal.

What's my Tableau Server/Online server version and API version?

Tableau REST API Method: Server Info

Returns the version of Tableau Server and the supported version of the REST API.

URI: /api/{api-version}/serverinfo

Example response:

<?xml version='1.0' encoding='UTF-8'?>
<tsResponse
	xmlns="http://tableau.com/api"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-3.7.xsd">
	<serverInfo>
		<productVersion build="20201.20.0305.1738">2020.1.1</productVersion>
		<prepConductorVersion>2020.1.3</prepConductorVersion>
		<restApiVersion>3.7</restApiVersion>
		<platform>Linux</platform>
		<serverSettings>
			<oAuthEnabled>true</oAuthEnabled>
			<sheetImageMaxAgeFloor>1</sheetImageMaxAgeFloor>
			<sheetImageMaxAgeCeiling>240</sheetImageMaxAgeCeiling>
			<offlineInteractionSupportedPhase>2</offlineInteractionSupportedPhase>
		</serverSettings>
	</serverInfo>
</tsResponse>

What Tableau site am I authenticated with?

Tableau REST API Method: Query Sites

Returns a list of the sites on the server that the caller of this method has access to. This method is not available for Tableau Online.

URI: /api/{api-version}/sites

Example response:

<?xml version='1.0' encoding='UTF-8'?>
<tsResponse
	xmlns="http://tableau.com/api"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-3.7.xsd">
	<pagination pageNumber="1" pageSize="100" totalAvailable="1"/>
	<sites>
		<site id="6a2d5b20-fda8-4af1-87e6-073548996468" name="Demo" contentUrl="Demo" adminMode="ContentAndUsers" disableSubscriptions="false" state="Active" revisionHistoryEnabled="true" revisionLimit="25" subscribeOthersEnabled="true" allowSubscriptionAttachments="true" guestAccessEnabled="false" cacheWarmupEnabled="true" commentingEnabled="true" flowsEnabled="true" extractEncryptionMode="disabled" catalogingEnabled="true" derivedPermissionsEnabled="true" webExtractionEnabled="true" runNowEnabled="true" userVisibilityMode="FULL" requestAccessEnabled="true"/>
	</sites>
</tsResponse>

What Tableau views does my user have access to?

Tableau REST API Method: Query Views for Site

Returns all the views for the specified site, optionally including usage statistics.

URI: /api/{api-version}/sites/{site-id}/views

Example response:

<?xml version='1.0' encoding='UTF-8'?>
<tsResponse
	xmlns="http://tableau.com/api"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-3.7.xsd">
	<pagination pageNumber="1" pageSize="100" totalAvailable="15"/>
	<views>
		<view id="50b109eb-811c-4d98-b06c-f10cd4655060" name="HR- Diversity &amp; Inclusion" contentUrl="HR-DiversityInclusion/sheets/HR-DiversityInclusion" createdAt="2019-11-08T20:39:33Z" updatedAt="2020-03-05T21:03:39Z" viewUrlName="HR-DiversityInclusion">
			<workbook id="03a634df-4096-4df0-8980-36e99a25c387"/>
			<owner id="31ae12bb-6fab-4cc5-a6b6-44e4273d5f53"/>
			<project id="53288103-434a-48de-8093-2a2b84957b7b"/>
			<tags>
				<tag label="Commission"/>
				<tag label="embed"/>
			</tags>
		</view>
		<view id="1d0761a8-179c-4bfb-94ba-5cb3e201c9e2" name="HR - Attrition Overview" contentUrl="HR-AttritionOverview/sheets/HR-AttritionOverview" createdAt="2019-11-08T20:40:29Z" updatedAt="2019-11-21T21:56:08Z" viewUrlName="HR-AttritionOverview">
			<workbook id="a343fb5f-383d-4951-b3bd-6a2d82df94e5"/>
			<owner id="31ae12bb-6fab-4cc5-a6b6-44e4273d5f53"/>
			<project id="53288103-434a-48de-8093-2a2b84957b7b"/>
			<tags>
				<tag label="Audit"/>
				<tag label="embed"/>
			</tags>
		</view>
		...
	</views>
</tsResponse>

What's the preview image for a specific view?

Tableau REST API Method: Query View Preview Image

Returns the thumbnail image for the specified view.

URI: /api/{api-version}/sites/{site-id}/workbooks/{workbook-id}/views/{view-id}/previewImage

What Tableau users are on my site?

Tableau REST API Method: Get Users on Site

Returns the users associated with the specified site.

URI: /api/{api-version}/sites/{site-id}/users

Example response:

<?xml version="1.0" encoding="UTF-8"?>
<tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-3.8.xsd">
  <pagination pageNumber="1" pageSize="100" totalAvailable="29"/>
  <users>
    <user externalAuthUserId="" id="96ee6e64-1098-4f87-a51b-17a26c3d19ee" lastLogin="2020-09-22T19:44:43Z" name="tabadmin" siteRole="ServerAdministrator"/>
    <user externalAuthUserId="" id="9b85a1d9-c092-462f-af89-42a49944aebf" name="portal" siteRole="Viewer"/>
    <user externalAuthUserId="" id="6ae070b1-51e4-4d8d-bdd3-bfa41af1afb9" lastLogin="2020-09-23T01:40:02Z" name="Whitney" siteRole="ServerAdministrator"/>
    ...
  </users>
</tsResponse>

Final thoughts

The ability for the Zuar Rapid Portal to query your Tableau Server/Online REST API directly in a browser is incredibly useful for anyone looking to extend the capabilities of the Zuar Rapid Portal or developing their own embedded analytics solutions with Tableau. Users can quickly explore the Tableau REST API directly in their browser and prototype and test advanced Tableau functionality without having to write any code.

Learn more about the Zuar Rapid Portal or start a trial for a Zuar Rapid Portal.