08-05-23 04:10 PM
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
------------------------------
08-05-23 07:05 PM
@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,
08-05-23 07:09 PM
No Eric,
The Post is success.
Its not failing.
Generate OAuth 2.0 Tokens v2| OneLogin Developers
Please refer this url
09-05-23 02:50 PM
@JishnuP_Nair
Thanks for the documentation reference. Based on what I see, this should be the set up of the HTTP Request action.
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,
29-09-23 01:35 PM
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:
29-09-23 02:48 PM
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,
29-09-23 03:06 PM
Hi @ewilson,
Just for some context, earlier we were using Web API interface and the below approach worked for me:
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:
HTTP Call below:
------------------------------
Manish Rawat
Project Manager
Mercer
New Delhi
------------------------------
29-09-23 03:16 PM
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,
29-09-23 03:26 PM
Hi @ewilson,
Thanks for this, it worked!!!