How to extract view meta data from tableau - tableau-api

I need to extract metadata from view. When I was reading tableau rest API documentation there is no ways mention in the rest api for sheet metadata and also not mention measure and dimension API extraction. If anyone knows the way how to extract data please help me

Take a look at the Tableau Javascript API...specifically the getData method.
The Rest API is used for automating Tableau Server tasks (add users, create schedules, set permissions, etc).

You can embed a hidden extension into your dashboard that can access worksheet, field and filter information. See the docs on extensions here.
Here is a good example of one that could get you started on pulling the worksheet and field information.

Use the Tableau Metadata API - https://help.tableau.com/current/api/metadata_api/en-us/index.html
You can find sample scripts here - https://github.com/tableau/metadata-api-samples

Related

How to connect API as data source in Tableau?

I need to use two data sources. One is SQL and another one is the response from a rest API.
I tried to implement WDC, but it needs an HTML and user need to interact with UI and getting the response.
But I don't want to create a html page.
Is there any way to use an API response as a data source in Tableau?
The short answer is that you can not use API directly as a data source but you should build a pipeline to transform this into flat-file o populate a database table.
The alternative answer is to use Python to connect to the REST API. You can choose to use TabPy or follow some pre-build solution like this one. Personally, I don't know how the performances could be.

Getting filtered/aggregated data from Tableau Server via REST API from custom page

I have existing Tableu Server workbook with diagrams and own datasources(mysql).
Is it possible to fetch data from Tableau Server via Rest Api, e.g. if I build a custom web dashboard and need only data from Tableau?
I am interested in Tableaus ability to filter/aggregate data, thats what it does for its diagrams, would be great to harvest it from custom Python web page for my custom diagrams (e.g. for D3 or Highcharts).
Is "Extracts API" the right direction for this?
Or the path with "Query View Data" is the solution?
If you want to specify the filter values and get the exact set of data that your diagrams/workbooks are using, go with the Query View Data solution.
If you pull the data from the extract, you will get it exactly as it is out of the extract. This means if you have filters or aggregation done in your visualization (which is processed after the extract), it won't apply to the extracted data.

Are any of the columns in the Tableau Server sites or users customizable?

I haven't come across any documentation provided by Tableau in asking this question but I'd like to ask if anyone knows whether the info columns in the Sites or Users section are customizable for anyone with Server Administrator privileges. Mainly these columns show site/user metrics but I'm not sure if you can add your own columns to that list to track your own metrics.
Unfortunately, no. Even Admins do not have the ability to add/sort/change columns on these pages (or any other pages, I believe.)
You can always make this suggestion on the Tableau Ideas Forum though. Others can vote your idea up and Tableau will see it.
You can create your own custom admin views of information stored in the Tableau server repository. See this link. https://onlinehelp.tableau.com/current/server/en-us/adminview_postgres.htm
You could also use the server's Rest API to query information and display however you like. https://onlinehelp.tableau.com/current/api/rest_api/en-us/REST/rest_api.htm
If you're working in Python, there is an open source library that makes using the Rest API more convenient
https://tableau.github.io/server-client-python

In Tableau server, how can we get measures and dimensions of a data set using REST API?

I looked at their REST API but I haven't found anything which gives me the measures and dimensions of the dataset/data source. I need to expose what measures and dimensions are there so that user knows what workbooks or visualizations he can create. Any ideas or help is greatly appreciated.
Fields in a datasource are not something that you can query directly via the REST API. My best suggestion, while not perfect, would be to add a tag for each field that you want to be queryable in the datasource, and then use the REST API to query your datasources show what is available to the user.
This shows you how to tag a datasource
Here is the specific REST API command that will return the tags
I want to stress that this isn't a perfect solution, but the REST API has a very WIP feel to it to begin with (REST should be able to do everything that tabcmd can do, but sadly, it can't).
There is also the undocumented REST API that has some additional functionality. That may have more of what you are looking for. I'm not 100% sure that this will solve your problem, but it does provide a lot of additional functionality to the base API.
Undocumented Tableau REST API

how to specify URL in filters pagePath core reporting api V3

I am building a web app that pulls data through the Core Reporting Api v3 from Google. I am using the client PHP library offered by Google.
I am currently trying to specify a page and retrieve its pageviews for a time range. Every other seems to be working okay except for the fact that if a specfy a filter with ga:pagePath==http://link/uri then I get 0 all the time no matter the time range.
I think the problem is got to do with the setting of value for this pagePath. I want to have spearate data for the desktop version of the site and the smartphone version denoted by s. subdomain
Can anyone hint me on some tips and or tricks to use to get the required data?
Example URL:
http://domain.com/user/profile/id/1
http://s.domain.com/user/profile/id/1
Thanks in advance!
for the the default implementation of Google Analytics, ga:pagePath doesn't include the scheme or hostname so in your case you'd actually want to filter using ga:hostname and ga:pagePath together.
I suggest you use the Query Explorer to build your queries and get familiar with what will work. You can also use this tool to at least get a sense for what type of data the ga:pagePath and ga:hostname dimensions return before trying to filter on them. Finally, once you have the query you want, you can easily get the exact Core Reporting API query by clicking on the Query URI button.
Also check out the Combining Filters section of GA API docs.
So if you want filter on ga:pagepath for domain.com and s.domain.com separately you could do something like
filters=ga:pagePath==/user/profile/id/1;ga:hostname==domain.com
filters=ga:pagePath==/user/profile/id/1;ga:hostname==s.domain.com