Ok, I was able to workaround the 500 by using the following headers:
headerList.add(new BasicHeader("X-Tableau-Auth", authResult.getToken()));
headerList.add(new BasicHeader(HttpHeaders.CONTENT_TYPE, "multipart/mixed; "
+ entity.getContentType().getValue().split(";"))); // gets the boundary part while using multipart/mixed
Current issue is that it I get either get 404 and 401s with httpclient. POSTing with curl from the captured httpclient content consistently gets 401s, which does not make sense since the same auth header works for other tableau GET endpoints (eg get datasources).
Jim: Sorry to hear about your trouble. There is no extra security. The 401 error indicates the authorization token is invalid.
Could you please provide a bit more information:
- On the 404 with httpclient -> What URL(s) are you trying to access?
- Are you signing in on one host but then trying to publish to another host?
- Possible for you to share a Fiddler trace of this with us?
curl https://online.tableau.com/api/2.0/sites/cf6afefe-2a52-4b1e-b580-15d1cea29c7b/datasources -X POST -d @tableau_publish.mime -H "X-Tableau-Auth: Zhm2EHXuqDcyKqRGyRS3LZVDJJRtAos9" -H "Content-type: multipart/mixed; boundary=8C7Pcr-bdvOlH7sLZ81EpdNVxF064JD"
(token is no longer valid but provided only as an example of usage)
Not signing in on one host and publishing to another host (not even aware of how to do determine another host... if you are referring to redirect handling it would be default behavior for httpclient)
Don't have fiddler, have wireshark on Mac -> but this will not show content as https is encrypted. If you want that I can provide.
Thanks. What is the error message you're seeing with the 404s?
401 should only happen with an invalid token. Content being encrypted should be fine...we just need to see the URI(s) and headers with response(s). Can you please share the wireshark output?
Thanks, the detail message mentioned that project default was not found. I found a project attribute element in the payload and tried using the guid over the name and now I am getting a 500 which I am looking into...
Question: do the guid values stay the same across Tableau online releases?
I am also still getting a lot of 401 responses intermittent (~50% of the time) with 200s and 500s for identical requests.
Ok, curl gives 500:
curl https://online.tableau.com/api/2.0/sites/cf6afefe-2a52-4b1e-b580-15d1cea29c7b/datasources -X POST -d @tableau_publish.mime -H "X-Tableau-Auth: s9cGooRVude9CqhcXLYzNLwXCgA71kMY" -H "Content-type: multipart/mixed; boundary=8C7Pcr-bdvOlH7sLZ81EpdNVxF064JD"
<?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.1.xsd"><error code="500000"><summary>Internal Server Error</summary><detail>The server encountered an error and cannot complete your request...
HttpClient gives 400:
<?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.1.xsd"><error code="400010"><summary>Bad Request</summary><detail>Only a '.tds', '.tdsx', or '.tde' datasource file may be published.</detail></error></tsResponse>
Jim: Sorry for the delay in getting back to you. After looking into this more I think what's happening is that you're running into a current limitation with the way the REST API works with Tableau Online -> our underlying infrastructure for Online is comprised of multiple server pods and the REST API is not currently aware of these multiple pods.
What you need to do is try using the specific hostname in the API call. So instead of calling to http://online.tableau.com/<api_path> you will call to something like http://10ay.online.tableau.com/<api_path>.
More information can be found here. Look in the section titled "Specifying Resources on Tableau Online".
Please let me know if that fixes it or not.
I did not see a section titled 'Specifying Resources on Tableau Online".
How do I get/learn the specific hostname (in your example
On Wed, Jan 13, 2016 at 5:41 PM, ben lower <
I must have pasted in the wrong URL or it got truncated. Sorry
EDIT: The community site is doing something weird -> please copy and paste the below link
To get the fully qualified URL just sign in to Tableau Online and you'll see it in your address bar
I am still receiving the same 400 code and message below using the specific
pod host (10az.online.tableau.com):
On Thu, Jan 14, 2016 at 1:19 PM, ben lower <
Ok, I think I got around this by specifying the filename in the
content-type header with an ending suffix ".tde" - at least I am getting a
different error code and response now.
No, I spoke too soon, still getting 400:
Can you post your code somewhere (here or in a gist) please so we can take a look? We'll try it out with our own account and TDE.