12 Replies Latest reply on Jan 26, 2015 5:20 PM by Russell Christopher

    Not getting any workbooks for a user newly created via REST API

    Thomas Markiewicz

      Hello,

       

      I am trying to integrate Tableau Server with our own restful web API.  The idea is to use "trusted authentication" to obtain temporary tickets for users we have already authenticated in our webserver/service.  These users may not exist in the Tableau Server yet.  If they don't, we'd like to dynamically create them via REST API.  I've noticed however that the "Query Workbooks for User" API doesn't return any workbooks for the user (it returns 200 response with 0 workbooks):

       

      GET /api/2.0/sites/site-id/users/user-id/workbooks

       

      But if I go directly to the tableau server, login as admin, set the password for the new user, and then manually log in as that new user and see the workbooks and views associated with All Users group.

       

      Shouldn't REST API be returning that same list of workbooks/views ?

       

      Here are some more details about the sequence of the REST API calls I'm making:

       

      1) Sign in as administrator to the Default site

      2) Obtain site-id of the Default site

      3) Add new user to the Default site ( tried both Viewer and Interactor )

      3) Get list of workbooks from Default site for this newly created user

       

      ... returns 0 workbooks but there are 5 when logging as that user to Tableau server directly.

       

      This happens for existing users as well, including my "admin" user.

      Tableau Server Version 8.2.3 (8200.14.0925.1717) 64-bit

       

      Here is the message exchange:

       

      POST http://gxlt007187.coyotelogistics.local:8000/api/2.0/auth/signin HTTP/1.1

      Content-Type: text/plain; charset=utf-8

      Host: gxlt007187.coyotelogistics.local:8000

      Content-Length: 119

      Expect: 100-continue

       

      <tsRequest>

        <credentials name="admin" password="coyote">

          <site contentUrl="" />

        </credentials>

      </tsRequest>

       

      =====================

       

      HTTP/1.1 200 OK

      Date: Mon, 27 Oct 2014 19:57:51 GMT

      Server: Tableau

      Cache-Control: no-cache, no-store, max-age=0, must-revalidate

      Pragma: no-cache

      Expires: Thu, 01 Jan 1970 00:00:00 GMT

      Vary: *,Accept-Encoding

      ETag: "c628dc39b13d08bf23870089ba053934"

      X-UA-Compatible: IE=Edge,chrome=1

      X-Runtime: 0.065000

      Content-Type: application/xml;charset=utf-8

      Content-Length: 357

      P3P: CP="NON"

       

       

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

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

        <credentials token="c100afb79dd78bd44c34c80734c6c2a3">

          <site contentUrl=""/>

        </credentials>

      </tsResponse>

       

      =====================

       

      GET http://gxlt007187.coyotelogistics.local:8000/api/2.0/sites/Default?key=name HTTP/1.1

      X-Tableau-Auth: c100afb79dd78bd44c34c80734c6c2a3

      Host: gxlt007187.coyotelogistics.local:8000

       

      =====================

       

      HTTP/1.1 200 OK

      Date: Mon, 27 Oct 2014 19:57:51 GMT

      Server: Tableau

      Cache-Control: no-cache, no-store, max-age=0, must-revalidate

      Pragma: no-cache

      Expires: Thu, 01 Jan 1970 00:00:00 GMT

      Vary: *,Accept-Encoding

      ETag: "a959b36cde5ed8fa9df9afcef52418e3"

      X-UA-Compatible: IE=Edge,chrome=1

      X-Runtime: 0.049000

      Content-Type: application/xml;charset=utf-8

      Content-Length: 464

      P3P: CP="NON"

       

       

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

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

        <site id="b4126fe9-d7ee-4083-88f9-a5eea1f40416" name="Default" contentUrl="" adminMode="ContentAndUsers" userQuota="" storageQuota="" disableSubscriptions="false" state="Active" statusReason="">

        </site>

      </tsResponse>

       

      =====================

       

      GET http://gxlt007187.coyotelogistics.local:8000/api/2.0/sites/b4126fe9-d7ee-4083-88f9-a5eea1f40416/users HTTP/1.1

      X-Tableau-Auth: c100afb79dd78bd44c34c80734c6c2a3

      Host: gxlt007187.coyotelogistics.local:8000

       

      =====================

       

      HTTP/1.1 200 OK

      Date: Mon, 27 Oct 2014 19:57:51 GMT

      Server: Tableau

      Cache-Control: no-cache, no-store, max-age=0, must-revalidate

      Pragma: no-cache

      Expires: Thu, 01 Jan 1970 00:00:00 GMT

      Vary: *,Accept-Encoding

      ETag: "a19b61e803def6d779903bdc88127ea5"

      X-UA-Compatible: IE=Edge,chrome=1

      X-Runtime: 0.065000

      Content-Type: application/xml;charset=utf-8

      Content-Length: 642

      P3P: CP="NON"

       

       

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

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

        <users>

          <user id="a2a437fd-e7cf-45d2-b9a6-b77db3e8a76c" name="admin" role="Interactor" publish="false" contentAdmin="false" lastLogin="2014-10-27T19:57:51Z" externalAuthUserId=""/>

          <user id="5a1f9eab-0cee-4c32-b865-741575fa3a19" name="Tableau Software" role="Interactor" publish="true" contentAdmin="false" lastLogin="2014-05-09T23:14:40Z" externalAuthUserId=""/>

        </users>

      </tsResponse>

       

      =====================

       

      GET http://gxlt007187.coyotelogistics.local:8000/api/2.0/sites/b4126fe9-d7ee-4083-88f9-a5eea1f40416/users/a2a437fd-e7cf-45d2-b9a6-b77db3e8a76c/workbooks HTTP/1.1

      X-Tableau-Auth: c100afb79dd78bd44c34c80734c6c2a3

      Host: gxlt007187.coyotelogistics.local:8000

       

      =====================

       

      HTTP/1.1 200 OK

      Date: Mon, 27 Oct 2014 19:57:51 GMT

      Server: Tableau

      Cache-Control: no-cache, no-store, max-age=0, must-revalidate

      Pragma: no-cache

      Expires: Thu, 01 Jan 1970 00:00:00 GMT

      Vary: *,Accept-Encoding

      ETag: "64eb624f814212eeecda37998c329ee3"

      X-UA-Compatible: IE=Edge,chrome=1

      X-Runtime: 0.053000

      Content-Type: application/xml;charset=utf-8

      Content-Length: 351

      P3P: CP="NON"

       

       

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

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

        <pagination pageNumber="1" pageSize="100" totalAvailable="0"/>

        <workbooks>

        </workbooks>

      </tsResponse>