4 Replies Latest reply on Mar 5, 2018 9:57 AM by larspetter.madsstuen.1

    REST API VIEWS not updated

    Jean Wang

      I'm currently grabbing views as images with REST API cmd:

      GET /api/api-version/sites/site-id/views/view-id/image

       

      However, I need an image grab about 10 minutes after the data source is uploaded.

      The command specifies that you can reduce the cache time with : vizportal.rest_api.view_image.max_age setting

      However, I don't want to change the max_age of all image rest api cache times on the server

       

      How can I grab the most updated image using GET. I know I can set and unset vizportal but due to permissions, I would like to avoid that.

      Is there anyway I can refresh the cached images without vizportal? I'm willing to make a few more rest api calls (such as to see if image is updated or data sources is update etc... ) if I don't have to use tab cmd.

       

      Would refresh extracts update the cache on REST API images?

       

      Thanks!

        • 1. Re: REST API VIEWS not updated

          Hi Jean Wang,

           

          While I am not familiar with Rest API, I'm sure other members of our community would be glad to help you out!

           

          Please note that we don't provide support for programs that customers create using the Tableau Rest API. If you need help with your code, please submit questions and ask for help on the Tableau developer community forums. I have moved your thread to the correct category.

           

          Thanks for your understanding.

           

          ----------

          Lénaïc RIÉDINGER, Global Community Engineer Tableau

          Tableau Community Forums | Knowledge Base

          If you see a Helpful or Correct response, please mark it thanks to the buttons below the targeted post!

          • 2. Re: REST API VIEWS not updated
            Glen Robinson

            Hi Jean,

            Please take a look at this post REST API Get Image with field parameter

            Here, instead of using the REST method, we use a normal request, but are logging into the server using REST.

            This means that you can add the :Refresh suffix to the URL to get the latest data

            Hope this helps

            Glen

            • 3. Re: REST API VIEWS not updated
              Russell Hay

              Hi Jean Wang,

               

              Currently, we do not have a way to invalidate the image cache from the rest api, but with Tableau 10.5 (in beta now), you can create a parameter that allows any value, and then you can use a timestamp for the value of the parameter.  We use the view filters to match images in the cache, so it would allow you to get a fresh view.

               

              To avoid wasting cache space, I'd recommend you only update the parameter value when you know that the data source has been updated.

               

              In order to use the view filtering, you would take the name of your parameter, prepend vf_ to it, and then add it along with the value to the url on the GET call.  For example:

               

              /api/2.8/sites/site-id/views/view-id/image?vf_cachebuster=201710151730

               

               

              Since this is a beta, please let us know if you have any questions or run into any problems.

               

              -Russell

              • 4. Re: REST API VIEWS not updated
                larspetter.madsstuen.1

                Hi,

                 

                actually allowing the user to invalidate the image cache (or explicitly force a refresh) seems like a reasonable feature to provide in the REST API. Any plans to do so? I mean, I'd argue it's a more intuitive and natural place to solve this, rather than adding an "artificial" filter to the workbook that does not add anything to the actual data viz side of things.