cancel
Showing results for 
Search instead for 
Did you mean: 

API Attachment

OmkarShete
Level 3
I have third party API. In that they have app ID and app secret. When i use POST command and in body i have to give these 2 parameters then only i will be able to hit the query and in result i will get Bearer Token. From blue prism how to do this? please explain step by step procedure ...

------------------------------
Omkar Shete
------------------------------
7 REPLIES 7

ewilson
Staff
Staff
Hello @OmkarShete,

Has the 3rd party platform provided you with any examples (i.e. Postman Collection, cURL, etc)? How are you trying to send the web request from Blue Prism? Are you using the Utility - HTTP VBO, a Web API service definition, or a Code stage?

Cheers,


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

hello Eric,
 Thank you for your reply.

In Postman body, I have to write following 
{
  "type""application",
  "appId""__appId__",
  "appSecret""__appSecret__"
}
So that "__ appId__" shou;d be replace by the value that website gives and appsecret replaves by secret code that website gives.

https://api.abcx.ai/oauth2/token:generate is the type of query.

Generate the access token which is required for making any API call. You must execute this API before executing any other API.

Replace your appId and appSecret values in the request body.
Authorization: Bearer Token

Request Headers
Content-Type    application/json
Bodyraw (json)
json
{
  "type""application",
  "appId""__appId__",
  "appSecret""__appSecret__"
}



------------------------------
Omkar Shete
------------------------------

@OmkarShete,

Ok, but the underlying question is still how do you want to call this API? Do you want to use the Utility - HTTP VBO, a Web API Service definition, or a Code stage? Here's an example of using the Post JSON action of the Utility - HTTP VBO:

Utility - HTTP VBO
17597.png
17598.png
17599.png
In a nutshell, you build the content of the request body (shown in the Calculation stage) and then supply it as the input to the JSON parameter on the Post JSON action (along with the URL of the authentication service).

One thing to point out. You're notes reference use of the Authentication header. That's typically not the case on the initial authentication request unless you have an extra token (ex. and API key) that needs to be included too. Typically, the access token you receive from the authentication call will be used in your subsequent API calls as the input for the Authentication header.

Cheers,

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

Thank you Eric for your reply

------------------------------
Omkar Shete
------------------------------

Eric, I want to set that access token, generated in collection, in common headers of API.

Also i want to ask how to generate above process by  a Web API Service definition, or a Code stage.....

------------------------------
Omkar Shete
------------------------------

@OmkarShete,

We can use the Microsoft Graph - SharePoint connector as an example. It's designed as a Web API Service in Blue Prism. If you look at the Common Parameters section, you'll see the definition of an input parameter name Access Token. Now, in the Common Headers section, you can see where we've defined the Authentication header and set it's value to be Bearer [Access Token].​ Thanks to parameter substitution when an action is called on this Web API the HTTP request will no include a header called Authentication and it's value will be populated with "Bearer XXXXX" where "XXXXX" is the value we pass in to the Access Token parameter.

17606.png
17607.png
Cheers,

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

Thanks Eric.

Its working fine. 
Thank you so much..

Also i want to know how to generate above process by  a Web API Service definition, or a Code stage.....

------------------------------
Omkar Shete
------------------------------