KNOWLEDGE BASE

Intermittent HTTP 401or 403 Errors Using the Tableau REST API


Published: 03 Mar 2017
Last Modified Date: 07 Mar 2017

Issue

When making calls with the REST API, 400 error responses are intermittently received (typically, 401 or 403).

The response may look similar to the following:
<?xml version='1.0' encoding='UTF-8'?> 
tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://ww.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api ts-api-2.3.xsd"> 
<error code="401000"> 
<summary>Unauthorized Access</summary> 
<detail>No authentication credentials were provided</detail> 
</error> 
</tsResponse>

Environment

  • Tableau Server
  • REST API

Resolution

  • Ensure that your REST API code is retrieving a new authentication token often enough per the session timeout on Tableau Server.
  • By default, the authentication token is good for 240 minutes. (You can specify a different timeout value for the token by calling the tabadmin set command to change the wgserver.session.idle_limit setting.).
  • If your application needs to be able to make additional calls after the token has expired, you can call Sign In again and get a new authentication token.
  • See Signing In and Signing Out (Authentication) for more information about using the authentication token in REST API calls.

Cause

Intermittent 4xx errors when using the REST API are typically caused by using authentication tokens longer than Tableau Server is configured to accept them. 

Additional Information

  • In the case of consistent 401\403 errors, likely there is either no valid authentication token being passed in with the request, or the call is for a site other than where the user is logged in.
  • If actual 400 errors are received, this response is indicative of a bad request and not an authentication issue. In that case, be sure to check the body of your request to ensure that all content is accurate and in the correct place. Refer to the REST API documentation for syntax requirements.
Did this article resolve the issue?