Hi
3rd party calls ION REST ; the response is a JSON as below...
is it possible to change ION to only return the the actual data, as below?
Hi,
No ION API acts as a gateway we can't change the format of the response from API, it has to be modified on the Web service. if it is used in data flow check give a try a python script to parse it.
Yes, in this case, ION API is just passing the response from the target. You could consider the Response policy in ION API to see if those tabs and spaces can be removed. It works based on Handlebar framework. If that is tedious, then the next option is to pass this response to a Python scripting step and convert it to the format you need.
Yes, it's possible with python Script
This is also possible with ION API Flow which allows you to design your response using JSON pathing to populate your results which can include the request input and output from any api's called in the flow.
Hi @david-peters
He could even use the JSON path to get the exact section on the JSON but if you see the quotes(") are escaped with a slash(") I don't believe what he expects can be achieved using API flow.
I see what you mean: but combine the api flow with @antonio-caria script suggestion and you are in business. The script could be called as an API from the API Flow.
Alternately, JQ Transform could work if the environment is "enterprise"
Thank you all for the pointers
just to understand...the client app just calls the endpoint and expects the JSON...not sure how/where Python scripting can be implemented...can a flow be defined?
Scripting seems to be available for Document flows in ION Desk...but there is not document...not sure how to model this call ...please excuse my ignorance.
if understand correctly ...the policy can only be changed for Non-Infor API suites...is it possible to make a copy of a standard Infor API suite & change ?
Correct. Standard APIs are standard functionality of the cloud suite. If you modify that with policy for one client, then all clients will get impacted too.. But it is possible to customize a standard API end point for a client. You would have to do a kind of "Daisy - Chaining" to do that. And here is what you can do:
This way, you will be able to customize your request/ response to a standard API. But be aware of the limitations that come with it; the user identity of the API call towards the standard API is hard coded here (which is the Service account used in your target security config);
Thank you Vignesh, this is clear now...
Greetings;
Could you use an API Flow and JPATH to format the response the way you want? I used that for another API that I wanted to reformat.
This Input
This API Flow
This output
Hopefully, that will help;
Billy
Thanks Billy....so if the M3 API would be called from Postman, the response will be changed as expected? the API Flow will automatically be executed by ION for every call that involves that M3 API?
You call the API Flow, it gets its own endpoint in IONAPI. So, for example, instead of calling:mingle-ionapi.inforcloudsuite.com/tenant/M3/m3api-rest/v2/execute/OIS100MI/GetATPYou'd call the API Flow:mingle-ionapi.inforcloudsuite.com/tenant/APIFLOWS/Public/GetInventory
Of course, your url will be different based on the API Flow settings when creating it. The API Flow would then shape the output from the First API to present it in the format you built.
Good Luck;
Thank you Sir...I'll look into it;
...could you share the Request/Request Body tabs as well please?
it works but I have a question. In response policies, is there a way to do this:
if qty < 20 replace with no, if qty is greater than 20, replace with yes