Hello,
I tried to use a Post API and received this error message in download tool:
DownloadData
{"errors":[{"code":0,"message":"request_syntactically_incorrect"}]}
DownloadHeaders
HTTP/1.1 400 Bad Request
In postman, I use Body (raw) and successfully run the post API.
In Alteryx, I've tried multiple different ways (Compose Query String/Body, Take Query String/Body from Field, and Use Following for Query String/Body) but none of them worked.
Basic
Payload
Does anyone know how to set up the download tool for post API?
Sincerely,
knozawa
Solved! Go to Solution.
Hi @knozawa
It looks like you have 9 headers set up in Postman as well, have you replicated these inside the download tool as well?
Hi @JoeS ,
No, I didn't replicate it inside the download tool.
It seems like the headers are auto generated by Postman:
Do you think there is a way to auto-generate those headers using download tool?
Sincerely,
knozawa
There will be some parts that are auto generated.
Due to the nature of API's and their "flexibilty" it can be quite hard to diagnose what's going on.
Have you tried changing the body to not have the wrapping parenthesis? AKA deleted the start and end brackets.
Failing that it may be best if you could send me the full details by PM and I'll look to get it working my side and can return how?
Hi @JoeS ,
I deleted the "{" and "}", but it didn't work on Alteryx. I will send you the full details through private message.
Thank you for your help!
Sincerely,
knozawa
Hi @knozawa
Thanks for sending the details through, I thought I'd put the answer back here in case anyone else comes up against the same issue.
What you had done was correct, the only part that was missing is that when you use the payload option "Use Following for Query String/Body" it sets Content-Type to "application/x-www-form-urlencoded"
What you need to do is add to the header "Content-Type" and then your API needed "application/json".
What also tripped me over is if you add to the header "content-type" AKA all lower case, it will actually end up sending "Content-Type" and "content-type" which then throws the error you were getting around incorrect syntax.
I'll PM you back the working workflow as well.
Hi @JoeS ,
Thank you very much! I could successfully send the post API call through Alteryx after adding the header in the download tool.
Sincerely,
knozawa