2 Replies Latest reply on Sep 18, 2018 2:00 PM by Irwin Dolobowsky

    Tableau API returns 400081 error on data view request

    Eve Denton

      Hello, I'm trying to use the Tableau API to programmatically obtain a workbook's view data as CSV. I consistently get the following error whenever attempting to pull a particular view's data. Below is the error and the API calls used. Please advise!

       

      Error:

      <?xml version='1.0' encoding='UTF-8'?>

       

      <tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-3.0.xsd">

          <error code="400081">

              <summary>Bad Request</summary>

              <detail>There was a problem querying the data for view '1e8410c4-b412-4441-b348-9553c44b94e1'.</detail>

          </error>

      </tsResponse>

       

      Step 1: Obtain new access token (works fine, JSON attached)

      {site={contentUrl=my-client, id=4fbfdc62-sfsfsdfds-sfsdfsdfsd-sfsdfdsf}, user={id=dskkfskdskfk-sfdsfsfds-sfsdfd}, token=my_token}

       

       

      Step 2: Get a list of available views (works fine, sample JSON attached)

       

      URL:

      https://myurl.online.tableau.com/api/3.0/sites/my-site-id/views

       

       

       

      {"view":[{"workbook":{"id":"77b6cb9a-30eb-430d-bebf-88bbb47ddb0f"},"owner":{"id":"c506d370-7ffb-4d69-a423-f94bbfe918f9"},"project":{"id":"eb213b05-b7f7-40e7-950d-daacf84ebabc"},"tags":{"tag":[{"label":"Acquisition"},{"label":"brands"},{"label":"categories"},{"label":"first time buyers"},{"label":"gmv"}]},"id":"0c9ee76e-c92f-4ac0-981c-a46a7cdfc597","name":"Top brands","contentUrl":"Topbrandsreport/sheets/Topbrands","createdAt":"2016-11-11T18:34:59Z","updatedAt":"2017-06-08T22:50:24Z"}]}

       

       

       

      Step 3: Query the view ID to obtain CSV (this is where the 400081 error code occurs):

       

      CURL Request:

      curl "https://mywebsite.online.tableau.com/api/3.0/sites/my-site-id/views/77b6cb9a-30eb-430d-bebf-88bbb47ddb0fdata" -X GET -H "X-Tableau-Auth:my_token"