3028
Views
11
Comments
[Guide] Consume REST API with Form URL Encoded Request
Discussion

Inspired by the guide by Francisco Freire :
https://www.outsystems.com/forums/discussion/36143/guide-consume-rest-api-with-xml-request/

I want to share how to consume REST API with Form URL Encoded Request.

First off, you need a POST http method and set Request Format to Form URL Encoded.

Then, use this in Request Body:


You don't need to set Content-Type, it has been handled by Outsystems.

Hope it helps.

2021-05-05 07-35-47
Vera Tiago
Staff

This is great Harlin. Thanks :)

UserImage.jpg
Kux Amparo

Hi

greetings. I am also integrating with a urlencoded api. my question is when outsystems create the input parameters that you added in the Request box, what should be the value in the Advanced.SendIn portion of that input parameter? Body or URL? 

thanks.

2024-03-25 06-19-08
Harlin Setiadarma

Body.

UserImage.jpg
Kux Amparo

Harlin Setiadarma wrote:

Body.

thanks


2022-12-19 05-31-56
Manikandan Ponvel

Thank you Harlin.  

2021-03-10 13-50-58
NaveenRaj

Hi, 

in my client secret, it contains =.

Client Secret  = xxxxxxxxxxxxxxxxxxxxxxxxxx=

client secret is ending with =, so if I use this format. Its not working


Client_Secret=xxxxxxxxxxxxxxxxxxxxxxxxxx=&Client_Id=xxxxxx


This showing invalid Client Secret. Kindly help me in this.

2023-12-04 02-05-26
Anuj Chandrakant Malani

Try changing your password and replace that character with a regular character

2022-09-12 05-19-11
Apoorv Choubey

Hi all

How to pass grant_type={grant_type}&....... using input parameter into request body. Am consuming one of token api and set Request Format to Form URL Encoded with POST http method. When i finish consuming api am getting number of input parameters and am passing value into all input parameters which is pass while test and into postman as well.


When i test api into outsystems and with postman it works and give me proper response but when call it into my action it gives me error 400 Bad reuest.

UserImage.jpg
Preetham Kumar

Were you able to fix this, as I am running into this issue @Apoorv Choubey 

UserImage.jpg
Nick Swaine

I'm encountering the same issue. Were you able to resolve? I have my request configured exactly like yours and am getting a 400 when invoked.

2024-03-25 06-19-08
Harlin Setiadarma

@Nick Swaine in URL Path is there a special character? 

Like this: /v1/places:autocomplete
You can test is successfully inside Service Studio, then it would give you 404 error in runtime.

If you enable full logging, you will see that at runtime, Outsystems encoded it to /v1/places%3Aautocomplete.

This will cause 404 error.

To solve it you must use OnBeforeRequest to alter URL Path to the correct one.

This is Outsystems old bug that never been fixed, you might help community by reporting it using Support Ticket. More voices will be heard more louder.

Hope this helps....

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