6 Replies Latest reply on Dec 19, 2018 7:41 PM by Wes Hunt

    Download Tableau .twb File via REST API

    Patrick Carlson

      I have a published file that has extract enabled on our Tableau server.  When I use the REST API and download it specifying includeExtract=False, it still downloads a .twbx file.  Is it possible to have a published extract file on the server but just download the .twb XML file?



        • 1. Re: Download Tableau .twb File via REST API
          Jeff Strauss

          I had a look at the REST API and am using version 2.4.  I see the same result as you.  I would have thought that adding the includeExtract=False would have excluded the extract, but apparently not.  Maybe you should go open a support case...

          • 2. Re: Download Tableau .twb File via REST API
            Patrick Carlson

            Here's the response from Tableau.  Apparently it's working correctly:


            "After reviewing our documentation on commands that download workbooks both within Rest API and outside of it (tabcmd), I was able to find that whether or not the workbook is downloaded as a .twb or a .twbx is not dependent on the IncludeExtract parameter, but rather on what the data source for the workbook looks like. I was able to confirm this with our developers to find that this behavior is by design, which I understand can cause confusion when using the IncludeExtract parameter.


            The format in which a workbook is downloaded is dependent on the data connection: live and published connections will download as .twb, whereas all workbooks that have extract connections will be downloaded as .twbx. When using the IncludeExtract=false parameter, a .tds/.tdsx file is downloaded as part of the .tbwx package, which is a Tableau Data Source file instead.


            While this behavior is by design per our developers, there is a workaround which would be to extract the packaged workbook file. Once a .twbx file is extracted, it is split into the .twb and .tds/.tdsx file.


            This can be done one of two ways:

            - If Tableau Desktop is installed on the computer, it is possible to just right-click the .twbx file and select the "Unpackage" option.

            - If Tableau is not installed on the computer, it is possible to rename the file and change the .twbx extension to a .zip extension, which can then be unpackaged/unzipped by any compression tool such as WinZip, SevenZip, etc."

            • 3. Re: Download Tableau .twb File via REST API
              Milind P

              Hello Patrick,


              I'm trying to download the workbooks using API but I'm not able to write them to a file. I'm using Python for doing that and I'm a newbie in it.


              Can you please let me know how you did it and what language/script you used to do it?


              Thank you !!!

              • 4. Re: Download Tableau .twb File via REST API
                Toby Erkson

                It's unfortunate that this is the case as it's faster to download a .twb than a .twbx which could potentially be ten to a thousand times bigger, thus take longer to download!

                • 5. Re: Download Tableau .twb File via REST API
                  Patrick Carlson

                  Sorry, it's been awhile since I worked on this.  If you're just doing basic things the requests library in Python is really nice.  Requests: HTTP for Humans — Requests 2.18.4 documentation.  I would also check out the Tableau Python SDK, it might have some newer functionality.  Get Started .  It sounds like Tableau is switching to using more of a REST interface for administration in future releases (version 11?)?  Perhaps that will bring improvements.

                  • 6. Re: Download Tableau .twb File via REST API
                    Wes Hunt

                    This answer is mystifying to me. What does includeExtract=False even do then? It's even documented in the What's New 2.5 API docs that the entire point of the parameter is to avoid download the large extract file!


                    But then this thread and this KB article indicate its based on whether the workbook has extracted data sources embedded in it. That seems to contradict the entire feature. What's it for then?