500 SERVER ERROR IN REST POST API CALL

0
Iam trying to execute a microflow with Rest API Call. It is throwing me the following error while executing.   Error calling REST service     at CommonModule.UpdateAccountStatusInCentralizedApp (CallRest : 'Call REST (POST)')     at Administration.SaveAccountEdit (SubMicroflow : 'UpdateAccountStatusInCentralizedApp')     at CommonModule.SaveUserAccount (SubMicroflow : 'SaveAccountEdit') Advanced stacktrace:     at com.mendix.integration.actions.microflow.RestCallAction.execute(RestCallAction.scala:79) Caused by: 500: Server Error     at CommonModule.UpdateAccountStatusInCentralizedApp (CallRest : 'Call REST (POST)')     at Administration.SaveAccountEdit (SubMicroflow : 'UpdateAccountStatusInCentralizedApp')     at CommonModule.SaveUserAccount (SubMicroflow : 'SaveAccountEdit') Advanced stacktrace:     at com.mendix.integration.actions.microflow.RestCallAction.execute(RestCallAction.scala:79)   500: Server Error     at CommonModule.UpdateAccountStatusInCentralizedApp (CallRest : 'Call REST (POST)')     at Administration.SaveAccountEdit (SubMicroflow : 'UpdateAccountStatusInCentralizedApp')     at CommonModule.SaveUserAccount (SubMicroflow : 'SaveAccountEdit')   Error Type:com.mendix.modules.microflowengine.MicroflowException       The input json string am passing is, {     "UserNTID":"xxx",     "UserEmailId":"xxx@xxx.com",     "Active":true,     "RequestId":"0",       "UserRole":"role",       "AppOwnerApprovalDate":"2023-07-25 07:18:52",       "AppOwnerName":"null",     "AppOwnerEmail":"null",     "AppOwnerNTId":"null" }  
asked
3 answers
1

Hi,

The REST action you are calling is returning the HTTP code 500, indicating an error occurred while that server was processing the request. Check your logs from that server to understand what’s wrong with your request.

 

For more details refer to the following documentation: https://docs.mendix.com/howto/integration/publish-rest-service/

answered
0

I have checked the logs from the other mendix app, it is not giving any error message or log message while i execute this microflow. Only in my application i could find the 500 server error and when i try to debug it is not hitting the target app aswell.

answered
0

Its not hitting the target REST, because probably the JSON you send is not in the format it expects. 

So, while parsing the JSON to convert it to object, it fails. 

Check the data types of each attribute from what you send and what is being processed on the other end.

I have a doubt about the following attributes you are sending: 

"RequestId":"0" => Should this be String or Integer or any other type?

"AppOwnerApprovalDate":"2023-07-25 07:18:52" => Is this an acceptable format?
"AppOwnerName":"null" => do you really need to send null as a String?
"AppOwnerEmail":"null" => do you really need to send null as a String?
"AppOwnerNTId":"null" => do you really need to send null as a String?

answered