Note: This Tableau report displays plant data between 2019-01-01 and 2019-03-31.
This example assumes you are creating Tableau reports in Tableau Desktop or Tableau Public. The embedded report was published and read from Tableau Public Server.
To make a successful API call, the following 3 items are required:
bearer token to authorize the API callWeb Data Connector as Data SourceAPI endpoint with query parameters (ie., API request URL) to identify a subset of the data
The bearer token is required for all API calls. To generate a token go to the Generate Access Token method on our API documentation, enter your IIR user credentials and desired Token Lifetime, and click TRY. If successful you will get a response similar to this:
The token can be found by clicking the "Response Headers" tab and copying the text after "authorization: Bearer ", as highlighted in the adjacent image.
The IIR API does not support token lifetimes of more than 30 days. Tableau will cache results and prevent you from suddenly having a blank report, but if you need it to always be up-to-date you'll need to keep that token current. Make sure that you have a plan in place to update the access token on a monthly basis.
Using the Web Data Connector option in Tableau requires one to have built it out first. A web data connector is a piece of wrapper code that preps your web data for consumption by Tableau. Once that is developed, you can use the connector from within Tableau to connect to it, and the URL that represents the connector is what you need to use. For more information, see
Tableau Help - Web Data Connector
New Data Source in Tableau. Click Web Data Connector.https://iir-api-web-connector.herokuapp.com/ JSON/XML Connector screen.
A basic API Call is suitable for returning small result-sets of a known size. For summary or reference list endpoints the upper limit is 1000, for detail endpoints the upper limit is 50. This example is going to query the plants/summary endpoint to get a list of summarized plants based on the query parameters sent to the endpoint.
Query parameters being used in this example include:
physicalAddressCountryName=U.S.A.physicalAddressStateName=FloridaliveDateMin=2019-01-01liveDateMax=2019-03-31JSON/XML Connector screen:
https://api.industrialinfo.com/idb/v1.2/plants/summary?physicalAddressCountryName=U.S.A.&physicalAddressStateName=Florida&liveDateMin=2019-01-01&liveDateMax=2019-03-01
Advanced + and paste your API Token as the bearer token. Post and not Get.
Data Source view, go to Sheet1.Longitude in ColumnsLatitude in RowsMarksBackground Maps, etc.
Here is a list of know limitations for connecting via Web Data Connector: