Hello, I've banging my head to wall for a while when trying to fetch some data from Adaptive Insight API. That API gets all requests with XML commands through POST call. I have a call which works with CURL but fails when trying to use it from Alteryx.
For debugging I wrote a script which just logs all headers and payload from HTTP request in server. When calling that script from Alteryx with a simple XML payload. Results were a bit disturbing. Here is simplest reproducible case I created.
Scenario 1 Setup
POST call, XML payload in "Use following query string / Body".
No headers defined
Expected result
Payload sent to a server as-is, no content-type header defined.
Observed result
Wrong content-type
First characters (up to first equals char (=)) missing from payload.
Scenario 2 Setup
Like scenario 1, but manually set correct Content-Type header
Expected result
In HTTP request defined content type and payload as-is.
Observed result
Payload missing
I tested setting different Content-Type headers, but every time it was set, all payload was missing.
When payload is not set, Alteryx seems to cut payload from first "=" mark.
So how can i send POST request with Alteryx with right content-type header and untouched XML payload?
Solved! Go to Solution.
Are you able to share your CURL command that works? (With the auth/password starred out)
And I haven't try to call Adaptive API when using "Compose query" -option. Only way I tried to call Adaptive API was with "Use following query string / body" option without any manually added headers. And that failed, then I started to troubleshoot with PHP script. So with your advice I probably can solve my acute problem.
Thank you so much.
There was obviously major bug in the script I used for debug. That misled me big time. Reminder to self..... never use simple scripts with language you really don't know.
Thanks to all for quick replies! This was really helpful.
Just a brief explanation what happened.
In another system I call Adaptive API without Content-Type header. Not the best practice but that works. So I did the same with Alteryx. But Alteryx defaults to application/x-www-form-urlencoded content-type and with this header Adaptive API returned an error saying XML is invalid.
Then I started debug the situation with my faulty script and the rest is history.
I used my original payload with Content-Type header set in headers tab and this workflow works as a charm.