10
Views
4
Comments
Solved
Consuming an API using variables, it returns error 500, but not when using constants.
Question
Application Type
Reactive
Service Studio Version
11.55.40 (Build 64353)
Platform Version
11.18.1 (Build 37828)

In Reactive, when consuming an API using variables, it returns error 500. But if the values are set to constants, it does not happen.

I changed the variable numberRef variable both as long integer and text, but the error continues.

I used TRIM() in the userId value, which is text, but it did not fixed the error.

The request has the following format:

Sample Request:

{

  "userId": "AB1234",

  "numberRef": 1234,

  "comments":"This is a comment"

}

Please advise.

2025-10-18 11-13-53
Ramesh subramanian
Solution

Hi Robert Feliberty,
The issue is that numberRef is still being treated as Text. As a result, OutSystems serializes it with quotes, which causes the API to reject it, leading to the 500 error. 

2019-01-07 16-04-16
Siya
 
MVP

@Robert Feliberty : Set the logging level to Full ( Factory -> Module -> Integrations -> Consumed REST APIs -> Your Integration -> Logging Level) , run the application, and review the log file to verify what is being sent. This will help you identify and resolve the issue.

2024-10-25 19-39-27
Robert Feliberty

Hi Siya,

Thanks for your prompt response. 

I was already set the logging levels to "Full".

I did check the logs and the error messages did not clarify what's wrong.

In the same way, I verified the values and they look as they should. 

Thanks.

2019-01-07 16-04-16
Siya
 
MVP

Do you mind sharing screenshots of both logs (the one that works and the one that doesn’t), making sure to mask any sensitive information? 

2025-10-18 11-13-53
Ramesh subramanian
Solution

Hi Robert Feliberty,
The issue is that numberRef is still being treated as Text. As a result, OutSystems serializes it with quotes, which causes the API to reject it, leading to the 500 error. 

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