Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Download tool Error: Error transferring data: Unrecognized or bad HTTP Content

Pingu
10 - Fireball

Dear community,

 

I get the following error when making a API POST request.: "Error transferring data: Unrecognized or bad HTTP Content or Transfer-Encoding"

 

Unfortunately I can't share to much specifics due to private information. Every API i used before in Alteryx worked like a charm with very little tweaking, but somehow I can not get this one to work.

 

I tried googling the error, but could not find a fix yet.

 

This workflow takes a text input for the url.

 

The method used is POST.

For the headers it uses:

Basic Authentication.

Content-Type: application/json

 

There's two parameters in the raw body that looks like:

 

{
"SearchCondition":{"Barcode":"AB123456789YZ"},
"Authentication":{"ABCId":12345,"XYZd":12345,"DEFd":12345}
}

 

Pingu_0-1603812763564.png

 

Any suggestoins much appreciated.

8 REPLIES 8
morr-co
10 - Fireball

Hi @Pingu - you may need to refer to the API documentation for help troubleshooting the issue. One thought is that the endpoint may be expecting an array of objects. If that is the case, you may need to reformat the body as shown below. Again, mostly a guess here, the documentation would be able to help you pinpoint the problem.

 

[{
"SearchCondition":{"Barcode":"AB123456789YZ"},
"Authentication":{"ABCId":12345,"XYZd":12345,"DEFd":12345}
}]
Pingu
10 - Fireball

Hi morr-co,

 

Thanks for your reply. I understand, actually the body above with the searchcondition and authentication element is actually from an example in the api documentation.

 

I tried reformatting with the brackets, just in case, but that did not work.

 

I think it has to do with the content encoding somehow and something is off with Content-Type: application/json even though it states that this should be the header.

morr-co
10 - Fireball

One more thought is to separate the authentication from the body. I have included some example screenshots of how I typically set up OAuth2 requests. The authentication and content-type are in the Header and the Barcode field is in the Payload. Here I have opted to have the download tool create the payload from a field. 

 

Also, I see above that you are using an HTTP POST method. Typically a "search condition" suggests to me that it is GET. However, this could be valid from their documentation.

 

Screen Shot 2020-10-28 at 7.42.19 AM.png     Screen Shot 2020-10-28 at 7.42.09 AM.png

Pingu
10 - Fireball

It uses BasicAuth, I believe the authorization step is ok, because if i put wrong user authentication details on purpose it gives a 401 error.

 

I have tried your suggestions, but unfortunately no change. Typically i always take the payload from a field except when testing then i use ''Use the Following for Query String/Body"

 

Its indeed using post method. The documentation also states "Communication functions only via HTTPS" does this require certain setup changes that need to be made in the Alteryx download tool?

 

morr-co
10 - Fireball

Have you tried entering your credentials in the basic auth fields under the Connection tab and not passing them in the body? I admit, the Download tool sometimes feels a little "black box". I can get some configurations to work no problem but others take some effort.

 

Screen Shot 2020-10-28 at 10.46.49 AM.png

Pingu
10 - Fireball

Thanks again for all your answers and suggestions.

 

Functionality is exactly the same using the connection tab. Authentication works because if i add a typo in username or password it gives an error back. 

 

I reached out to the provider we are working with to see if they had any idea.

 

They mentioned their api response is compromised in an unique way (whatever that may mean...) , and that was also the reason why it did not work with POSTman ("Could not get an reponse: Error: incorrect header check").

 

They suggest using #C and provided a working example. We don't use that internally, no clue if #C can be used easily in Alteryx... also I don't have any knowledge about that programming language. 

 

I guess the message will be "sorry but our internal tools are not compatible".

 

 

 

 

BretCarr
10 - Fireball

Hopefully, everyone in this thread has moved on to finer pastures, but the answer for this orphaned message is found here:
https://community.alteryx.com/t5/Alteryx-Server-Discussions/Unrecognized-or-bad-HTTP-Content-or-Tran... 

 

Just add two need headers to your download tool and you are golden (most of the time)!

 

Cheers!

Pingu
10 - Fireball

Hey thank you for the reply! We moved on, I wish i could still check this but we do not use this carrier anymore!

Labels
Top Solution Authors