cancel
Showing results for 
Search instead for 
Did you mean: 

unable to create a POST call using HTTP action

JishnuP_Nair
Level 3

Hi All,

I need some help. I am trying to do a HTTP POST call which is working fine in postman.
As per postman these are the attributes.
Authorization:
Basic Auth with client id and secret.

Body :
content type : application/x-www-form-urlencoded
Key :grant_Type 
Value : client credentials

Could you please help me setup the same in HTTP in blueprism 



------------------------------
Jishnu P Nair
Developer
Ey
Asia/Kolkata
------------------------------

17 REPLIES 17

@JishnuP_Nair 

So the Postman request is failing too? If so, it would seem you don't have the proper definition of the REST endpoint. Let's get it squared away in Postman and then worry about getting it working in Blue Prism. Do you have actual developer documentation about this endpoint?

Cheers,



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

No Eric,

The Post is success.

Its not failing.

Generate OAuth 2.0 Tokens v2| OneLogin Developers


Please refer this url



------------------------------
Jishnu P Nair
Developer
Ey
Asia/Kolkata
------------------------------

@JishnuP_Nair 

Thanks for the documentation reference. Based on what I see, this should be the set up of the HTTP Request action.

27656.png
You will change the Address URL to match your domain and you'll need to supply values for the ClientID and ClientSecret parameters. Also, pay attention to the use of double quotes on the request body. Two double quotes together is basically a mechanism for escaping the second set of double quotes so they're actually included in the request.

Cheers,



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @ewilson,

How should we send the details in body if we have multiple key value pair to be sent in HTTP VBO, my use case has the below format:

27664.png



------------------------------
Manish Rawat
Project Manager
Mercer
New Delhi
------------------------------

Hello @Manish Rawat,

So you're asking about what the body for an auth request would look like multiple values? If so, the request body in the previous example is just JSON, so it's a matter of adding a comma after the first set of name/value and then add the next so forth and so on.

Example: 

"{ ""grant_type"": ""client_credentials"", ""scope"": ""web"", ""client_id"": ""<YOUR ID>"", ""client_secret"": ""<YOUR SECRET>"" }"

Instead of doing the double-double quotes, you could also do the traditional BP mechanism of building a string with double quotes using the & Chr(34) & format.

Example:

"{ " & Chr(34) & "grant_type" & Chr(34) & ": " & Chr(34) & "client_credentials" & Chr(34) & ", " & Chr(34) & "scope" & Chr(34) & ": " & Chr(34) & "web" & Chr(34) & ", " & Chr(34) & "client_id" & Chr(34) & ": " & Chr(34) & "<YOUR ID>" & Chr(34) & ", " & Chr(34) & "client_secret" & Chr(34) & ": " & Chr(34) & "<YOUR SECRET>" & Chr(34) & " }"

Cheers,



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @ewilson,

Just for some context, earlier we were using Web API interface and the below approach worked for me:

27682.png

However due to new requirements now we have to add certificate to the request which is only possible through HTTP VBO, hence I want to convert this body template to the respective body details.

I tired both the methods suggested above but both resulted in 500 error below:

27683.png


HTTP Call below:

27684.png
------------------------------
Manish Rawat
Project Manager
Mercer
New Delhi
------------------------------

Ah, that's not JSON. Just straight text. So you've have something like this:

"grant_type=" & [grant_type] & "&scope=" & [scope] & "&client_id=" & [client_id] & "&client_secret=" & [client_secret]

Cheers,



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @ewilson,

Thanks for this, it worked!!!



------------------------------
Manish Rawat
Project Manager
Mercer
New Delhi
------------------------------