Consuming APIs with the new Cloud Orchestrator

The auth code and code verifier are just the first step. There is a list of steps after that (outlined in the document referenced earlier) that will allow you to call any cloud API after that.

2 Likes

Yes, I have seen this and tested it successfully.

Rather, I was referring to the fact that not always the unrestricted access to all endpoints should be guaranteed. Assuming that the API is used by a (third-party) integration, you only want to give them access to 2-3 specific endpoints.
Generally, it seems to me that the authentication process is quite error-prone as it involves many copy & paste steps (e.g. from parts of the URL).

So one idea I have is to create some kind of “API user” directly in the Cloud UI with specific endpoint permissions and access key that is sufficient to authenticate. Would this be an option?

Thank you!

4 Likes

Yeah the authentication process is kinda difficult to automate with the NodeJS encryption and URL copying

2 Likes

Absolutely. Our plan is to have a cleaner API experience. This is a temporary workaround for now during the Public Preview stage.

4 Likes

Has anyone created an automation for the refresh that they would be willing to share?

Also @ tarekmadkour when will the permanent solution be released?

2 Likes

Hi @alfalfi

Welcome to our UiPath Forum! :slight_smile:

Sure, have a look at this project:
CloudAPI_GetAccessToken.zip (12.0 KB)

It basically recreates the steps from the Cloud API guide in 4 ‘simple’ workflows:
image

I will rush it out, even though some functionality still needs to be added. But maybe someone here on the Forum could take care of that :slight_smile:

You will need Chrome for it to work :slight_smile:

6 Likes

Fantastic - thanks, Maciej. I put my own project together but made all the JSON calls outside UiPath as I wasn’t aware of the web.activities package which I have to thank you for introducing me to as well!

4 Likes

image

I am new to UIPath, I created my ID today using Basic Authentication(Even Reset the password)
I followed Consuming Cloud API but unable to authenticate.
The credentials are the same that I used to login and it works.

2 Likes

HI Utkarsh,

Welcome to our UiPath Forum.

You need to follow the steps provided in the link below to be able to authenticate and make API calls on Cloud Orchestrator.

UPDATE [June 11]: This new API guide describes how to consume APIs for cloud tenants for all new and migrated accounts going forward: https://orchestrator.uipath.com/v2019/reference#consuming-cloud-api

2 Likes

@Vijay_Rajasekharuni

I made an account using using Sign up with Email (used iCloud)

Now for using the following API

Where
tenancyName: From the Services Tab
usernameOrEmailAddress: Same with which I created the account
password: Same with which I created the account

As I get to know that it has moved to the Cloud, I followed the link: https://orchestrator.uipath.com/v2019/reference#consuming-cloud-api
Which had

  1. Getting Token to Use in Your API Calls.(Works)
  2. Discovering UiPath Account and Service Instance Identifiers.(Works)

Now while authenticating I use the following

POST: https://platform.uipath.com/[account_logical_name]/[ service_instance_logical_name]/api/account/authenticate
Request:
Content-Type: application/json
{
“tenancyName” : “serviceInstanceName”,
“usernameOrEmailAddress” : “XXXXXXXXX”,
“password” : “XXXXXXXXX”
}

I am getting Invalid Credentials. I use the same emailId and password to login and it works

2 Likes

Hi @UtkarshTrehan

One crucial thing is that you should no longer use the authenticate endpoint. You should use the method of authenticating from the Cloud API guide and then use the access_token generated from those activities to authenticate your calls.

See my post here with a sample project and sample calls you can easily make :slight_smile:

4 Likes

Hi @loginerror

Thanks, This made me understand

4 Likes

I followed the Consuming Cloud API document but failed to get token. Btw I created a new account.

Any help will be appreciated

2 Likes

You need to pass the information as json in the body of the message not as parameters.
In “postman”, remove the parameters you have and go to the “body” tab and paste the information there as specified in the documentation. Make sure you specify “json” as the type of the body. This should make it work.

4 Likes

Hi guys,

I want automate the access token request process inside a NodeJS script, but I stopped in the step that need to pass the credentials to the login page, anyone have idea how to pass the user/password by parameters or http headers? Or when we will have way to generate an API key to use direct to cloud api service? Tks a lot!

3 Likes

Hi @Anderson_Lazzari

Welcome to our UiPath Forum! :slight_smile:

Please see my post above:

It contains a working example of this exact automation, together with an example API call :slight_smile:

4 Likes

Thanks for reply, but I want to automate outside of uipath using nodejs, so I want to know if have a way to send a post directly to the url https://account.uipath.com/usernamepassword/login using a request payload to use a chain like this
-> authorize…
-> login…

1 Like

Thank you very much. It worked!

4 Likes

Hey there,
I’m trying to authenticate by sending a GET and a POST to https://cloud.uipath.com/oauth/token,
however, as a response I get a HTML string, not the token in a json format.

This is the html string I geT: <!doctype html>You need to enable JavaScript to run this app.

I’m using Zapier to send the request, I tried adding “accept: application/json” and “request: application/json” in the headers but no success.
I appreciate any help.
Thanks!

3 Likes

Is there any way to get [Authorization code] via API without going to browser.

https://orchestrator.uipath.com/v2019/reference#section-getting-authorization-code

1 Like