tableau / rest-api-samples

Samples for the Tableau REST API
MIT License
386 stars 272 forks source link

Consistent 400000 error when using this to publish a TDE #6

Closed jamesrmccallum closed 1 year ago

jamesrmccallum commented 7 years ago

@jdomingu

Is this script compatible with v2.4 API?

I wanted to modify this script to publish a TDE. My TDE's are very small (<1MB) so the all-in-one method should be appropriate.

I'm using tableau online 10.1, so have changed the global API version var to '2.4'.

I've modified the metadata XML block as follows

pjID = my project ID
lxmlbody = ET.Element('tsRequest')
datasource_element = ET.SubElement(xmlbody, 'datasource', name='hires.tde')
ET.SubElement(datasource_element,'project_id',id=pjID)
xmlbody = ET.tostring(xmlbody)

I've set the server as follows:

publish_url = server + '/api/2.4/sites/{0}/datasources?overwrite=true'.format(site_id)

and here's the block that builds the body itself

parts = {'request_payload': ('', xmlbody, 'text/xml'),
                'tableau_datasource': (tde_file, tde_bytes, 'application/octet-stream')}
    payload, content_type = _make_multipart(parts)

And i'm consistently getting this back

main.ApiCallError, 400000: Bad Request - Payload is either malformed XML or incomplete

techjith commented 7 years ago

Hi James, I am also finding the same error. Could you tell me if you have resolved this issue.

jamesrmccallum commented 7 years ago

@techjith , didn't solve it with this POS library!

I wound up using their other https://github.com/tableau/server-client-python which seems to work better. Who knows why they're maintaining two.

Barathwaja commented 4 years ago

I'm also still facing issue. :(

jdomingu commented 4 years ago

Apologies. I haven't worked on this project in quite some time now. @benlower is there someone that could check in on this?

jacalata commented 1 year ago

closing stale requests.