3 Replies Latest reply on Nov 9, 2017 3:14 PM by Jeff Bryant

    REST API with multiple sites

    Jeff Bryant

      I'm implementing a project that is using the REST API to retrieve a list of workbooks for a selected site.  In this instance there are 3 sites -

      Site A

      Site B

      Site C

       

      When issuing REST API calls against Site C I have no issues and I can retrieve the information that I’m after.  This is good. On the other two sites, however, I am not able to do anything more than successfully query them for their names. Any query that goes any deeper than the top level of the site returns a 403 error. 

       

      As an example, I’m attempting to query the workbooks on the site Site A:

      https://<Server>/api/2.6/sites/<Site A ID>/workbooks

       

      The error returned is:

      The remote server returned an error: (403) Forbidden.

       

      When I do the same query against “Site C”:

       

      The expected response is returned:

      <?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-2.6.xsd\">

                      <pagination pageNumber=\"1\" pageSize=\"100\" totalAvailable=\"40\" />

                      <workbooks>

                                      <workbook id=\"b5fc7825-32a2-4b7f-bdf7-fdf162a93ba2\" name=\"Characteristic Test Results\" contentUrl=\"CharacteristicTestResults\" showTabs=\"true\" size=\"1\" createdAt=\"2016-05-20T21:06:43Z\" updatedAt=\"2016-05-20T21:06:43Z\">

                                                      <project id=\"3f3a26a2-c449-42af-b831-39e3fb74eff3\" name=\"Default\" />

                                                      <owner id=\"c32d6cfe-206a-4a3c-9c86-3b25384aafcb\" />

                                                      <tags />

                                      </workbook>

                                      <workbook id=\"d6fc706c-5c91-4823-b1bc-ca21635d4008\" name=\"Cp &amp; Cpk by Line\" contentUrl=\"CpCpkbyLine\" showTabs=\"false\" size=\"1\" createdAt=\"2017-05-16T15:30:32Z\" updatedAt=\"2017-05-16T15:30:32Z\">

                                                      <project id=\"3f3a26a2-c449-42af-b831-39e3fb74eff3\" name=\"Default\" />

                                                      <owner id=\"c32d6cfe-206a-4a3c-9c86-3b25384aafcb\" />

                                                      <tags />

                                      </workbook>

                                     

                                      ...

                                     

                      </workbooks>

      </tsResponse>

       

      This leads me to believe that there must be a permission issue.

       

      Now, did I mention that this is a hosted site, and not hosted by us so I don't have complete control over it.  Is it possible that there is a permission setting for <Site A> & <Site B> that differs from <Site C> somehow? 

       

      I can navigate to all the sites on the server via a browser and from Tableau Desktop, but the REST API just doesn't want to work for anything but the one site. 

       

      Puzzled.