Getting into the Undocumented Tableau Server API
Before we start to take a look at getting into the Tableau Server API let’s take a look at what’s possible…
Quick Access to your Workbooks & Data Sources
Do you use Google Chrome & love Tableau Server, Public and/or Online? You can go get the Google Chrome Extension for Tableau Server
Publish Data Directly from Alteryx
Have Alteryx Designer? Want to get your data directly into Tableau Server from your module’s workflow? You’re going to want our Alteryx Tools for Tableau
How to Get Started
So how’s it best to get started? First of all download Fiddler, run it and start to interact Tableau Desktop or Tabcmd with Tableau Server. Make a interaction, for instance sign in to Tableau Server from Tableau Desktop, and take a look at what’s been captured by Tableau Server.
There are a number of ways to authenticate pragmatically with Tableau Server, each with varying difficulty
[Easy] Use the browser
When you login to your Tableau Server through the portal Tableau creates an authentication cookie on your local machine which can be used in subsequent calls. Therefore if you first login as usual to your server you can then use your browser to read from the API.
[Easy] URL tags
It is possible to just add your username and password to your server URL. Simply append the following to your server URL:
Substituting the … for your username and password.
Beware though this will send your password in free text across your network and at worse across the internet.
[Difficult] Encrypt the password with RSA
The Tableau Server portal by default encrypts your password between the login form in the local web browser and the server itself. In order to encrypt the password for API authentication you’ll need a few things. First of all call /auth.xml on your Tableau Server and grab the modulus, exponent & authenticity_token from the resulting XML as well as the workgroup_session_id, now known as the cookie, from the call’s header. You’ll see all this information coming through in Fiddler while testing out your method.
Finally your code will need to POST all this information to /auth/login.xml on the Tableau Server with the cookie as the header and cypted, authenticity_token & username in the payload with ‘crypted’ being the encrypted password.
The resulting XML will again have a workgroup_session_id in the call’s header which is appended to the end of following string ‘username=;’ to create the final session cookie. That cookie should then be placed in the header of all subsequent calls you make to the Tableau Server.
What Can You Do?
One of the best places to look at possible calls, other than what you can capture through Fiddler, is the /auth.xml page on your Tableau Server.
For instance to list all the views on your sever:
Tell us what you get up to
We’d love to hear what you end up creating from the Tableau Server API. Please either post a comment or send us an email email@example.com