Using the API


The steps to use the API are:

  1. Construct a TDS
  2. Create a JWT
  3. Make the request
  4. 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:

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
us-west-2
ca-central-1
eu-central-1
eu-west-2
ap-southeast-1
ap-southeast-2
ap-northeast-1
ap-southeast-3
If your organization has data residency requirements, choose a region from the list below to comply with those requirements. If you aren’t aware of a limitation, choose any region from the list.
US East (N. Virginia) - us-east-1
US West (Oregon) - us-west-2
Canada (Central) - ca-central-1
EU (Frankfurt) - eu-central-1
EU (London) - eu-west-2
Asia Pacific (Singapore) - ap-southeast-1
Asia Pacific (Sydney) - ap-southeast-2
Asia Pacific (Tokyo) - ap-northeast-1
Asia Pacific (Jakarta) - ap-southeast-3
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.