Support > Forums > OpenBots Studio > API Requests

API Requests

Fred Fishbein

  • Reporter
  • Calender Icon March 04,2022 at 3:30 PM

Hello everyone, I'm trying to make an HTTP POST request to an external API which needs to pass url-encoded parameters (OAuth2) into the body of the request. In the HTTP command Execute HTTP Request what is the proper way to pass in these parameters into the body of the request? Which option is url encoded? Thanks in advance?

This forum has 317 topics, 687 replies, and was last updated 4 months ago by Nataly Alvarado...

Fred Fishbein

  • Participant
  • Calender Icon March 09,2022 at 1:03 PM

POOLMAL001 after your recommendations that did the trick. Thank you!

Poornima Malviya

  • Participant
  • Calender Icon March 08,2022 at 10:56 AM

Hi FREFIS001,

For the above query, I would suggest the header name and header value keep the same. For the body please choose the format as Raw Json. For the command, the other input is Raw Data. There you need to assign values, which are available in the postman Body - (x-www-form-urlencoded) tab. The format to assign values in Raw Data field is - "Username=" + vUsername+ "&Password=" + vPassword+"&client_id"+vClientID

The name should match the names available in postman created in the body (x-www-form-urlencoded) tab. and to connect multiple variables with &. Please let me know in case of any queries

Fred Fishbein

  • Participant
  • Calender Icon March 07,2022 at 2:47 PM

Thank you POOMAL001, I've added the headers as recommended but the body needs to be of type urlencoded as well. If I make a Postman query for the Oauth response to work correctly it has to have a header of type and also a body of type. Any way to do this in openBots? In Postman, If I try to use Json with the header of urlencoded it says that it's the wrong query language format. Any thoughts? Thanks

Poornima Malviya

  • Participant
  • Calender Icon March 07,2022 at 10:29 AM

Hi FREFIS001,

Thankyou for sharing your query. For the url-encoded parameter, please pass your header name as - "Content-Type" and Header value as - "application/x-www-form-urlencoded" The body you can choose the format as - Json/Raw Json as per your need.

Please let me know in case of further queries.

You are not authorized to reply, please click here to login and add your reply to this topic.