I have been trying to use the "Publish a data-source" rest api given in the Tableau RestAPI reference to use a file from Zuora and publish to Tableau as a datasource however, I couldn't understand how exactly do I upload the file using that API. Please help me understand the process.
Find the current request body and header attached below (Do not know how to upload file for data-source).
Header:
X-Tableau-Auth : the_token_obtained_from_sign_in
Content-Type : multipart/mixed; boundary=6691a87289ac461bab2c945741f136e6
Request Body:
--6691a87289ac461bab2c945741f136e6
Content-Disposition: name="request_payload"
Content-Type: text/xml
<tsRequest>
<workbook name="workbook_name">
<project id="project_id"/>
</workbook>
</tsRequest>
--6691a87289ac461bab2c945741f136e6
Content-Disposition: name="tableau_workbook"; filename="usps-rates.twbx"
Content-Type: application/octet-stream
<content here>//How do I use the content??
--6691a87289ac461bab2c945741f136e6--
Response:
<?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.4.xsd">
<error code="500000">
<summary>Forbidden</summary>
<detail>User does not have permission for action.(The server encountered an error and cannot complete your request. Contact your server administrator.)</detail>
</error>
</tsResponse>
Hi @Om Khandwe -
Are you trying to publish a data source or a workbook? Pardon me, I am a bit confused from reading your message vs. the sample scripts, because the request body was that of a workbook instead of a data source.
If you are trying to publish a datasource, use the following api Publish Data Source
Else if you are trying to publish a workbook, use the following Publish Workbook