![]() |
俊逸的茶壶 · 山东省人民政府 政协委员提案办理 ...· 4 天前 · |
![]() |
发呆的哑铃 · 看病不再贵:59元换200万保额,四城推出普 ...· 11 月前 · |
![]() |
至今单身的伏特加 · 《我的世界》x《名侦探柯南》联动今日开启!_ ...· 1 年前 · |
![]() |
爽快的花卷 · linux mint - Error ...· 1 年前 · |
![]() |
重情义的青椒 · [webkit-help] ...· 1 年前 · |
Using the data sources methods of the Tableau Server REST API you can:
This functionality relates to the UI elements and concepts described at: Connect to Your Data (Link opens in a new window) .
The Tableau Server Client library (Link opens in a new window) , a Python wrapper for the REST API, offers the following related items: Data Sources (Link opens in a new window) ; and Populate connections for Data Sources (Link opens in a new window) .
Adds one or more tags to the specified data source.
PUT /api/ api-version /sites/ site-id /datasources/ datasource-id /tags
3.26
. For more information, see
REST API and Resource Versions
.
site-id
The ID of the site that contains the data source.
datasource-id
The ID of the data source to add tags to.
The data source to add the tag to. If the data source is already tagged with a tag that's included in the request body,
those tags are ignored and the data source retains them. If the
<tags>
element is empty, no new
tags are added to the data source.
The text of the tag.
Tableau Server users who are not server administrators or site administrators can call this method only if they
have
Read
permissions for the data source (either explicitly or implicitly).
<tsResponse>
<tag label="tag"/>
... additional new tags ...
... existing tags ...
</tags>
</tsResponse>
Version 1.0 and later. For more information, see REST API and Resource Versions .
For more information, see Handling Errors .
curl "http://MY-SERVER/api/
3.26
/sites/9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d/datasources/1a2a3b4b-5c6c-7d8d-9e0e-1f2f3a4a5b6b/tags" -X PUT -H "X-Tableau-Auth:12ab34cd56ef78ab90cd12ef34ab56cd" -d @add-tags-to-datasource.xml
Content of add-tags-to-datasource.xml:
<tsRequest>
<tag label="GDP" />
<tag label="Health" />
</tags>
</tsRequest>
Example response:
<tsResponse version-and-namespace-settings>
<tag label="GDP"/>
<tag label="Health"/>
<tag label="Spending"/>
</tags>
</tsResponse>
Deletes the specified data source from a site. When a data source is deleted, its associated data connection is also deleted. Workbooks that use the data source are not deleted, but they will no longer work properly.
DELETE /api/ api-version /sites/ site-id /datasources/ datasource-id
3.26
. For more information, see
REST API and Resource Versions
.
site-id
The ID of the site that contains the data source.
datasource-id
The ID of the data source to delete.
Tableau Server users who are not server administrators or site administrators can delete a data source for which they have Read (view) and Delete permissions (either explicitly or implicitly).
Version 2.0 and later. For more information, see REST API and Resource Versions .
For more information, see Handling Errors .
Deletes a tag from the specified data source.
DELETE /api/ api-version /sites/ site-id /datasources/ datasource-id /tags/ tag-name
3.26
. For more information, see
REST API and Resource Versions
.
site-id
The ID of the site that contains the data source.
datasource-id
The ID of the data source to remove the tag from.
tag-name
The name of the tag to remove from the data source.
Tableau Server users who are not server administrators, site administrators, or data source owners can delete a tag from a data source only if
they are project leaders or if they originally added the tag.
Version 1.0 and later. For more information, see REST API and Resource Versions .
For more information, see Handling Errors .
Downloads a data source in
.tdsx
format.
3.26
. For more information, see
REST API and Resource Versions
.
site-id
The ID of the site that contains the data source.
datasource-id
The ID of the data source to download.
extract-value
(Optional) The
extract-value
is a Boolean value (
False
or
True
). When the data source specified for download has an extract, if you add the parameter
?includeExtract=False
, the extract is not included when you download the data source. You can use this parameter to improve performance if you are downloading workbooks or data sources that have large extracts.
Users who are not server administrators or site administrators can download a data source only if they have
ExportXml
permission for the data source (either explicitly or implicitly).
Introduced in Tableau Cloud June 2022 (API 3.16) and Tableau Server 2022.3 (API 3.17).
Authorize use of this method in your connected app by including this scope in its JSON Web Token (JWT). For more information, see Access Scopes for Connected Apps (Link opens in a new window) in the Tableau Cloud Help or Access Scopes for Connected Apps (Link opens in a new window) in the Tableau Server Help.
tableau:datasources:download
The data source content in
.tdsx
format (
Content-Type: application/octet-stream
).
The response will have the following content disposition header:
Content-Disposition: name="tableau_datasource"; filename="
datasource-filename
"
Version 2.0 and later. For more information, see REST API and Resource Versions .
For more information, see Handling Errors .
curl "http://MY-SERVER/api/
3.26
/sites/9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d/datasources/1a2a3b4b-5c6c-7d8d-9e0e-1f2f3a4a5b6b/content" -X GET -H "X-Tableau-Auth:12ab34cd56ef78ab90cd12ef34ab56cd" > my-datasource.tdsx
The response is a file that contains the data source.
Gets an encrypted version of the embedded credentials from the data source. These credentials can only be migrated to the linked destination Tableau Cloud or Tableau Server.
Before you use this method, you must create public and private keys for resources with embedded credentials. For more information, see Migrate Workbooks and Data Sources with Embedded Credentials .
Version: Available in API 3.23 (Tableau Cloud June 2024/ Tableau Server 2024.2) and later. Version Overview (Link opens in a new window)
License: No additional license required.
POST /api/ api-version /sites/ site-luid /datasources/ datasource-luid /retrieveKeychain
"destinationSiteUrlNamespace": "site1", "destinationSiteLuid": "d56023b5-8f8b-4241-aa74-8974ced85827", "destinationServerUrl": "http://localhost"<tsRequest> <destinationSiteUrlNamespace>site1</destinationSiteUrlNamespace> <destinationSiteLuid>d56023b5-8f8b-4241-aa74-8974ced85827</destinationSiteLuid> <destinationServerUrl>http://example.com</destinationServerUrl> </tsRequest>
curl --location "https://example.org/api/3.24/sites/7a2f773d-4a9f-496e-afc6-a60517cb1b86/datasources/1a2a3b4b-5c6c-7d8d-9e0e-1f2f3a4a5b6b/retrieveKeychain" --header "Content-Type: application/xml" --header "X-Tableau-Auth: nbQAstTxTHuBlcMlXZ3QKg|LXn5aiYcffck999kgpOPrQft5JkvRsYg|7a2f773d-4a9f-496e-afc6-a60517cb1b86" --data "<tsRequest> <destinationSiteUrlNamespace>site1</destinationSiteUrlNamespace><destinationSiteLuid>9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d</destinationSiteLuid><destinationServerUrl>http://example.com</destinationServerUrl></tsRequest>"
<tsResponse>
<associatedUserLuidList/>
<encryptedKeychainList>
<encryptedKeychain>BADsJ5lBKho2Tdqqbo7txS8IyKgNw5FnJud0etCHJLhBUurgIRHk3g5AeMQg6KHBw+6nwNIDEd65MKi76DLd5aIMhQC5aLCR4NE7R2gp7JbxLo+nOMGnfDQm5XekJVpLQGfY53GIX52ED2iTfOQ0yRNbnPV4djT0z23rosG0gpmqXV/py5okFzVW4wx8RisnZdvv+SAlv222jVhksX1w5A6HB3Bs45BeWfpwrOnHwnNoWUGwHuu4iGlyE7m65RlATZN+fvDGOFN1zU2lXaSZyWqRKiWkD+oCS5wRNtJ6lGz7RnesKvH6QEL9sT8cXA1ZOEA531xNAv9rjazEP5BssIdA1GcJ5J7zar5xxC68qm3cz3MkndyqWXZrf0vWPgwysUHEpWn60oDG/8/xG6c0Eigh4gwE+dA+NF1L2q9VyhVr8+AzJ7vatf95LDwAuRT43G3Q+WApx9qBPXco15pKjwy00rHPgn4cRtu+unwh6d3gIh6AbK6X++U/vV/Ktpe31lSZmV8eHPeTNfdCrGOT9ozZhF5oKhsBZyFrVY7Wtf1YcXawh3bvtZxg9d8a2mKNXDeaF+uJrpI43aFa4KrJKdfvDpq2k0aJhL1QNxWSFBYw0tPJX/rhKAeOHHY2K44Wh5JNWwL+x1uYap93IK303sJ13hV0jXW7nXUhfIW7o5iUtbYWrpCvVwubZLf4U5Y=</encryptedKeychain>
</encryptedKeychainList>
</tsResponse>
"associatedUserLuidList": [],
"encryptedKeychainList": {
"encryptedKeychain": "BADsJ5lBKho2Tdqqbo7txS8IyKgNw5FnJud0etCHJLhBUurgIRHk3g5AeMQg6KHBw+6nwNIDEd65MKi76DLd5aIMhQC5aLCR4NE7R2gp7JbxLo+nOMGnfDQm5XekJVpLQGfY53GIX52ED2iTfOQ0yRNbnPV4djT0z23rosG0gpmqXV/py5okFzVW4wx8RisnZdvv+SAlv222jVhksX1w5A6HB3Bs45BeWfpwrOnHwnNoWUGwHuu4iGlyE7m65RlATZN+fvDGOFN1zU2lXaSZyWqRKiWkD+oCS5wRNtJ6lGz7RnesKvH6QEL9sT8cXA1ZOEA531xNAv9rjazEP5BssIdA1GcJ5J7zar5xxC68qm3cz3MkndyqWXZrf0vWPgwysUHEpWn60oDG/8/xG6c0Eigh4gwE+dA+NF1L2q9VyhVr8+AzJ7vatf95LDwAuRT43G3Q+WApx9qBPXco15pKjwy00rHPgn4cRtu+unwh6d3gIh6AbK6X++U/vV/Ktpe31lSZmV8eHPeTNfdCrGOT9ozZhF5oKhsBZyFrVY7Wtf1YcXawh3bvtZxg9d8a2mKNXDeaF+uJrpI43aFa4KrJKdfvDpq2k0aJhL1QNxWSFBYw0tPJX/rhKAeOHHY2K44Wh5JNWwL+x1uYap93IK303sJ13hV0jXW7nXUhfIW7o5iUtbYWrpCvVwubZLf4U5Y="
400000
Bad Request
The content of the request body is missing or incomplete, or contains malformed XML.
401002
Unauthorized Access
The authentication token provided in the request header was invalid or has expired.
403054 Unauthorized Access A non-administrator user attempted to get data source revision information, but the caller doesn't have sufficient permissions. 404000 Site not found The site ID in the URI doesn't correspond to an existing site. 404004 Data source not found The data source ID in the URI doesn't correspond to an existing data source. 405000 Invalid request method Request type was not POST .For more information, see Handling Errors .
Downloads a specific version of a data source prior to the current one in
.tdsx
format. To down load the current version of a data source use the
Download Data Source
method.
Note: This method is available only if version history is enabled for the specified site. For more information, see Maintain a History of Revisions (Link opens in a new window) in the Tableau Server Help. GET /api/ api-version /sites/ site-id /datasources/ datasource-id /revisions/ revision-number /content
3.26
. For more information, see
REST API and Resource Versions
.
site-id
The ID of the site that contains the data source.
datasource-id
The ID of the data source to download.
revision-number
The revision number of the data source to download. To determine what versions are available, call
Get Data Source Revisions
.
Tableau Server users who are site administrators can download data source revisions on the site that they are administrators for. Users who are not server administrators or site administrators can get data source revisions if they have all of the following:
The data source content in
.tdsx
format (
Content-Type: application/octet-stream
).
The response will have the following content disposition header:
Content-Disposition: name="tableau_datasource"; filename="
datasource-filename
"
Version 2.3 and later. For more information, see REST API and Resource Versions .
For more information, see Handling Errors .
Returns a list of revision information (history) for the specified data source.
Note: This method is available only if version history is enabled for the specified site. For more information, see Maintain a History of Revisions (Link opens in a new window) in the Tableau Server Help.
To get a specific version of the data source from revision history, use the Download Data Source Revision method.
GET /api/ api-version /sites/ site-id /datasources/ datasource-id /revisions
GET /api/ api-version /sites/ site-id /datasources/ datasource-id /revisions?pageSize =page-size &pageNumber =page-number
3.26
. For more information, see
REST API and Resource Versions
.
site-id
The ID of the site that contains the data source to get revisions for.
datasource-id
The ID of the data source to get revisions for.
page-size
(Optional) The number of items to return in one response. The minimum is 1. The maximum is 1000. The default is 100. For more information, see
Paginating Results
.
page-number
(Optional) The offset for paging. The default is 1. For more information, see
Paginating Results
.
Tableau Server users who are site administrators can get data source revisions on the site that they are administrators for. Users who are not server administrators or site administrators can get data source revisions if they have all of the following:
<tsResponse>
<pagination pageNumber="pageNumber" pageSize="page-size"
totalAvailable="total-available" />
<revisions>
<revision revisionNumber="1" publishedAt="date" deleted="false">
<publisher id="publisher-id" name="publisher-name"/>
</revision>
<revision revisionNumber="2" publishedAt="date" deleted="false">
</revision>
<revision revisionNumber="3" publishedAt="date" deleted="false" current="true" sizeInBytes="size>
<publisher id="publisher-id" name="publisher-name"/>
</revision>
</revisions>
</tsResponse>
If the revision element includes the attribute
deleted="true"
, the data source has been deleted and cannot be downloaded using the
Download Data Source Revision
method.
If a user has been deleted from the site, no
<publisher>
element is included in the
<revision>
element.
Version 2.3 and later. For more information, see REST API and Resource Versions .
For more information, see Handling Errors .
Publishes a data source on the specified site, or appends data to an existing data source. To make other changes to a published data source, call Update Data Source or Update Data Source Connection .
Permissions:
You can publish a data source if you have implicit or explicit
Publish
permissions for the data source, or are a Tableau administrator.
Note: The
queryTaggingEnabled
attribute is returned only for administrator users.
Permissions Overview
JWT Access Scope
:
tableau:datasources:create
Access Scopes Overview:
Cloud
(Link opens in a new window)
|
Server-Windows
(Link opens in a new window)
|
Server-Linux
(Link opens in a new window)
Available in API 3.16 (Tableau Cloud June 2022 / Server 2022.3) and later.
This method is used in two ways. You can call it to publish a data source in a single request. To do that, you include the content of the data source file in the body of the request. The maximum size of a file that can be published in a single request is 64 MB. If you want to avoid having the publishing process time out, you can use the asJob parameter to make data source publication asynchronous.
Alternatively, you can publish a data source in multiple parts. To do that, you initiate a file upload by calling Initiate File Upload , send portions of the file to the server using Append to File Upload , and then commit the upload by calling Publish Data Source . In this case, Publish Data Source doesn't contain the file to publish.
Extracts with multiple table options
Starting in v2021.4, you can publish multi table Hyper extract files created using the
Hyper API
(Link opens in a new window)
.
The data must include a single
fact table
(Link opens in a new window)
containing the foreign keys that relate the tables to each other. The Hyper API infers the data object model, but
does not perform any validation, such as referential integrity checking. If the Hyper API can’t infer the data object model of a
Hyper extract, for instance, because there is more than one fact table, then attempting to publish the extract will fail.
Prior to v2021.4, there was no way to append data to an extract with multiple tables using the REST API.
Data Sources stored locally
When you publish a data source from your local computer to the server, you must make sure that the server has all the
components that are required in order for other users to see and interact with the data source. For example, if the data
source is based on an Excel spreadsheet, you typically publish a packaged data source (
.tdsx
file) that contains
all the components for that data source.
Working with Parquet files
- When publishing a Parquet file to a data source through a live-to-Hyper connection, the files are converted to Hyper files.
You may want to publish a copy of your original Parquet file to retain that data in its native format.
- A data source with a live-to-Hyper connection to data in a Hyper file converted from Parquet can only have a single connection.
- When incrementally updating that data from that connection, using the Update Hyper in Data Source method, the Parquet file is not
converted to Hyper.
For more information, see Publishing Resources .
POST /api/ api-version /sites/ site-luid /datasources
POST /api/ api-version /sites/ site-luid /datasources?overwrite= overwrite-flag &asJob= asJob-value
POST /api/ api-version /sites/ site-luid /datasources?append= append-flag
POST /api/ api-version /sites/ site-luid /datasources?uploadSessionId= upload-session-id &datasourceType= datasource-file-type &overwrite= overwrite-flag &append= append-flag
3.26
. For more information, see
REST API and Resource Versions
.
site-luid
The LUID of the site to publish to.
overwrite-flag
true
to overwrite a data source that has the same name, or
false
to fail if the specified data source already exists. The default is
false
. If
overwrite-flag
is set to
true
but the data source doesn't already exist, the operation succeeds.
You can include both the overwrite and append parameters in a request, but they cannot both be true.
asJob-value A Boolean value that is used to publish data sources asynchronously. If you set this value to false (the default), the publishing process runs as a synchronous process. If a data source is very large, the process might time out before it finishes. If you set this value to true , the process runs asynchronously, and a job will start to perform the publishing process and return the job ID. You can check the status of the import job by calling Query Job . append-flag true to append the data being published to an existing data source that has the same name. The default is false . If append-flag is set to true but the data source doesn't already exist, the operation fails. In order to append data to a published data source on Tableau Server, both the source file and the published file must be an extract with the file extension
.hyper
or
.tde
. The schema of the source and the published extract must match.
If an extract was stored using the multiple tables option, you can't append data to it.
You can include both the overwrite and append parameters in a request, but they cannot both be true.
upload-session-luid If you are calling this method to commit a file that was uploaded in parts, this value contains the upload session LUID that was generated by a call to Initiate File Upload . If this value is not included, the server assumes that the body of the request contains the file to be published. datasource-file-type hyper , tds , tdsx , or tde the kind of file that you are uploading. This value is required if you are calling Publish Data Source in order to commit a file that was previously uploaded using Append to File Upload . The value is not used if you upload a file in the body of the request.
Content-Type: multipart/mixed; boundary=
boundary-string
.
useRemoteQueryAgent="False"
description="Sales Data Source">
<connectionCredentials name="janedoe"
password="xxxxxx"
embed="True" />
<project id="ff2a8360-3c2b-4b05-a793-7607c602e1fb" />
</datasource>
</tsRequest>
--
boundary-string
Content-Disposition: name="tableau_datasource"; filename="Sales.TDSX"
Content-Type: application/octet-stream
content-of-datasource-file
--
boundary-string
--
Committing a file previously uploaded
--boundary-string
Content-Disposition: name="request_payload"
Content-Type: text/xml
<tsRequest>
<datasource name="Sales" >
<connectionCredentials name="janedoe" password="xxxxxx"
embed="False" oAuth="True" />
<project id="ff2a8360-3c2b-4b05-a793-7607c602e1fb" />
</datasource>
</tsRequest>
--boundary-string--
Content-Length: 16301
Content-Type: multipart/form-data; boundary=----------------------my_boundary_string
----------------------my_boundary_string
Content-Disposition: form-data; name="part1.json"
Content-Type: application/json
"the_JSON" : {
"foo" : "bar"
----------------------my_boundary_string
Content-Disposition: form-data; name="datasource.tdsx"
Content-Type: application/pdf
"datasource": {
"name": "Sales",
"useRemoteQueryAgent": "True",
"description": "Sales Data Source",
"connectionCredentials": {
"name": "janedoe",
"password": "xxxxxx",
"embed": "True"
"project": {
"id": "ff2a8360-3c2b-4b05-a793-7607c602e1fb"
----------------------my_boundary_string--
Committing
a file previously uploaded
Content-Length: 16301
Content-Type: multipart/form-data; boundary=----------------------my_boundary_string
Content-Disposition: form-data; name="part1.json"
Content-Type: application/json
"the_JSON" : {
"foo" : "bar"
----------------------my_boundary_string
Content-Disposition: form-data; name="datasource.tdsx"
Content-Type: application/pdf
"datasource": {
"name": "Sales",
"connectionCredentials": {
"name": "janedoe",
"password": "xxxxxx",
"embed": "True",
"oAuth": "True"
"project": {
"id": "ff2a8360-3c2b-4b05-a793-7607c602e1fb"
----------------------my_boundary_string--
boundary-string
(Required) A string of characters that is guaranteed to be unique within the body of the request, and that is used to delimit sections of the request body. This value
must be declared as a header that has this format:
Content-type: multipart/mixed; boundary=boundary-string
datasource name
(Required) The name to assign to the data source when it is saved on the server.
datasource useRemoteQueryAgent
(Optional) When
true
, this flag will
allow your Tableau Cloud site to use Tableau Bridge clients
(Link opens in a new window)
. Bridge allows you to maintain data sources with live connections to supported on-premises data sources.
datasource description
(Optional) A description of the datasource.
connectionCredentials
The
<connectionCredentials>
element is required if the data source requires credentials.
If the data source does not require credentials, Tableau will ignore this element if it is present.
connectionCredentials
attributes are:
username
(Required, depending on
oAuth
setting) The connection ceredentials username.
password
(Required, depending on
oAuth
setting) The connection credential password.
embed
(Optional) If
true
credentials are embedded in the datasource.
Default is
false
.
oAuth
(Optional) If the data source connection is configured to use OAuth, set this to
true
to specify
that the value of the
name
attribute in the
connectionCredentials
element is an OAuth username. In that case, no password is
required and the value of the
embed
attribute specifies whether to embed the OAuth
credential with the data source. For more information, see
OAuth Connections
(Link opens in a new window)
in the Tableau Server documentation.
project
The LUID of the project to assign the data source to. If the project is not specified, the data source will be published to the default project.
datasource-file-name
The file name (including extension) of the data source file to upload. This attribute is used in the request body only if the
request also includes the content of the data source file; it is not used if you are committing a file uploaded using
previous requests.
content of datasource file
The content of the data source file, if the request includes the file. The maximum size of a file that can be uploaded in one call is 64 MB.
askDataEnablement
This attribute is not available in API 3.12 and later (Tableau Cloud September 2021 / Server 2021.3).
curl "http://MY_SERVER/api/3.4/sites/ff2a8360-3c2b-4b05-a793-7607c602e1fb/datasources" -X POST -H "X-Tableau-Auth:6fSulU7ET8yjpHteQj56MQ|LrkEdTHcmPkWFcD8wOEy29hlVXm8iPo4" -H "Content-Type: multipart/mixed;" -F "[email protected]" -F "[email protected]"
Content of publish-datasource.xml :
<tsRequest>
<datasource name="datasource1" description="This is a data source named datasource1." >
<project id="522dc5c5-e1da-47b9-8e07-f02929ff5ceb" />
</datasource>
</tsRequest>
createdAt
and
updatedAt
attribute values are returned in UTC format (YYYY-MM-DDTHH:MM:SSZ).
Location: /api/
3.26
/sites/site-id/datasources/id-from-server
.hyper
,
.tds
,
.tdsx
, or
.tde
.
400010
Missing or invalid file type
The request included an
uploadSessionId
parameter but no file type, or the file type was something other than
hyper
,
tds
,
tdsx
, or
tde
.
400010
Unexpected attachments
The message had both a
uploadSessionId
parameter and an attachment, or the message contained more than one attachment.
400011
Publishing error
The data source could not be published for some other reason than those specified earlier.
400019
Malformed request body
The request message is missing or incomplete, or contains malformed XML. Make sure that the
Content-Length
value is set.
400055
Incompatible
overwrite
and
append
values
The
overwrite
and
append
parameter
cannot both be set to
true
.
400129
Invalid Ask Data enablement
The enablement setting in the request body is not valid for the current server configuration.
403007
Insufficient publishing permission
A non-administrator user attempted to publish a data source, but the caller doesn't have sufficient project permissions.
403007
Unlicensed publishing forbidden
A non-administrator user who is unlicensed attempted to publish a data source. This is disallowed for all projects (including the default project).
403007
Overwrite forbidden
A data source with the specified name already exists and the
overwrite
parameter was not set to
true
.
403007
Problem connecting to data source
There was a problem connecting to a data source. This can be due to missing or invalid connection credentials or because
the referenced data source is not available on the server.
403008
Insufficient storage quota
The data source could not be published because there is not enough storage remaining on the server to accommodate its size.
404000
Site not found
The site ID in the URI doesn't correspond to an existing site.
404004
Data source not found
The
append
parameter is
true
but the data source name specified
in the request body does not correspond to an existing data source.
404005
Project not found
The project ID in the request body doesn't correspond to an existing project on the site.
404015
File upload not found
The file upload session ID in the request body doesn't correspond to an existing file upload on the site.
405000
Invalid request method
Request type was not
POST
.
For more information, see Handling Errors .
Returns information about the specified data source.
Note : After you create a resource, the server updates its search index. If you make a query immediately to see a new resource, the query results might not be up to date.
GET /api/ api-version /sites/ site-id /datasources/ datasource-id
3.26
. For more information, see
REST API and Resource Versions
.
site-id
The site that contains the data source.
datasource-id
The ID of the data source to get.
Users who are not server administrators or site administrators can view a data source only if they have Connect permission for the data source (either explicitly or implicitly).
Introduced in Tableau Cloud June 2022 (API 3.16) and Tableau Server 2022.3 (API 3.17).
Authorize use of this method in your connected app by including this scope in its JSON Web Token (JWT). For more information, see Access Scopes for Connected Apps (Link opens in a new window) in the Tableau Cloud Help or Access Scopes for Connected Apps (Link opens in a new window) in the Tableau Server Help.
tableau:content:read
<tsResponse> <datasource id="datasource-id" certificationNote="certification-note" name="datasource-name" description="data-source-description" type="datasource-type" contentUrl="datasource-content-url" createdAt="datetime-created" updatedAt="datetime-updated" encryptExtracts="encryptExtracts" hasExtracts="has-extracts-flag" isCertified="is-certified-flag" useRemoteQueryAgent="use-remote-query-agent-flag" webpageUrl="web-page-url" > <project id="project-id" name="project-name" /> <owner id="datasource-owner-id" /> <tag label="tag"/> ... additional tags ... </tags> <askData enablement="enablement-setting"/> </datasource> </tsResponse>
datetime-created and datetime-updated attribute values are returned in UTC format (YYYY-MM-DDTHH:MM:SSZ).Version
Version 1.0 and later. For more information, see REST API and Resource Versions.
Errors
404004 Data source not found The data source ID in the URI doesn't correspond to an existing data source. 405000 Invalid request method Request type was not GET.For more information, see Handling Errors.
Example
curl "http://MY-SERVER/api/3.26/sites/9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d/datasources/1a2a3b4b-5c6c-7d8d-9e0e-1f2f3a4a5b6b" -X GET -H "X-Tableau-Auth:12ab34cd56ef78ab90cd12ef34ab56cd"
Example response:
<tsResponse version-and-namespace-settings> <datasource id="1a2a3b4b-5c6c-7d8d-9e0e-1f2f3a4a5b6b" name="Activity rates and healthy living" certificationNote="This is a note about the datasource certification." contentUrl="activity-dates-and-healthy-living" encryptExtracts="true" description="The Activity and Health data source." isCertified="true" type="excel-direct" createdAt="2011-03-30T22:32:35Z" updatedAt="2016-01-13T01:00:02Z"> useRemoteQueryAgent="false" webpageUrl="https://MYSERVER/#/datasources/4414" <project id="1f2f3e4e5-d6d7-c8c9-b0b1-a2a3f4f5e6e" name="default"/> <owner id="9f9e9d9c-8b8a-8f8e-7d7c-7b7a6f6d6e6d"/> </tags> <askData enablement="Enabled"/> </datasource> </tsResponse>
Note: This method returns connection information, including connection type. In some cases, the name of the connection type might not map directly to a name of a connection type that you're familiar with. In those cases, see Mapping ConnectionType Names for more information.
Query Data Sources
Returns a list of published data sources on the specified site, with optional parameters for specifying the paging of large results. To get a list of data sources embedded in a workbook, use the Query Workbook Connections method.
Note: After you create a resource, the server updates its search index. If you make a query immediately to see a new resource, the query results might not be up to date.
Version: Available in API 1.0 and later.
License: No additional license required.
Permissions: Tableau Server users who are not server administrators or site administrators can view a data source only if they have Connect permissions for the data source (either explicitly or implicitly).
Access Scope:
tableau:content:read
Access scope introduced in API 3.16 (Tableau Cloud June 2022 / Tableau Server 2022.3)
For more information, see Versions(Link opens in a new window), Permissions(Link opens in a new window), and access scopes for Cloud(Link opens in a new window), Server-Windows,(Link opens in a new window) or Server-Linux(Link opens in a new window).
GET /api/api-version/sites/site-id/datasources
GET /api/api-version/sites/site-id/datasources?pageSize=page-size&pageNumber=page-number
GET /api/api-version /sites/site-id/datasources?filter=filter-expression
GET /api/api-version/sites/site-id/datasources?sort=sort-expression
GET /api/api-version/sites/site-id/datasources?fields=field-expression
Parameter Values
api-version The version of the API to use, such as3.26
. For more information, see REST API and Resource Versions. site-id The ID of the site that contains the data sources. page-size (Optional) The number of items to return in one response. The minimum is 1. The maximum is 1000. The default is 100. For more information, see Paginating Results. page-number (Optional) The offset for paging. The default is 1. For more information, see Paginating Results. filter-expression (Optional) An expression that lets you specify a subset of data sources to return. You can filter on predefined fields such asname
andupdatedAt
. You can include multiple filter expressions. For more information, see Filtering and Sorting. sort-expression (Optional) An expression that lets you specify the order in which user information is returned. If you do not specify a sort expression, the sort order of the information that's returned is undefined. For more information, see Filtering and Sorting. field-expression (Optional) An expression that lets you specify the set of available fields to return. You can qualify the return values based upon predefined keywords such as_all_
or_default_
, and you can specify individual fields for the data sources or other supported resources. You can include multiple field expressions in a request. For more information, see Using Fields in the Rest API.Note: The filter and sort parameters can be combined with each other and with paging parameters and fields parameters using an ampersand (
&
).Request Body
Response Code
Response Body
"id": "datasource1-id", "description": "data-source-description", "name": "datasource-name", "size": "datasource-size", "type": "datasource-type", "contentUrl": "datasource-content-url", "createdAt": "datetime-created", "updatedAt": "datetime-updated", "encryptExtracts": "encrypt-extracts-flag", "hasExtracts": "has-extracts-flag", "isCertified": "is-certified-flag", "useRemoteQueryAgent": "use-remote-query-agent-flag", "webpageUrl": "datasource-webpage-url", "project": { "id": "project-id", "name": "project-name" "owner": { "id": "datasource-owner-id" "tags": [ "label": "tag"<tsResponse> <pagination pageNumber="pageNumber" pageSize="page-size" totalAvailable="total-available" /> <datasources> <datasource id="datasource1-id" description="data-source-description" name="datasource-name" size="datasource-size" type="datasource-type" contentUrl="datasource-content-url" createdAt="datetime-created" updatedAt="datetime-updated" encryptExtracts="encrypt-extracts-flag" hasExtracts="has-extracts-flag" isCertified="is-certified-flag" useRemoteQueryAgent="use-remote-query-agent-flag" webpageUrl="datasource-webpage-url" > <project id="project-id" name="project-name" /> <owner id="datasource-owner-id" /> <tag label="tag"/> <!-- potential additional tags --> </tags> </datasource> <!-- potential additional data sources --> </datasources> </tsResponse>
cURL Example
curl "http://MY-SERVER/api/3.26/sites/9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d/datasources" -X GET -H "X-Tableau-Auth:12ab34cd56ef78ab90cd12ef34ab56cd"
Example response:
<tsResponse version-and-name-space-settings> <pagination pageNumber="1" pageSize="100" totalAvailable="2"/> <datasources> <datasource id="1a2a3b4b-5c6c-7d8d-9e0e-1f2f3a4a5b6b" name="Sample - Coffee Chain (Access)" size="1" type="googledrive" contentUrl="coffee-chain" description="The Sample - Coffee Chain data source." type="msaccess" createdAt="2011-03-30T22:32:35Z" updatedAt="2016-01-13T01:00:02Z" encryptExtracts="false" isCertified="false" useRemoteQueryAgent="false" webpageUrl="https://my-server.com/#/site/my-site/datasources/1275708" > <project id="1f2f3e4e-5d6d-7c8c-9b0b-1a2a3f4f5e6e" name="Default"/> <owner id="9f9e9d9c-8b8a-8f8e-7d7c-7b7a6f6d6e6d"/> <tag label="test"/> </tags> </datasource> </datasources> </tsResponse>
Errors
403014 Page size limit exceeded The specified page size is larger than the maximum page size. 404000 Site not found The site ID in the URI doesn't correspond to an existing site. 405000 Invalid request method Request type was not GET.For more information, see Handling Errors.
Query Data Source Connections
Returns a list of data connections for the specified data source.
GET /api/api-version/sites/site-id/datasources/datasource-id/connections
Parameter Values
api-version The version of the API to use, such as3.26
. For more information, see REST API and Resource Versions. site-id The ID of the site that contains the data source. datasource-id The ID of the data source to return connection information about. Users who are not server administrators or site administrators can query a data source only if they have Read (view) permission for the data source (either explicitly or implicitly).queryTaggingEnabled
is returned only for administrator users.Required scope for JWT authorization
Introduced in Tableau Cloud June 2022 (API 3.16) and Tableau Server 2022.3 (API 3.17).
Authorize use of this method in your connected app by including this scope in its JSON Web Token (JWT). For more information, see Access Scopes for Connected Apps(Link opens in a new window) in the Tableau Cloud Help or Access Scopes for Connected Apps(Link opens in a new window) in the Tableau Server Help.
tableau:content:read
Response Code
Response Body
<tsResponse> <connections> <connection id="connection-id" type="connection-type" serverAddress="server-address" serverPort="port" userName="connection-user-name" queryTaggingEnabled="query-tagging-enabled" authenticationType="authentication-type" useOAuthManagedKeychain="using-OAuth-managed-keychain-or-not /> /> < ... additional connections ... > </connections> </tsResponse>
Version
Version 2.3 and later. For more information, see REST API and Resource Versions.
Errors
403021 Read forbidden A user who is not a server administrator user attempted to query the data source connections, but the caller doesn't have Read permission. 404000 Site not found The site ID in the URI doesn't correspond to an existing site. 404011 Data source not found The data source ID in the URI doesn't correspond to an existing data source. 405000 Invalid request method Request type was not GET.For more information, see Handling Errors.
Example
curl "http://MY-SERVER/api/3.26/sites/9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d/datasources/1a1b1c1d-2e2f-2a2b-3c3d-3e3f4a4b4c4d/connections" -X GET -H "X-Tableau-Auth:12ab34cd56ef78ab90cd12ef34ab56cd"
Example response:
<tsResponse version-and-namespace-settings> <connections> <connection id="12ab34cd-56ef-78ab-90cd-12ef34ab56cd" type="dataengine" /> <connection id="374371c0-ffe9-4e16-b48e-6b868e3026ca" type="dataengine" /> <connection id="08a7b6b5-b4ba-be3a-4d2d-1e9e59a8a7b6" type="dataengine" /> </connections> </tsResponse>
Note: This method returns connection information, including connection type. In some cases, the name of the connection type might not map directly to a name of a connection type that you're familiar with. In those cases, see Mapping ConnectionType Names for more information.
Remove Data Source Revision
Removes a specific version of a data source from the specified site.
The content is removed, and the specified revision can no longer be downloaded using Download Data Source Revision. If you call Get Data Source Revisions, the revision that's been removed is listed with the attribute
IsDeleted="true"
.Note: Calling this method permanently removes the specified data source revision.
DELETE /api/api-version/sites/site-id/datasources/datasource-id/revisions/revision-number
Parameter Values
api-version The version of the API to use, such as3.26
. For more information, see REST API and Resource Versions. site-id The ID of the site that contains the group. datasource-id The ID of the data source to remove the revision for. revision-number The revision number of the data source to remove. To determine what versions are available, call Get Data Source Revisions.Permissions
Tableau Server users who are site administrators can remove data source revisions on the site that they are administrators for. Users who are not server administrators or site administrators can remove data source revisions if they have all of the following:
Version 2.3 and later. For more information, see REST API and Resource Versions.
For more information, see Handling Errors.
Incrementally updates data (insert, update, upsert, replace and delete) in a published data source from a live-to-Hyper connection, where the data source has multiple connections.
A live-to-Hyper connection has a Hyper or Parquet formatted file/database as the origin of its data.
For all connections to Parquet files, and for any data sources with a single connection generally, you can use the Update Data in Hyper Data Source method without specifying theconnection-id
.
A request for this method must include an upload-session-id
for a Hyper file payload containing an upload of the most
current data from the data source for your published live-to-Hyper data. Use
Initiate File Upload(Link opens in a new window) and
Append to File Upload(Link opens in a new window) methods
to form the payload and acquire upload-session-id.
For details and examples, see Update Data in Published Live-to-Hyper Data Sources.
Note:
While Hyper Update REST API methods make incremental changes much more efficient, multiple simultaneous update requests and large
changes in large datasets can overwhelm Tableau server background processes. To mitigate this issue, Hyper Update requests are
limited by the server configuration setting api.server.update_uploaded_file.max_size_in_mb
. Starting in
Tableau Server 2022.1 / Tableau Cloud March 2022, the default for this setting is 100MB. In previous versions, the limit was set to 10MB.
Where heavy incremental update traffic is expected, we recommend you use a chunking strategy to limit the size of each update, and
fine tune max_size_in_mb
value to optimize performance for your exact conditions.
PATCH /api/api-version/sites/site-id/datasources/datasource-id/connections/connection-iddata?uploadSessionId=upload-session-id
3.26
.
For more information, see REST API and Resource Versions.
site-id
The ID of the site that contains the data source.
datasource-id
The ID of the data source to update.
connection-id
The ID of the connection. To determine what connections are available for a data source, call Query Data Source Connections.
upload-session-id
The upload session ID. A user-generated identifier that is unique to a request. If the server receives more than one request
with the same ID within 24 hours, all subsequent requests will be treated as duplicates and ignored by the server. This can be used
to guarantee idempotency of requests.
This method supports only JSON content-type for the request body.
{"actions": [
{"action": action-type",
"source-schema": "source-schema-name",
"source-table": "source-table-name",
"target-schema": "target-schema-name",
"target-table": "target-table-name",
"condition": {conditional-declaration"}
. . . more action definition . . .}
{. . . more actions . . .}
Attribute Values
actions-type
(Required) The definition of the operation(s) to perform on the data in the target hyper file.
source-schema-name
(Optional) The name of the source database schema for the data to be updated. A value is not required unless there are multiple
schemas in the database.
source-table-name
(Required) The name of the source database table containing the data to be updated.
target-schema-name
(Optional) The name of the target hyper file schema of the data to be updated from the source database. A value is not required
unless there are multiple schemas in the database.
target-table-name
(Required) The name of the table containing the data to be updated in the target hyper file.
condition
(Required for insert
, upsert
, and delete
)A declaration that defines a
comparison operation between source and target data or between source or target data and a user provided constant.
For details and examples, see Update Data in Published
Live-to-Hyper Data Sources.
An action
is an operation to be performed on specified target data. Multiple different actions can be
defined as a batch in a request. The supported actions are:
insert
- Inserts rows from a named source-table in your data source into a named target-table
in your published Hyper. A simplified example is:
{"action": "insert", "source-table": "added_users", "target-table": "current_users"}
update
– Updates existing tuples from a named source-table
in your data source into a named
target-table
in your published Hyper. The tuples to be updated are defined in a condition declaration.
A simplified example is:
{"action": "update",
"target-table": "my_data",
"source-table": "uploaded_table",
"condition": {"op": "eq", "target-col": "row_id",
"source-col": "update_row_id"}
upsert
- Updates a tuple inside the target-table
, if such a tuple exists. If no such tuple exists, a new tuple will be inserted. The tuples to be updated are defined in a condition declaration. A simplified example is:
{"action": "upsert",
"target-table": "my_data",
"source-table": "uploaded_table",
"condition": {"op": "gt", "target-col": "row_id",
"source-col": "update_row_id"}
replace
– Deletes all tuples from a target-table
and inserts all data from a
source-table
with a matching schema. A simplified example is:
{"action": "replace", "source-table": "added_users",
"target-table": "current_users"}
delete
– Deletes tuples from a target-table. The tuples to be deleted are defined in a condition declaration.
A simplified example is:
{"action": "delete",
"target-table": "my_extract_table",
"source-table": "deleted_row_id_table",
"condition": {"op": "gt", "target-col": "id",
"source-col": "deleted_id"}
For more information, see
Update Data in Published Live-to-Hyper Data Sources.
Permissions
The user calling this method must be the data source owner and must have the overwrite permission on it.
Request Header
In addition to the typical authentication token, the following fields must be specified as part of the request header:
content-type: application/json
- This endpoint accepts JSON only.
RequestID
- A user-generated identifier that uniquely identifies a request. If the server receives more than one
request with the same id within 24 hours, all subsequent requests will be treated as duplicates and ignored by the server.
This can be used to guarantee idempotency of requests, which prevents executing the same job more than once could be caused
by network anomalies or client crashes.
Response Code
Response Body
The response body returns the job-id, which specifies the ID of the async job that will carry out the data operations described in the
action batch. This returned "job-id" can be used to
query the status of the update job(Link opens in a new window) or to cancel a scheduled job(Link opens in a new window).
(job-id: "scheduled-job-luid"}
Version
Version 2o21.2 and later. For more information, see REST API and Resource Versions.
Errors
400000
Bad request
The content of the request body is missing or incomplete, or contains malformed JSON.
400008
Invalid parameter value
A parameter in the request body is missing or invalid.
403062
Update data source multiple connections forbidden
A connection ID is required because the data source has multiple connections. Consider using
Update Data in Hyper Connection to specify the connection.
(This error does not apply to that Connection method)
403032
Update forbidden
A non-administrator user tried to update a data source, but the caller doesn't have
Write permission.
404000
Site not found
The site ID in the URI doesn't correspond to an existing site.
404004
Data source not found
The data source LUID in the request body doesn't correspond to an existing data source.
404004
Data source not found
The data source ID in the URI doesn't correspond to an existing data source.
404008
Operation not supported
The operation requested is not supported, the source data for the connection must
be a Hyper file/database.
404020
Connection not found
No resource was found for the specified connection and data source.
(This error does not apply to Update Data in Hyper Data Source)
405000
Invalid request method
Request type was not PATCH.
409015
Data source name conflict
The data source name in the request already belongs
to the specified site. For the purpose of uniqueness checks, data source names are case-insensitive.
409094
Data update job already exists
A data update job for the datasource is already queued or in progress.
Update Data in Hyper Data Source
Incrementally updates data (insert, update, upsert, replace and delete) in a published data source from a
live-to-Hyper connection, where the data source has a single connection.
A live-to-Hyper connection has a Hyper or Parquet formatted file/database as the origin of its data.
For data sources with multiple connections, you can specify which to update using the
Update Data in Hyper Data Source method.
A request for this method must include an upload-session-id
for a Hyper file payload containing an upload of the most
current data from the data source for your published live-to-Hyper data. Use
Initiate File Upload(Link opens in a new window) and
Append to File Upload(Link opens in a new window) methods
to form the payload and acquire upload-session-id.
For details and examples, see Update Data in Published
Live-to-Hyper Data Sources.
Note:
While Hyper Update REST API methods make incremental changes much more efficient, multiple simultaneous update requests and large
changes in large datasets can overwhelm Tableau server background processes. To mitigate this issue, Hyper Update requests are
limited by the server configuration setting api.server.update_uploaded_file.max_size_in_mb
. Starting in
Tableau Server 2022.1 / Tableau Cloud March 2022, the default for this setting is 100MB. In previous versions, the limit was set to 10MB.
Where heavy incremental update traffic is expected, we recommend you use a chunking strategy to limit the size of each update, and
fine tune max_size_in_mb
value to optimize performance for your exact conditions.
Working with Parquet files
- When publishing a Parquet file to a data source through a live-to-Hyper connection, the files are converted to Hyper files.
You may want to publish a copy of your original Parquet file to retain that data in its native format.
- A data source with a live-to-Hyper connection to data in a Hyper file converted from Parquet can only have a single connection.
- When incrementally updating that data from that connection, using the Update Hyper in Data Source method, the Parquet file is not
converted to Hyper.
PATCH /api/api-version/sites/site-id/datasources/datasource-id/data?uploadSessionId=upload-session-id
Parameter Values
The version of the API to use, such as 3.26
.
For more information, see REST API and Resource Versions.
site-id
The ID of the site that contains the data source.
datasource-id
The ID of the data source to update.
upload-session-id
The upload session ID. A user-generated identifier that is unique to a request. If the server receives more than one request
with the same ID within 24 hours, all subsequent requests will be treated as duplicates and ignored by the server. This can be used
to guarantee idempotency of requests.
Request Body
This method supports only JSON content-type for the request body.
{"actions": [
{"action": action-type",
"source-schema": "source-schema-name",
"source-table": "source-table-name",
"target-schema": "target-schema-name",
"target-table": "target-table-name",
"condition": {conditional-declaration"}
. . . more action definition . . .}
{. . . more actions . . .}
Attribute Values
actions-type
(Required) The definition of the operation(s) to perform on the data in the target hyper file.
source-schema-name
(Optional) The name of the source database schema for the data to be updated. A value is not required unless there are multiple
schemas in the database.
source-table-name
(Required) The name of the source database table containing the data to be updated.
target-schema-name
(Optional) The name of the target hyper file schema of the data to be updated from the source database. A value is not required
unless there are multiple schemas in the database.
target-table-name
(Required) The name of the table containing the data to be updated in the target hyper file.
condition
(Required for insert
, upsert
, and delete
)A declaration that defines a
comparison operation between source and target data or between source or target data and a user provided constant.
For details and examples, see Update Data in Published
Live-to-Hyper Data Sources.
An action
is an operation to be performed on specified target data. Multiple different actions can be
defined as a batch in a request. The supported actions are:
insert
- Inserts rows from a named source-table in your data source into a named target-table
in your published Hyper. A simplified example is:
{"action": "insert", "source-table": "added_users", "target-table": "current_users"}
update
– Updates existing tuples from a named source-table
in your data source into a named
target-table
in your published Hyper. The tuples to be updated are defined in a condition declaration.
A simplified example is:
{"action": "update",
"target-table": "my_data",
"source-table": "uploaded_table",
"condition": {"op": "eq", "target-col": "row_id",
"source-col": "update_row_id"}
upsert
- Updates a tuple inside the target-table
, if such a tuple exists. If no such tuple exists, a new tuple will be inserted. The tuples to be updated are defined in a condition declaration. A simplified example is:
{"action": "upsert",
"target-table": "my_data",
"source-table": "uploaded_table",
"condition": {"op": "gt", "target-col": "row_id",
"source-col": "update_row_id"}
replace
– Deletes all tuples from a target-table
and inserts all data from a
source-table
with a matching schema. A simplified example is:
{"action": "replace", "source-table": "added_users",
"target-table": "current_users"}
delete
– Deletes tuples from a target-table. The tuples to be deleted are defined in a condition declaration.
A simplified example is:
{"action": "delete",
"target-table": "my_extract_table",
"source-table": "deleted_row_id_table",
"condition": {"op": "gt", "target-col": "id",
"source-col": "deleted_id"}
For more information, see
Update Data in Published Live-to-Hyper Data Sources.
Permissions
The user calling this method must be the data source owner and must have the overwrite permission on it.
Request Header
In addition to the typical authentication token, the following fields must be specified as part of the request header:
content-type: application/json
- This endpoint accepts JSON only.
RequestID
- A user-generated identifier that uniquely identifies a request. If the server receives more than one
request with the same id within 24 hours, all subsequent requests will be treated as duplicates and ignored by the server.
This can be used to guarantee idempotency of requests, which prevents executing the same job more than once could be caused
by network anomalies or client crashes.
Response Code
Response Body
The response body returns the job-id, which specifies the ID of the async job that will carry out the data operations described in the
action batch. This returned "job-id" can be used to
query the status of the update job(Link opens in a new window) or to cancel a scheduled job(Link opens in a new window).
(job-id: "scheduled-job-luid"}
Version
Version 2o21.2 and later. For more information, see REST API and Resource Versions.
Errors
400000
Bad request
The content of the request body is missing or incomplete, or contains malformed JSON.
400008
Invalid parameter value
A parameter in the request body is missing or invalid.
403062
Update data source multiple connections forbidden
A connection ID is required because the data source has multiple connections. Consider using
Update Data in Hyper Connection to specify the connection.
(This error does not apply to that Connection method)
403032
Update forbidden
A non-administrator user tried to update a data source, but the caller doesn't have
Write permission.
404000
Site not found
The site ID in the URI doesn't correspond to an existing site.
404004
Data source not found
The data source LUID in the request body doesn't correspond to an existing data source.
404004
Data source not found
The data source ID in the URI doesn't correspond to an existing data source.
404008
Operation not supported
The operation requested is not supported, the source data for the connection must
be a Hyper file/database.
404020
Connection not found
No resource was found for the specified connection and data source.
(This error does not apply to Update Data in Hyper Data Source)
405000
Invalid request method
Request type was not PATCH.
409015
Data source name conflict
The data source name in the request already belongs
to the specified site. For the purpose of uniqueness checks, data source names are case-insensitive.
409094
Data update job already exists
A data update job for the datasource is already queued or in progress.
Update Data Source
Updates the owner, project or certification status of the specified data source.
Version: Available in API 2.0 and later.
License: No additional license required.
Permissions:
You can update data source details if you are a Tableau administrator. Specific properties can be updated by other users
depending on the type of update action and the permissions granted to the user.
Users who are not server administrators can move a data source from one project to another if they own the data source or
the current (source) project, or are a project leader for the current project, and they have
Write permission for the destination project.
Users can change certification status and the certification note if they are server administrators, site administrators,
or project leaders for the current project.
Users can modify the name of the data source if: they have server or site administrator permissions, or the site role of Creator
or higher and access to the data source with the overwrite capability.
Access Scope: tableau:datasources:update
Access scope introduced in API 3.16 (Tableau Cloud June 2022 / Tableau Server 2022.3)
For more information, see Versions(Link opens in a new window),
Permissions(Link opens in a new window),
and access scopes for Cloud(Link opens in a new window), Server-Windows,(Link opens in a new window) or Server-Linux(Link opens in a new window).
PUT /api/api-version/sites/site-id/datasources/datasource-id
Note: Starting in 2021.2, you can also modify (insert, update, upsert, replace, and delete) data in a published data source that is a
live-to-Hyper connection. To do this, use the Update Data in Hyper Data Source method,
or for data sources with multiple connections, use the Update Data in Hyper Connection
method. For more information, see UpdateData in Published Live-to-Hyper Data Sources.
Path Parameter Values
api-version
The version of the API to use, such as 3.26
. For more information, see REST API and Resource Versions.
site-luid
The LUID of the site that contains the data source.
datasource-luid
The LUID of the data source to update.
<datasource name="Sales"
isCertified="true"
certificationNote="This is a certification note."
encryptExtracts="false">
<project id="56c86f04-b834-4a08-a561-86497bb4b2df"/>
<owner id="20148c74-7818-4eb8-b2a1-9f3f5f582613"/>
<askData enablement="true [REMOVED IN API 3.12]"/>
</datasource>
</tsRequest>
"name": "Sales",
"isCertified": "true",
"certificationNote": "This is a certification note.",
"encryptExtracts": "false",
"project": {
"id": "56c86f04-b834-4a08-a561-86497bb4b2df"
"owner": {
"id": "20148c74-7818-4eb8-b2a1-9f3f5f582613"
"askData": {
"enablement": "true [REMOVED IN API 3.12]"
Request Attributes
datasource encryptExtracts
(Optional) true to encrypt the extracts or false to not encrypt extracts. For more information, see Extract and Encryption Methods.
askDataEnablement
This attribute is removed in API 3.12 and later (Tableau Cloud September 2021 / Server 2021.3).
(Optional) Determines if a data source allows use of Ask Data. The value can be Enabled
, Disabled
,
or SiteDefault
.
If enablement
is not specified, Ask Data availability for the data source is unchanged during this update.
If the askData
element is included, it must contain an enablement
attribute. Setting the value of
enablement
to SiteDefault
for a data source will cause its enablement to follow the site's settings
for Availability of Ask Data
. A value of Enabled
or Disabled
will
override a site's settings for the data source unless the setting Always disable Ask Data
is selected. In that case, Ask Data will not be available for the data source regardless of the value of enablement
.
Any combination of the attributes inside the <datasource> element is valid.
Only the attributes and child elements that are included result in updates to the data source. If no attributes or nested
elements are included, no update is made.
If the <project> element is included, the id
attribute must be included, and any other attributes of the <project> element are ignored.
If the <owner> element is included, the id attribute must be included, and any other
attributes of the owner are ignored.
cURL Example
curl --location --request GET "https://MY_SERVER/api/3.16/sites/a946d998-2ead-4894-bb50-1054a91dcab3/datasources" \ --header "X-Tableau-Auth: b09KVmT7QxuLVLv1En7iMg"oxKwSGTYT0WKRes5xk3dgI4gIkG3TM8W"a946d998-2ead-4894-bb50-1054a91dcvv8" \ --header "Content-Type: application/xml" \ --data-raw "<tsRequest/> <datasource name='Sales'/><datasource/><tsRequest/>>"
Response Code
Response Body
<tsResponse>
<datasource name="Sales" id="75b71d2f-e8d3-42af-b654-d953659326ee"
contentUrl="mySite" type="excel-direct"
createdAt="2016-02-12T23:36:09Z" updatedAt="2020-12-16T15:33:03Z"
isCertified="false"
certificationNote="This is a certification note."
encryptExtracts="false">
<project id="56c86f04-b834-4a08-a561-86497bb4b2df" />
<owner id="20148c74-7818-4eb8-b2a1-9f3f5f582613" />
<job id="65348c74-7818-4eb8-b2a1-9f3f5f588870" />
<askData enablement="true [REMOVED IN API 3.12]" />
</datasource>
</tsResponse>
"id": "75b71d2f-e8d3-42af-b654-d953659326ee",
"contentUrl": "mySite",
"type": "excel-direct",
"createdAt": "2016-02-12T23:36:09Z",
"updatedAt": "2020-12-16T15:33:03Z",
"isCertified": "false",
"certificationNote": "This is a certification note.",
"encryptExtracts": "false",
"project": {
"id": "56c86f04-b834-4a08-a561-86497bb4b2df"
"owner": {
"id": "20148c74-7818-4eb8-b2a1-9f3f5f582613"
"job": {
"id": "65348c74-7818-4eb8-b2a1-9f3f5f588870"
"askData": {
"enablement": "true [REMOVED IN API 3.12]"
createdAt
and
updatedAt
attribute values are returned in UTC format (YYYY-MM-DDTHH:MM:SSZ).
Errors
400000
Bad request
The content of the request body is missing or incomplete, or contains malformed XML.
400008
Invalid parameter value
A user attempted to rename a datasource to a name containing only spaces, or to a name with more 255 characters.
400129
Invalid Ask Data enablement
The requested enablement setting in the request body does not correspond to the site configuration.
403027
Owner update forbidden
A non-administrator user tried to change the owner for the data source.
403030
Project update forbidden
A non-administrator user tried to change the project for the data source, but the caller doesn't
have Write permission for the project.
403032
Update forbidden
A non-administrator user tried to update a data source, but the caller doesn't have
Write permission.
403141
Update forbidden
A user attempted to update a data source that they do not have permissions to update.
404000
Site not found
The site ID in the URI doesn't correspond to an existing site.
404002
Owner not found
The owner ID in the request body doesn't correspond to an existing owner.
404004
Data source not found
The data source ID in the URI doesn't correspond to an existing data source.
404005
Project not found
The project ID in the request body doesn't correspond
to an existing project.
405000
Invalid request method
Request type was not PUT or PATCH.
409015
Data source name conflict
The data source name in the request already belongs
to the specified site. For the purpose of uniqueness checks, data source names are case-insensitive.
Update Data Source Connection
Updates the server address, port, username, or password for the specified data source connection.
Version: Available in API 2.3 and later.
License: No additional license required.
Permissions: Users who are server administrators or site administrators can change the connection for a data source or
enable query tagging(Link opens in a new window).
Users who are not server administrators can only update a data source. If they have Write (save)
permission for the data source and if they have write permission for the project.
Access Scope: tableau:datasources:update
Access scope introduced in API 3.16 (Tableau Cloud June 2022 / Server 2022.3)
For more information, see Versions(Link opens in a new window),
Permissions(Link opens in a new window),
and access scopes for Cloud(Link opens in a new window), Server-Windows,(Link opens in a new window) or Server-Linux(Link opens in a new window).
PUT /api/api-version/sites/site-id/datasources/datasource-id/connections/connection-id
Path Parameter Values
api-version
The version of the API to use, such as 3.26
. For more information, see REST API and Resource Versions.
site-luid
The LUID of the site that contains the data source.
datasource-luid
The LUID of the data source to update.
connection-luid
The LUID of the connection to update. To determine what connections are available for a data source, call
Query Data Source Connections.
Starting with API 3.23 (Tableau Cloud June 2024 / Server 2024.2), the queryTaggingEnabled
attribute is deprecated,
will no longer be supported, and may be retired in future releases.
Instead, for Tableau Server, use TSM to enable query tagging for all content on a server by
setting native_api.UserInfoInGeneratedSQLEnabled
(Link opens in a new window) to true
.
For API 3.22 (Tableau Cloud February 2024 / Server 2024.1) and earlier: If true
, query tagging is enabled. If false
, query tagging is disabled. The default is false
.
For more information on query tagging, see Understand Workbook Impact on Your Database Using Query Tagging(Link opens in a new window).
Any combination of the attributes inside the <connection> element is valid. If no attributes are included, no
update is made.
cURL Request Example
curl --location --request PUT "https://example.com/api/3.16/sites/9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d/datasources/1a2a3b4b-5c6c-7d8d-9e0e-1f2f3a4a5b6b/connections/12ab34cd-56ef-78ab-90cd-12ef34ab56cd" --header "Content-Type: application/xml" --header "X-Tableau-Auth;" --data "<tsRequest><connection serverAddress='database.example.com' serverPort='12345' userName='jajohnson' password='p@ssword' embedPassword='true' queryTaggingEnabled='false' /></tsRequest>"
Response Code
Response Body
<tsResponse>
<connection id="12ab34cd-56ef-78ab-90cd-12ef34ab56cd"
serverAddress="database.example.com"
serverPort="12345"
userName="jajohnson"
queryTaggingEnabled="false" />
</tsResponse>
"connection": {
"id": "12ab34cd-56ef-78ab-90cd-12ef34ab56cd",
"serverAddress": "database.example.com",
"serverPort": "12345",
"userName": "jajohnson",
"queryTaggingEnabled": "false"
Errors
400000
Bad request
The content of the request body is missing or incomplete, or contains malformed XML.
403023
Update forbidden
A non-administrator user tried to update a data source, but the caller doesn't have Write permission.
403027
Owner update forbidden
A non-administrator user tried to change connection information, but the caller doesn't have Write permission.
403062
Unsupported operation
The data source contains multiple connections, but the URI did not include /connections/connection-id
to indicate which
connection should be updated.
404000
Site not found
The site ID in the URI doesn't correspond to an existing site.
404004
Data source not found
The data source ID in the URI doesn't correspond to an existing data source.
405000
Invalid request method
Request type was not PUT.
For more information, see Handling Errors.
Update Data Source Now
Runs an extract refresh on the specified data source.
Note: This method will fail and result in an error if your Server Administrator has disabled the RunNow setting for the site. For more information, see Tableau Server Settings(Link opens in a new window).
Version: Available in API 2.8 and later.
License: No additional license required.
Permissions: Users who are not server administrators or site administrators can only refresh extracts for data sources if they own the data source, or if they are the project leader for the project.
Access Scope: tableau:tasks:run
Access scope introduced in API 3.16 (Tableau Cloud June 2022 / Tableau Server 2022.3)
For more information, see Versions(Link opens in a new window),
Permissions(Link opens in a new window),
and access scopes for Cloud(Link opens in a new window), Server-Windows,(Link opens in a new window) or Server-Linux(Link opens in a new window).
This method runs an extract refresh for the specified data source, with no need to associate that extract refresh with a scheduled task.
This method is the equivalent of selecting a data source using the Tableau Server UI, and then selecting Refresh Extracts from the menu
(also known as a "manual refresh"), however, the REST method always runs a full refresh even if the refresh type is set to incremental. Similar to a manual refresh, if the extract is a .tde
file, it will be converted to a
.hyper
file as a result of the refresh. To learn more about extract upgrades to the .hyper
file format, see
Extract Upgrade to .hyper Format.
POST /api/api-version/sites/site-id/datasources/datasource-id/refresh
Parameter Values
api-version
The version of the API to use, such as 3.26
. For more information, see REST API and Resource Versions.
site-id
The ID of the site that contains the data source.
datasource-id
The ID of the data source to refresh.
<tsResponse>
<job id="job-id" mode="Asynchronous" type="RefreshExtract" createdAt="date-time">
<extractRefreshJob>
<datasource id="datasource-id" name="datasource-name" />
</extractRefreshJob>
</tsResponse>
400000
Bad Request
The content of the request body is missing or incomplete, or contains malformed XML.
401000
Unauthorized Access
The authentication token provided in the request header was invalid or has expired.
403032
Update Forbidden
A non-administrator user attempted to update a data source, but the caller doesn't have sufficient permissions.
404000
Site not found
The site ID in the URI is unknown.
404004
Data source not found
The data source ID in the URI is unknown.
405000
Invalid request method
Request type was not POST.
409093
Operation already in Queue
The extract refresh job is already in the queue.
For more information, see Handling Errors.
cURL Example
curl "http://MY-SERVER/api/3.26/sites/1edc53ac-e247-4870-9fd3-6fad0ce5f84d/datasources/89a82d78-664f-45a1-8256-d4d2961a070b/refresh" -X POST -H "X-Tableau-Auth:12ab34cd56ef78ab90cd12ef34ab56cd" –d @empty-tsrequest.xml"
Content of empty-tsrequest.xml:
<tsRequest>
</tsRequest>
Example response:
<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-2.8.xsd">
<job id="20cf4ddc-6d73-4733-89ec-8d336669bd56" mode="Asynchronous" type="RefreshExtract" createdAt="2017-12-06T22:58:52Z">
<extractRefreshJob>
<datasource id="89a82d78-664f-45a1-8256-d4d2961a070b" name="World Indicators Extract" />
</extractRefreshJob>
</tsResponse>
Upload Data Source Encrypted Keychain
Uploads the encrypted version of the embedded credentials. This method will only work if the credentials are encrypted with the latest public key used to link the source Tableau Server with the destination Tableau Cloud or Tableau Server site.
Before you use this method, you must create public and private keys for resources with embedded credentials. For more information, see Migrate Workbooks and Data Sources with Embedded Credentials.
Version:
Available in API 3.23 (Tableau Cloud June 2024/ Tableau Server 2024.2) and later.
Version Overview(Link opens in a new window)
License:
No additional license required.
<associatedUserLuidMapping/>
<encryptedKeychainList>
<encryptedKeychain>BADsJ5lBKho2Tdqqbo7txS8IyGlBu9LiRyb8etCHJLhBUurgIRHk3g5AeMQg6KHBw+6nwNIDEd65MKi76DLd5aIMhQC5aLCR4NE7R2gp7JbxLo+nOMGnfDQm5XekJVpLQGfY53GIX52ED2iTfOQ0yRNbnPV4djT0z23rosG0gpmqXV/GlBu9LiRyb8wx8RisnZdvv+SAlv222jVhksX1w5A6HB3Bs45BeWfpwrOnHwnNoWUGwHuu4iGlyE7m65RlATZN+fvDGOFN1zU2lXaSZyWqRKiWkD+oGlBu9LiRyb8Gz7RnesKvH6QEL9sT8cXA1ZOEA531xNAv9rjazEP5BssIdA1GcJ5J7zar5xxC68qm3cz3MkndyqWXZrf0vWPgwysUHEpWn60oDG/8/xG6c0Eigh4gwE+dA+NF1GlBu9LiRyb8+AzJ7vatf95LDwAuRT43G3Q+WApx9qBPXco15pKjwy00rHPgn4cRtu+unwh6d3gIh6AbK6X++U/vV/Ktpe31lSZmV8eHPeTNfdCrGOT9ozZhF5oKGlBu9LiRyb8tf1YcXawh3bvtZxg9d8a2mKNXDeaF+uJrpI43aFa4KrJKdfvDpq2k0aJhL1QNxWSFBYw0tPJX/rhKAeOHHY2K44Wh5JNWwL+x1uYap93IK303sJ1GlBu9LiRyb8UhfIW7o5iUtbYWrpCvVwubZLf4U5Y=</encryptedKeychain>
</encryptedKeychainList>
</tsRequest>
"associatedUserLuidMapping": [],
"encryptedKeychainList": {
"encryptedKeychain": "BADsJ5lBKho2Tdqqbo7txS8IyGlBu9LiRyb8etCHJLhBUurgIRHk3g5AeMQg6KHBw+6nwNIDEd65MKi76DLd5aIMhQC5aLCR4NE7R2gp7JbxLo+nOMGnfDQm5XekJVpLQGfY53GIX52ED2iTfOQ0yRNbnPV4djT0z23rosG0gpmqXV/GlBu9LiRyb8wx8RisnZdvv+SAlv222jVhksX1w5A6HB3Bs45BeWfpwrOnHwnNoWUGwHuu4iGlyE7m65RlATZN+fvDGOFN1zU2lXaSZyWqRKiWkD+oGlBu9LiRyb8Gz7RnesKvH6QEL9sT8cXA1ZOEA531xNAv9rjazEP5BssIdA1GcJ5J7zar5xxC68qm3cz3MkndyqWXZrf0vWPgwysUHEpWn60oDG/8/xG6c0Eigh4gwE+dA+NF1GlBu9LiRyb8+AzJ7vatf95LDwAuRT43G3Q+WApx9qBPXco15pKjwy00rHPgn4cRtu+unwh6d3gIh6AbK6X++U/vV/Ktpe31lSZmV8eHPeTNfdCrGOT9ozZhF5oKGlBu9LiRyb8tf1YcXawh3bvtZxg9d8a2mKNXDeaF+uJrpI43aFa4KrJKdfvDpq2k0aJhL1QNxWSFBYw0tPJX/rhKAeOHHY2K44Wh5JNWwL+x1uYap93IK303sJ1GlBu9LiRyb8UhfIW7o5iUtbYWrpCvVwubZLf4U5Y="
cURL Request Example
curl --location "https://example.org/api/3.24/sites/7a2f773d-4a9f-496e-afc6-a60517cb1b86/datasources/1a2a3b4b-5c6c-7d8d-9e0e-1f2f3a4a5b6b/applykeychain" --header "Content-Type: application/xml" --header "X-Tableau-Auth: nbQAstTxTHuBlcMlXZ3QKg|LXn5aiYcffck999kgpOPrQft5JkvRsYg|7a2f773d-4a9f-496e-afc6-a60517cb1b86" --data "<tsRequest> <destinationSiteUrlNamespace>site1</destinationSiteUrlNamespace> <destinationSiteLuid>9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d</destinationSiteLuid> <destinationServerUrl>http://example.com</destinationServerUrl> </tsRequest>"
Response Code
Response Body
None.
400000
Bad Request
The content of the request body is missing or incomplete, or contains malformed XML.
401002
Unauthorized Access
The authentication token provided in the request header was invalid or has expired.
403054
Unauthorized Access
A non-administrator user attempted to get data source revision information, but the caller doesn't have sufficient permissions.
404000
Site not found
The site ID in the URI doesn't correspond to an existing site.
404004
Data source not found
The data source ID in the URI doesn't correspond to an existing data source.
405000
Invalid request method
Request type was not PUT.
![]() |
发呆的哑铃 · 看病不再贵:59元换200万保额,四城推出普惠医疗保险-虎嗅网 11 月前 |