4 Replies Latest reply on Jul 12, 2018 9:46 AM by patrick.byrne.0

    REST API 3.0 asynchronous publishing

    Gavin Butler

      Hi all,

       

      I've been building and maintaining a utility using the REST API to assist our IT teams with migrating workbooks between Tableau Server sites. To date it has proved very successful and a huge time-saver but now that we are working through the upgrade to 2018.1 I've been revising my code with updates to REST API version 3.0.

       

      Whilst trying to implement asynchronous workbook publishing (REST API Asynchronous Publishing Reference and REST API Query Job Reference) I've noticed that, unlike the standard synchronous API publishing operation, subsequent Query Job calls do not return any meaningful status of whether the publish operation succeeded or failed and zero error troubleshooting information, only that the publish job finished. The API reference documentation even states that no <statusNotes> elements are provided.

       

      Have I missed something? IMHO this renders the whole REST API asynchronous publishing function virtually useless. Prior API versions with the standard synchronous publishing operation at least return the success/failure of the operation but again do not provide the same level of error diagnostic detail as tabcmd, which would make the function much more useful and avoid having to fall back to tabcmd or Server logs for diagnosis.

       

      By comparison with tabcmd, even before version 2018.1 I can see when monitoring the transaction with Wireshark, that it has been coded to publish asynchronously to Server, and certainly does return meaningful error information to help with troubleshooting such as MSSQL ODBC errors, via eerily-similar XML response body content to the REST API albeit much more detailed.

       

      Just curious if any bleeding-edge adopters who use 2018.x and the REST API have come up against this or similar issues, and know of any workarounds?

       

      Cheers.

        • 1. Re: REST API 3.0 asynchronous publishing
          patrick.byrne.0

          Hello Gavin,

           

          This is expected behavior of the call when using the asychronous call when publishing workbooks. Per the following snippet from the Tableau Product Help guide.

           

           

          Note: When using this method to query the progress of asynchronous workbook publishing, progress will switch from 0 when the job is in-progress to 100 when it is complete, finishCode will switch from 1 when the job is in-progress to 0 when it is complete, and no <statusNotes> elements are provided.

           

          Hope this helps!

           

          Cheers,

          Byrne, Patrick

          • 2. Re: REST API 3.0 asynchronous publishing
            Gavin Butler

            Hi Patrick,

             

            Thanks for your response. You are correct that this is the current behaviour of the asynchronous workbook publishing operation, however my point is that unlike the synchronous publishing operation (and when publishing using tabcmd) the Query Job function does not provide any meaningful feedback on whether the publish operation actually succeeded or failed.

             

            For example, let's say embedded within a workbook I am trying to publish there's a problem with a data source connection (e.g. wrong password):

            1) when I try to publish using tabcmd, the operation fails and tabcmd returns an ODBC error message indicating login failed - this points the user directly to the root cause

            2) when I try to publish using REST API synchronous publishing method (&asJob=false), the publish API call returns a 400 Bad Request error with no further details - at least it indicates to the user something went wrong, even if no specific error information is included for further diagnosis

            3) when I try to publish using REST API asynchronous publishing method (&asJob=true), the QueryJob API call returns progress=100 and finishCode=0 even if the publish operation itself failed due to the same ODBC error, the user is never told of an error and the workbook never makes it into the library.

             

            So hopefully you can now see my point about the discontinuity in expected functionality and why I feel the REST API asynchronous publish operation is broken/lacking, especially when I can see through Wireshark that the undocumented API which tabcmd uses already does all this.

             

            FYI I've raised a support case to have this escalated to the devs for assessment. Hopefully any others who have come across this issue will benefit from understanding the current limitations.

             

            Cheers,

            Gavin.

            • 3. Re: REST API 3.0 asynchronous publishing
              Gavin Butler

              Submitted as a new idea, although I remain unconvinced this isn't a bug rather than an enhancement... https://community.tableau.com/ideas/9011

              1 of 1 people found this helpful
              • 4. Re: REST API 3.0 asynchronous publishing
                patrick.byrne.0

                Thanks for providing the additonal information and submitting the idea!

                 

                Cheers,

                Byrne, Patrick