Hi everybody! I’m connecting to an API using the Call REST activity. My call is a POST and I’m using the custom request template. The API that I am trying to access is requiring an integer in the request but when I try to add a parameter that would be an integer it is only allowing a string. Is there a way to add an integer as a parameter or change the parameter type? Here’s an overview of the request: This is me trying to add it as an integer. I’ve tried it by having the file_size being created as an integer and it still hasn’t worked. I noticed that the parameter at the moment is only taking strings, is there a way to allow integers as well?
Im not sure about RequestTemplate, but it certainly works with Exportmapping
- You can create an ExportMapping with your entity https://docs.mendix.com/refguide/export-mappings
- Use that to create JSON
- Pass the JSON in your request
I don’t think you have a problem here. You’re creating your own template for the request, which is a JSON string. That’s why Mendix wants strings as parameters. In your first screenshot we can see that the “integer” part (the file_size value) is not between quotes, so it will be parsed as an integer value. I'd go ahead and test it.