Trying to call ION API with "POST" method using H5 SDK and the API call needs JSON input.
The call of the API failed and raised an error of "Failed to load resource: the server responded with a status of 400 (Bad Request)"
Have you tried the API in the Swagger test client for ION API, trying to call the endpoint that you would like to call?
It could be that the input is in fact invalid so you should try in Postman or in the ION API Tool for the endpoint.
There is an update** From Postman there is no issue to call the API even if it's GET or POST
** From swagger test client , I was able to call a GET API without any issue , But it failed to call POST API and encountered that following issue "CORS error - Origin is invalid"
I decided to trace it again from the Code the debug console shows an error "Failed to load resource: the server responded with a status of 400 (Bad Request) " But in fiddler I can find the same error as in swagger
The call works, but not through a Browser.
What system has the service that you are trying to access? Is it a custom API that you manually registered to ION API? You should check in the monitoring functionality in ION API if there are any more hints. It could be that the backend you are calling are making some validation on Origin and it's not allowing the M3 origin.
But one of the benefits with ION is that you don't get CORS issues. Usually you would see the CORS error in the console when the pre-flight check fails, but this time I think it's the backend that is not configured to allow ION API to connect.
Looking at the response header, do you have the ION API tracker set? You can share the headers here but you must cover the Bearertoken part so it's not readable.
What is the Origin header on the request?
Whatever service you are calling, it has to allow you to connect.
It's Infor M3 Mobility Core service.
and this the header of the request and response
I'm not familiar with that API. It seems like the request does not reach the ION API Gateway since the response has no tracking headers set.
You need to use https://github.com/infor-cloud/m3-h5-sdk for support on Odin. Although I'm not sure that is the issue but it could be the proxy that is not set-up correctly since you are running it locally.
Add all information you can think of, including the configuration of the proxy etc and ask the question there. Even if you repeat yourself it will help someone else if you duplicate the question instead, DONT share the Bearer token.