📌 Developers & APIs | Resources
Ciara Brennan (Tableau)
📌 Join the Tableau Developer Program and start learning how you can build on the Tableau Developer Platform to fit your organization's unique needs. You'll get everything you need to keep your skills sharp, including tutorials, webinars, the latest news, and even your own personal development site. You will also get access to thousands of DataDevs members for networking, troubleshooting, Q&As, and expert insights.
Yasmeen Wilde (Member) asked a question.
Here is our use case: Users publish snowflake data source with oauth authentication method and then site admin will edit the published data source on the server to change the authentication method from oauth to username/password using a service account. Site admin will have to download the data source to desktop, change authentication method and then republish. This causes inconvenience to our self-service creators because they will have to rely on site admins to publish their data sources. All published data sources must use service account credential due to our compliance standards.
Deepika Navani (Member) asked a question.
Code I am using since I have a secrets.toml
- tableau_auth = TSC.PersonalAccessTokenAuth(
- st.secrets["tableau"]["token_name"],
- st.secrets["tableau"]["token_secret"],
- st.secrets["tableau"]["site_id"],
- )
- server = TSC.Server(st.secrets["tableau"]["server_url"], use_server_version=True)
- # server.add_http_options({'verify': False})
- server.auth.sign_in(tableau_auth)
Error that I get:
- tableauserverclient.server.endpoint.exceptions.FailedSignInError: Failed Sign In Error: 401001: Signin Error Error signing in to Tableau Server
- Traceback:
- File "/home/deepika/projects/dd-dashboard/pages/3_tableau_dashboard.py", line 13, in <module>
- server.auth.sign_in(tableau_auth)
- File "/home/deepika/.pyenv/versions/3.11.9/lib/python3.11/site-packages/tableauserverclient/server/endpoint/endpoint.py", line 274, in wrapper
- return func(self, *args, **kwargs)
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- File "/home/deepika/.pyenv/versions/3.11.9/lib/python3.11/site-packages/tableauserverclient/server/endpoint/auth_endpoint.py", line 84, in sign_in
- self._check_status(server_response, url)
- File "/home/deepika/.pyenv/versions/3.11.9/lib/python3.11/site-packages/tableauserverclient/server/endpoint/endpoint.py", line 164, in _check_status
- raise FailedSignInError.from_response(server_response.content, self.parent_srv.namespace, url)
Can someone help me here?
Best Answer
@Deepika Navani (Member)
Hi, let's suppose your url site is https://prod-useast-b.online.tableau.com/#/site/mysite/home
What are you using as st.secrets["tableau"]["site_id"]. In this case, you should use mysite as the site content url
Also, I notice an extra comma in line 4, it should be:
- st.secrets["tableau"]["site_id"]
If this post resolves the question, would you be so kind to "Select as Best"?. This will help other users find the same answer/resolution and help community keep track of answered questions. Thank you.
Regards,
Diego Martinez
Tableau Visionary and Forums Ambassador
Pardhasaradhi B (Member) asked a question.
We need to extract the schema and table information of tableau server datasources, either from the tableau repository(Postgresql) or using Postman APIs. We tried doing this with postman, but unfortunately, we are getting all the schemas and tables used for each datasources. Please find the code we used below.
Login: {{baseUrl}}/auth/signin
<tsRequest>
<credentials personalAccessTokenName="extractrefresh"personalAccessTokenSecret="{{personal_token_prod}}" >
<site contentUrl="Site_Name" />
</credentials>
<tsRequest>
=================================
Post:https://tableau.url.com/api/metadata/graphql
{
datasources(filter: { name:"Datasource_Name" }){
name
upstreamDatabases {
tables {
schema
name
}
name
}
}
}
Any recommendation would be greatly appreciated, weather it is related to table connections, Sql query for Postgresql, or any API that suits my requirement.
Dear All,
I am a licensed user on the Tableau Server of my company, and I am the site Admin of one the sites.
I need to pull out the full list of all the schedules registered on the server.
I tried graphQL but failed.
I searched through the following page about graphQL RootTypeQuery, it seems that Schedule is not among the fields available for search. Does this mean there is no way to retrieve the schedule list via graphQL?
https://help.tableau.com/current/api/metadata_api/en-us/reference/query.doc.html
Best Regards,
Jian
Aboud Qudimat (Member) asked a question.
On Tableau Cloud, have a Connected Apps set up with direct trust in an embedding context. I can generate a JWT with the right scopes and auth/signin api returns a token, which I can use to call other REST APIs, except Getting Workbooks by User, which returns a 401 / 401002. Again, the same token works for other APIs except when trying to pull workbooks/projects by user/group.
What does work is mixing PAT and Connected Apps, and using the PAT to query the workbooks - however, preference is to use just Connected Apps.
Other context:
Do we have to switch the connected apps to OAuth?
Have raised an issue here:
https://github.com/tableau/connected-apps-jwt-samples/issues/13
And another near-identical issue from 10 months ago here, but seemingly unresolved:
https://community.tableau.com/s/question/0D58b0000As7NQFCQ2/query-workbooks-for-user-returns-401
Pandu Pabbathi (Member) asked a question.
Hello Tableau Community,
I'm facing an issue with updating the Databricks PAT for a data source connection in Tableau Cloud using the REST API and the Tableau Server Client (TSC) Python SDK. Despite using the following code snippet, the extract refresh fails with a "Missing password" error, suggesting the PAT isn't stored correctly:
connection.connection_credentials = TSC.ConnectionCredentials(
name="",
password="YOUR_PAT_HERE",
embed=True
)
server.workbooks.update_connection(workbook_to_update, connection)
Questions:
Any guidance or insights on resolving this would be greatly appreciated!
Best Regards,
Shreya Mahajan (Member) asked a question.
I am developing a Tableau Extension using the Tableau Extensions API, but I am encountering an issue where changes made to a Set (used as a filter) do not trigger any event in my extension.
What Works:
What Doesn't Work (Issue):
Code Snippet for Reference:
- setEventListeners() {
- this.worksheet = tableau_wrapper.getCurrentWorksheet();
- if (this.worksheet !== undefined) {
- tableau.extensions.dashboardContent.dashboard.getParametersAsync()
- .then(params => {
- params.forEach(param => {
- let cb = param.addEventListener(tableau.TableauEventType.ParameterChanged, reinitializeExtension);
- unregister.push(cb);
- })
- })
- let filterCB = this.worksheet.addEventListener(tableau.TableauEventType.FilterChanged, reinitializeExtension);
- unregister.push(filterCB);
- }
- }
-
- (function () {
- $(document).ready(function () {
- tableau.extensions.initializeAsync({ 'configure': showConfigure }).then(function () {
- console.log('extension triggered');
- setEventListeners();
- tableau.extensions.settings.addEventListener(tableau.TableauEventType.SettingsChanged, (e) => {
- app.updateChart();
- });
- }, function (err) {
- if (err.toString().includes("iframe"))
- location.href = location.origin;
- });
- });
- })();
My Question:
Any insights or workarounds would be greatly appreciated!
Please check out our post with some tips on asking a question and how to help you get answers more quickly.
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.