REST Service input string misformating

Hello everyone

I have a question regarding inputs on rest services.

When I send a string to the input of a rest service, as part of the request url

ex.: localhost:9200/_search{querystring}

querystring="?sort=account_number:desc"

I always get a misformat when creating the endpoint

like this:
_search%3Fsort%3Daccount_number%3Adesc

should be:
_search?sort=account_number:desc

how can I solve this

Thanks!

Hi Kyle. You should map the individual query parameters as input parameters on your REST service. For example:


localhost:9200/_search?sort={sort}


If you need, for any reason, to support a dynamic query string, then you might need to use the OnBeforeRequest handler to process the query string: https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/REST/Consume_REST_APIs/Simple_Customizations

Hi Kyle,

All parameters are URL encoded. What you should have as the URL is:

_search?sort={Sort}

Where Sort is an Input Parameter (or, additionaly, _search?sort={Sort}:{SortDirection} if you want to specify the direction differently).

If you have more parameters, it becomes something like:

_search?filter={Filter}&sort={Sort}

etc. The Platform automatically removes empty parameters from the string if they are specified as non-mandatory, so there's no need to account for that.

EDIT: Damn, ninjad by Leonardo :)