Skip to content

Instantly share code, notes, and snippets.

@tfoldi
Created November 19, 2015 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tfoldi/b598e90f9cee0b49c8fe to your computer and use it in GitHub Desktop.
Save tfoldi/b598e90f9cee0b49c8fe to your computer and use it in GitHub Desktop.

Payload for test:

$ cat signin.xml
<tsRequest>
  <credentials name="yoyo" password="fofo" >
    <site contentUrl="" />
  </credentials>
</tsRequest>

CURL -F works with Tableau 9.0

$ curl "https://SERVER_WITH_90/api/2.0/auth/signin" -X POST -k -F title=@signin.xml
<?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.xsd">
  <credentials token="e7373c4dacca82906c7d0512715afe75">
    <site id="feae689d-1700-48d1-9ec1-2738817ds871" contentUrl=""/>
    <user id="92d569bb-5ddf-42ab-ad7b-27bd25a3aab1"/>
  </credentials>
</tsResponse>

CURL -F does not work with Tableau 9.0

$ curl "https://SERVER_WITH_91/api/2.0/auth/signin" -X POST -k -F title=@signin.xml
<?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.xsd"><error code="400000">
<summary>Bad Request</summary><detail>Payload is either malformed XML or incomplete</detail>
</error></tsResponse>

Same payload with -d

$ curl "https://SERVER_WITH_91/api/2.0/auth/signin" -X POST -k -d @signin.xml
<?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.xsd"><credentials token="dhPT74YSfy4O18zF6NSROElCrbefjmVA">
 <site id="ff66e08b-e7b4-4759-b21f-1fdc0e0885f9" contentUrl="" /><user id="72dc224a-86a0-4917-9eb5-e9dsd6b3fe61" /></credentials></tsResponse>
@benlower
Copy link

The second curl heading should read "CURL -F does not work with Tableau 9.1"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment