Hi everyone,
I'm working on a POST API method in OutSystems, but I'm facing an issue where the API returns an empty response even though I'm expecting data (or at least a status/error).
Here’s what I’ve done so far:
Created a POST method under the logic tab.
Defined the input parameters and the output structure.
Implemented logic and assigned values to the response structure.
Tested it using Postman / OutSystems interface.
However, the response I get is just empty.
Questions:
Is there anything specific I should check to ensure the response is returned properly?
Could this happen if the response structure is not being assigned correctly?
Any common mistakes I should watch out for?
Happy to share screenshots or OML if needed.
Thanks in advance!
Hi,
I think you can ensure input parameters are correctly defined in the POST method.
Confirm the request body matches the expected structure.
Make sure a create action is used to insert the record.
Ensure no validations or conditions are preventing execution.
Use the Content Type: application/json header.
Send a valid JSON body in the request.
Go to Monitoring > Errors or General Logs to identify any runtime issues
Use the debugger to step through the API logic and see where it might be breaking or returning early.
If you still face a issue you can refer the forum discussion for step by step process of consume API or kindly share your .oml file. I will look into it and give you solution.
https://www.outsystems.com/forums/discussion/77162/how-to-consume-api-from-scratch-with-steps/
You can refer the official outsystems document also.
https://success.outsystems.com/documentation/11/integration_with_external_systems/rest/consume_rest_apis/
Thanks,
Sriyamini
Hi Sriyamini,
thanks for the response i have done the same as request and response are autogenerated by outsystems so using the same but still not able to create the record sharing the OML can you please check
@Akash Gunupudi : referring the the Application you have shared, I can see there are 2 modules - Employee_CS and Employee. Employee _CS has your entities and wrapper methods. Employee modules you have REST API exposed "EmployeeData -> EmployeesList" Returns the list of Employees and its a POST method.
What I don't understand is in Employee method itself you have consumed the above API ( EmployeesList) and pass an Employee object.
May I know what you are trying to achieve here ?
btw I tested the EmployeesList API alone in Postman I get the data after I added a few records in Employee entity. ( Also it is not necessary to have it POST to get the list of Employee you can use GET too)
Though Siya probably provided you with what you need to fix this, I want to add that the first thing you should do in cases like this is not "write a forum post asking for help", but debug. If you are debugging your code, you can clearly see whether the output structure you are saying you are setting in the code is indeed set to a list, and if not, you can check what the input is and so on. Debugging is an essential tool in a developers toolbox. Use it whenever you can!