API Connection to Orchestrator

Hello everyone,
I have a code written in Python to connect to UIPath Orchestrator. Below is the screenshot of the code. Once I connect, I am also able to execute jobs using API POST calls.

This is the output I get.

However, when I execute the exact same code for another Orchestrator Organization (of course, changing the tenancyName, username and password), the code keeps throwing an error.
{‘errorCode’: 1000,
‘message’: ‘Invalid credentials, failed to login.’,
‘resourceIds’: None}

I am able to login to the Orchestrator (platform.uipath.com) using the same credentials I have entered in the code. So I am not sure why it keeps saying “Invalid credentials…”

Any ideas? Is there something in the Orchestrator settings that I am missing? Thanks in advance.

Have you setup your API Access in the Cloud Platform before trying to consume the API?

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

Thank you for your reply. However, I had already checked all of these having gone through the documentation in detail. Here is the screenshot of what I see.

I don’t know if it means anything but I see that the Tenant Logical Name has some numbers at the end i.e. ABC12345 instead of ABC whereas in the orchestrator URL the tenant name shows as ABC. Could this be any indication of an issue?

Logical Name is the full identifier for the Account or Tenant and is expected.

With Cloud Orchestrator there is no need to call the /api/account/authenticate endpoint any more, this was used for basic authentication which I believe is disabled and only OAuth2 is enabled. In Enterprise Server (private) instances, you could still use the basic auth method.

You should be authenticating against https://account.uipath.com/oauth/token using the values from your API Access screen and in return the access_token is provided as Bearer token in the Authorization header for subsequent request as described in the link provided above.

In your sample code, it doesn’t appear you are following the documentation.

Thank you yet again for guiding me. I had tried the OAuth2 method also but after reading your post I realized the error in my OAuth2 code. I was using “platform.uipath.com” instead of “account.uipath.com” to perform the authentication. Due to this reason I was not able to get authenticated through this method either.

While this does resolve the issue for me, I still can’t figure out why the code I showed above works fine for the other Organization where the licenses and other settings are similar. But I will leave that aside for now. Thanks once again.

Are the other organizations cloud instances as well? I cannot be certain but it might depend on when their instance was created as OAuth2 only was a multi stage approach where you could use basic or OAuth for a time. I’m not sure if it was a blanket disable of basic or if it was only new instances created after basic was disabled.

For private Enterprise you are still free to use basic authentication.

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