The steps to use the API are:
- Construct a TDS
- Create a JWT
- Make the request
- Receive the response
Construct a TDS
A Tableau Data Source (TDS) is an XML-formatted definition of a data source used in Tableau. This document does not cover the construction of a TDS.
Create a JWT
The Explore in Tableau API uses a JWT for authorization. The JWT has the following requirements:
- The algorithm (
alg) in the header must beHS256. - The type (
typ) in the header must beJWT. - The issuer (
iss) claim is required, but can be any string. - The subject (
sub) claim is required, but can be any string. - The issued at (
iat) claim is required, and is expressed in unix time (non-leap seconds since the unix epoch). The API request must be submitted within 5 seconds of theiat.
For help on creating a JWT for the request, see Examples.
Make the request
Method
Submit the request using POST.
URL
https://api.salesforce.com/analytics/integration/explore-in-tableau/v1/upload-tds-content/{data-provider}
Replace {data-provider} with your data provider string.
Headers
| HTTP Header | Possible Values | Notes |
authorization |
C2C:{jwt} |
Replace {jwt} with the JWT. The request must be used within 5 seconds of JWT creation. |
x-salesforce-region |
us-east-1 (United States of America)us-west-2 (United States of America)ap-south-2 (India)ap-southeast-3 (Indonesia)ap-northeast-2 (South Korea)ap-southeast-1 (Singapore)ap-southeast-2 (Australia)ap-northeast-1 (Japan)ca-central-1 (Canada)eu-central-1 (Germany)eu-west-2 (United Kingdom)eu-central-2 (Switzerland) |
If your organization has data residency requirements, choose a region from the list that complies with those requirements. Otherwise, you should generally choose the region that’s closest to your data. |
content-type |
application/json |
JSON is the only valid content type. |
Body
The request body is a JSON object composed of a single name-value pair. The name is tdsContent, and the value is the base64 URLencoded TDS.
For an example, see Examples.
Receive the response
Success response
A successful request returns an HTTP 201 Created status. There is no response body.
The location header in the response contains a Tableau Cloud URL. A user navigating to the URL enters a web authoring session that uses the TDS as the data source. The user will be challenged for Tableau Cloud authentication if they aren’t already logged in.
Error responses
| Code | Reason | Details |
400 |
Bad Request |
Missing mandatory headers or fields, or the payload (TDS) is over 10MB. |
403 |
Forbidden |
Incorrect JWT or outdated timestamp (JWT iat claim is over 5 seconds old). |
429 |
Too Many Requests |
Rate limit exceeded. |
500 |
Internal Server Error |
An error occurred on the server. |