Consume rest url paramater chance by Outsystems

Hi,

I'm trying to set up a connector to spotler (former mailplus) by consuming their rest API (Oauth 1.0a (One Leg)), but encounter some problems along the way.

Post https://restapi.mailplus.nl/integrationservice-1.1.0/contact works fine

Get https://restapi.mailplus.nl/integrationservice-1.1.0/contact/{ContactCode} works fine

https://restapi.mailplus.nl/integrationservice-1.1.0/contact/search?pagesize={pagesize}&mpsearchquery=email={email} gives a 403 (forbidden).

When I look a bit further, the url in the HTTP trace is:
https://restapi.mailplus.nl/integrationservice-1.1.0/contact/search?pagesize=1&mpsearchquery=email%3demail%40address.com

I've tried the url in Postman and there is also gives an error, but when I replace the "%3d" and "%40" by "=" and "@" Postman returns the required data.
https://restapi.mailplus.nl/integrationservice-1.1.0/contact/search?pageSize=1&MPSearchQuery=email=email@address.com

Is there a way to send  "=" and "@" in stead of "%3d" and "%40" with outsystems?

Hi,

You have a module called "HTTPRequestHandler" where you have some methods for Encoding of Url.
you can also do OnBeforeRequest of your Web Services, to edit the string before send.

Hopefully it helps you.

Solution

Slavi's answer is correct, but just to give a bit more context:

  • The OnBeforeRequest action is available for you to manipulate REST calls, including URL parameters
  • The DecodeURL action from this Forge component is available specifically to convert encoded URL parameters such as "%3d" back into UTF-8 "="


See example below:

Solution

Thanks Salvi and Gonçalo,

HTML-utils solved this issue.