Cloud API Access

Hi @loginerror ,

I referred the documentation and unable to find the “API Access option” under tenant services list.

Please find the below screenshot for reference.

Can you please suggest me on this one.

Thanks & Regards,
Likith Rajesh.

1 Like

@Lahiru.Fernando @Palaniyappan @Shanmugam_Balamuruga Can anyone please help me on this issue.

Thanks in Advance.

Thanks and Regards,
Likith Rajesh.

1 Like

I don’t know if this is a recent undocumented change with 2022 or not in Cloud. There have been two methods of authenticating with Cloud, the original API Token Based that you are looking for and an OAuth Based authentication by Registering an External Application.

https://docs.uipath.com/orchestrator/v0/reference/consuming-cloud-api

Reviewing the Community Cloud running 22.3.3 I don’t see the API Access Option / Cloud Icon next to Orchestrator. However services are moving towards an OAuth model and even if the two options were available I would recommend going with External Application / OAuth, more information can be found in the following documentation.

There is also a reference to NTLM Authentication being Deprecated and Removed and note to use OAuth in 2021.10, not directly related, but it shows that they are gradually moving to OAuth.

1 Like

Hey @likith_rajesh

This is now migrated to Admin → External Applications tab.

nmnithinkrishna_uipath_orchestrator

Create your confidential application and provide App scopes by getting your client id and secret.

You can then import below Curl command in postman,

curl --location --request POST ‘https://cloud.uipath.com/identity_/connect/token’
–header ‘Content-Type: application/x-www-form-urlencoded’
–data-urlencode ‘grant_type=client_credentials’
–data-urlencode ‘client_id=xxx’
–data-urlencode ‘client_secret=xxx’
–data-urlencode ‘scope=OR.Folders OR.Folders.Read’

You can replace the scope above with your scopes you provide in the External apps configuration (just copy those and paste here).

This will provide you a bearer token in response, which should be used in subsequent requests as a Auth header (Sample below)

curl --location --request GET 'https://cloud.uipath.com/nithinnani07/MyTenant/orchestrator_/odata/Folders' \
--header 'Authorization: Bearer xxx'

Hope this helps

Thanks
#nK

2 Likes

Thanks @codemonkee . It’s coming back to me now.

Several months ago, I had worked on this. It was sitting right under my nose in Postman. For some reason I stopped that project and moved to something else. Trying to recall what it is. I ran these two requests and they did work.

I guess I must have used the (now) legacy method, because it was already existing as a project in Postman.

Thanks for the helpful links. Appreciate the help. :slight_smile:

Andy

1 Like

Thank you @Nithinkrishna ! Your elaborate response is definitely helpful to our community!

I’m glad you are tracking it. I used the whole OAuth thing to work with Data Service APIs. Not sure why I did not switch to doing the same with the Orch APIs.

Cheers!
Andy

1 Like

Perhaps it was when you were working on your Python and File Upload to Storage Bucket :smiley:

I definitely like working with OAuth a bit better, especially in Postman - Keeps it simple.

1 Like

LOL! It was a bit before that. I had a full suite of Orchestrator APIs lying around for a year. I used that to build a Python client running on the Raspberry Pi.

Then last summer, I used OAuth to work with Data Service APIs and even created this YouTube playlist on this topic.

Finally, when I got back to working with Storage Bucket APIs several months later :neutral_face:, I totally forgot that I had started work on OAuth for the Orch APIs and conveniently used the existing Orchestrator APIs to work on the SB stuff.

Doing too many things isn't without consequence.

I do face issues working with traditional clients using OAuth2.0. Not all clients have call back URLs. Therefore if my API call fails, the refresh token is invalidated and I have to find another way to get a new refresh token to restore the client back to operating condition.

Trying to see how to address this issue.

1 Like

Thanks @Nithinkrishna for your support.

I have created external application and trying to get Access token by sending request to “https://cloud.uipath.com/identity_/connect/token” as you mentioned above. However, I am getting response as “Invalid_request”.

Can you please suggest what are possible causes of this issue.

Thanks & Regards,
Likith Rajesh.

1 Like

Hey @likith_rajesh

Kindly show screenshot or export the CURL from postman and post here please.

  • I hope you are making a post request

  • Body should be passed in the form encoding method

Thanks
#nK

@Nithinkrishna I am using HTTP request activity(under UiPath.WebAPI.Activities package) for sending the request.

Please find the attached SS’s for reference.

Body of Request is : “{““grant_type””: ““client_credentials””,““client_id””: “”{App_ID}“”,““client_secret””: “”{SecurityKey}“”,““scope””: “”{scope mentioned in Application}“”}
Thanks and Regards,
Likith Rajesh.

1 Like

Hey @likith_rajesh

Kindly check this props as below,

Attaching project for ref - nmnithinkrishna_OrchestratorAPIAuth.zip (2.2 KB)

Hope this helps

Thanks
#nK

2 Likes

Is this just for theory?

If you are running your Robot connected to the same Orchestrator whos API you are accessing, it would be simpler to use the OrchestratorHTTPRequest which will then run in the context of the Robot’s Credentials.

1 Like

@Nithinkrishna Thanks for solution it worked for me.

Instead of passing request format as Json text format we can pass it as plain text format.

@codemonkee Yeah we can use Orchestrator HTTP for orchestrator API access but this is a case where we can access another orchestrator (not the orchestrator where process is executing).

Once again thanks a lot @codemonkee @Nithinkrishna

Thanks and Regards,
Likith Rajesh.

1 Like

Hey @likith_rajesh

We are passing form url encoded.

Thanks
#nK

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.