![]() The JSON schema can have a hierarchy of levels in the export there are two levels – one for the main data and one for Attributions. To save the data, right click anywhere in the screen and select “Save As…” and give it a name, such as “ your_name.json”: Import to TableauĪs Tableau can read JSON files natively, we can open the JSON file directly in Tableau Desktop without any data prep required: This is the JSON data that has been returned by the Tableau Public API. After a few seconds, something similar to the below should appear on screen: Once you have your URL, paste it into a browser and hit return. index – this is the starting point for the count, so let’s say I have 200 visualisations and I want to extract the data in two batches of 100, the first call would end with: ?count=100&index=0 and the second call would end with: ?count=100&index=101.Josh notes that the API can time out if you go above 300, so if you have more than 300 visualisations on your profile then, first of all, congratulations! that’s pretty good going secondly, you’ll need to make multiple API calls, and that’s where the second parameter comes in. I’ve set this to 100 as that’s how many visualisations I have on my profile. count – specifies the number of visualisations you would like to fetch data for.I learned more about these from Josh Tapley‘s blog post in relation to his great work on the Cerebro Project. There are two parameters at the end of the URL: count and index. profile.name/workbooks?count=100&index=0įor example, the API URL for myself is: marc.reid/workbooks?count=100&index=0 There is a set format for the URL and to create yours, all you need to do is replace profile.name in the below link with your own profile name – this is the name you login to Tableau Public with and which you will also see in the browser URL once logged in. Using the API is surprisingly simple you paste a URL into a browser and all of your Tableau Public data magically appears on screen. ![]() Finally, I provide a template workbook that you can use to build your own custom Tableau Public explorer dashboard. ![]() I then give an overview of the fields I found useful to visualise and visualisation I created. Jeff’s blog provides an excellent step-by-step guide on obtaining your Tableau Public data through the API and I follow those steps below along with some screenshots. I noticed recently that I was approaching 100 visualisations and thought it would be interesting to take a look at how I’ve interacted with the platform over the last couple of years and also how others have interacted with my visualisations over that time.įortunately, I had recently read Jeffrey Shaffer’s blog post on how to use the Tableau Public API and it turned out to be the perfect method for being able to answer my questions. You can see the use statistics for all your tokens, for any specified period, on your Mapbox account Statistics page.Tableau Public has been instrumental in helping me build an online portfolio of data visualisations since I started using the product in early 2017. Tokens without restrictions will work for requests originating from any URL.įor more information on requirements and details for implementing URL restrictions, see the Account documentation. When you add a URL restriction to a token, that token will only work for requests that originate from the URLs you specify. You can make your access tokens for web maps more secure by adding URL restrictions. When creating an access token, you will have the option to add public or private scopes to the token.įor a complete list of available scopes and recommendations see the Account documentation. ![]() The API documentation lists the scopes required for each Mapbox API. ![]() For more information on the metadata object’s properties, see our Tokens API documentation ScopesĮach access token you create will have a set of permissions that allow the token to make certain types of requests to Mapbox APIs - these are called scopes. Every token has a metadata object that contains properties with information about the token, like id (unique identifier), note (human readable name), scopes (capabilities), allowedURLs (URLs that token is authorized for), and timestamps for created and modified (last modification). Each token is a string delimited by dots into three parts: header, payload, and signature as described in the Tokens API documentation. Mapbox uses JSON Web Tokens (JWT) as the token format. You can find your access tokens, create new ones, or delete existing ones on your Access Tokens page or programmatically using the Mapbox Tokens API. Mapbox uses access tokens to associate API requests with your account. To use any of Mapbox's tools, APIs, or SDKs, you'll need a Mapbox access token. ![]()
0 Comments
Leave a Reply. |