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"}
Hey @dev OS
Can you check when testing the APi if the Request is the same with Postman
Hope this helps
Regards,Kshitij
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.