Consumed RestAPI not Obeying Decoded URL Parameter
Application Type
Traditional Web
Platform Version
11.9.0 (Build 17011)

I am consuming an API that requires a parameter for a date in a specific format, (yyyy-MM-ddT00:00:00), Outsystems is automatically encoding the url to GET  

I can modify the parameter using decodeURL ( from HTML_utils forge)  via the OnBeforeRequest which seems to work as the CustomizedRequest shows a decode parameter

but API fails and the logs show a encoded parameter

GET http://xx.xx.xx.xx:9000/01/Customer?ApiKey=xxxx&page=1&pageSize=100&modifiedSince=2021-04-23T00%3a00%3a00 HTTP/1.1

User-Agent: OutSystemsPlatform

Authorization: Basic QXBpQlBNOlR6bzgzbVlL

Accept: application/json

HTTP/1.1 500 Invalid date format

Content-Length: 70

Cache-Control: no-cache

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

Date: Fri, 23 Apr 2021 05:39:10 GMT

Expires: Sat, 01 Jan 2005 00:00:01 GMT

Server: Jade/Greentree

[{"Error":{"StatusCode":"500", "StatusPhrase":"Invalid date format"}}]

You are not allowed send a request with a colon ":" in the URL parameters, that's designed for the server port usually. That's why Outsystems automatically encodes the colon to the respective encoded character from UTF-8 (check the table here).

I am pretty sure this is the default serializable format for a date-time in JSON to REST APIs. Have you tried to add this date-time as a query parameter, and at runtime you send the DateTime object to the API?

You can include parameters between braces in the URL for the method's input parameters like this:


Then change the type for the ModifiedSince parameter to DateTime and use it at runtime.

Check the documentation for more details

Thanks for the response, I have tested the consumed API with postman and it only accepts a text parameter with colons not encoded (API does not belong to us so I cannot change) I have tried with the parameter set as a date time but it still encoded it when it sends, the below works in test but will encode it between the onBeforeRequest and the send, sending it as a datetime object made no difference except to add a Z to the end  

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