66
Views
2
Comments
REST API Body Information Getting Removed
Application Type
Reactive

Hello Community,

I am consuming set of APIs in my application. So far all the APIs worked and none of them was sending much information in body. Now there is another API that I need to consume which accepts three sets of information: Credentials, Parameters and Configurations.

When I run this API in postman it runs fine and I get proper response. Whereas with same body JSON when I run it in OutSystems the third set of information i.e. Configurations gets removed and I get 500 internal server changes. On generating the API trace I get below details. Please let me know if anyone has faced similar issue and how to resolve it.

HTTP/1.1 500 Internal Server Error

Connection: keep-alive

Content-Length: 529

Content-Type: application/json; charset=utf-8

Date: Tue, 27 Feb 2024 19:01:42 GMT

Set-Cookie: AWSALB=2zcdEkpi5rFmnaTw1zzNzcChflc+/xvJLqzFek3nNk5LZ8zLQ/bijb8KS2yiQi5dVRPCfBDeaWpIpJ2Sa6DFc3e53Ux+g6u5M7XFoUKltMsQyFvF8Cg21poLhSkH; Expires=Tue, 05 Mar 2024 19:01:42 GMT; Path=/,AWSALBCORS=2zcdEkpi5rFmnaTw1zzNzcChflc+/xvJLqzFek3nNk5LZ8zLQ/bijb8KS2yiQi5dVRPCfBDeaWpIpJ2Sa6DFc3e53Ux+g6u5M7XFoUKltMsQyFvF8Cg21poLhSkH; Expires=Tue, 05 Mar 2024 19:01:42 GMT; Path=/; SameSite=None

Cache-Control: private

Server: Microsoft-IIS/10.0

jsonerror: true

X-AspNet-Version: 4.0.30319

X-Powered-By: ASP.NET

Access-Control-Allow-Headers: accept, content-type

Access-Control-Allow-Methods: POST, GET, OPTIONS


{"Message":"Invalid web service call, missing value for parameter: \u0027itemConfigs\u0027.","StackTrace":"   at System.Web.Script.Services.WebServiceMethodData.CallMethod(Object target, IDictionary`2 parameters)\r\n   at System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams)\r\n   at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.InvalidOperationException"}

2023-02-26 23-17-33
Kshitij Raheja

Hey @dev OS

Can you check when testing the APi if the Request is the same with Postman

Hope this helps

Regards,
Kshitij

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Dev OS,

Did you set Configurations to any value? Because by default, OutSystems removes empty attributes from the JSON it sends. The best thing would be to set the attribute's Is Mandatory to True, or set the Send Default Value to True, so it gets sent always.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.