Skip to main content

I am trying to use FME to produce a json object which can interact to JDE AIS. This requires several HTTP POST calls to perform actions in JDE. I am trying to get a Token which is the first step and is a very simple object. I have used a program call Postman to simulate the POST request which returns me the token successfully. I am trying to replicate this process in FME but i recieve the following error

 

HTTPCaller(HTTPFactory): Received HTTP response header: 'HTTP/1.1 400 Bad Request' from 'http://Server:Port/jderest/tokenrequest'

Does anyone have any ideas as to what i could try to get this process to work?

Screenshots below.

Hi @cob.pthompson, thanks for your question. Are you able to share any of the details of the successful API call from Postman? Perhaps a comparison can help narrow down the problem in the HTTPCaller.

Thanks,

Nathan


The sample request in the docs only have deviceName, username and password in the json. Did you manage to replicate the request with the exact same piece of json in Postman? According to the documentation a 400 - Bad Request means Invalid JSON input.

What version of FME do you use? I have had some problems with passwords not being URL encoded in 2016. TextEncoder(URL (Percent Encoding) ) fixed this. Seems to be gone in 2018.

Also, you set Content-Type twice. (Header and Content Type field.) I think the header overrules the field but try removing one of those.


I agree with @nielsgerrits, the status 400 is a server-side error and not a client (FME) error. Trying to reproduce the example from the documentation would be a good first step.


The sample request in the docs only have deviceName, username and password in the json. Did you manage to replicate the request with the exact same piece of json in Postman? According to the documentation a 400 - Bad Request means Invalid JSON input.

What version of FME do you use? I have had some problems with passwords not being URL encoded in 2016. TextEncoder(URL (Percent Encoding) ) fixed this. Seems to be gone in 2018.

Also, you set Content-Type twice. (Header and Content Type field.) I think the header overrules the field but try removing one of those.

When I replicate the exact JSON request in Postman I received a valid token back. I removed the Environment and Role values and the request works in Postman but not in FME 2018.

I have put the body of the request through the JSONValidator and the response was success.

 

 

I am new to FME and we have the latest version of 2018.

I removed the Content-Type form individually form each section and both gave the same 400 error.

 


Hi @cob.pthompson, thanks for your question. Are you able to share any of the details of the successful API call from Postman? Perhaps a comparison can help narrow down the problem in the HTTPCaller.

Thanks,

Nathan

Here are my settings from Postman.

Results

Header Info

 

Body Info

 


Hi @cob.pthompson,

It's possible that you need to tell FME what format the incoming data will be in. Try adding the Header:

Name = Accept

Value = application/json

In addition as @nielsgerrits mentioned you do not need the Content-Type Header because this has already been set up in the 'Body' section.


Reply