Orchastrator And Swagger

Hello @UiPath_Community

I am connecting to Orchestrator using Swagger :-

Above Image show that I am successfully Authorize after clicking on Authorize button.

But when I am trying to do “Account Authenticate” by providing tenancyName, usernameorEmail, password. Then it is showing error in response.

Also wanted to tell that while access Orchestrator I am not using any credentials, I am just clicking on Windows symbol and it redirect me to Orchestrator.

I want to trigger Bot in orchestrator using swagger.
Can anyone please help.
Also can you please help to let me know how we can get “Bearer Token”.
Also wanted to inform that I am using OnPrem Orchestrator.

Please help.

Thanks in Advance

You need a specific user set up in Orchestrator with API access.

@Vaibhav_Shukla

In swagger…when you are already wuthenticated why do you want to authwnticate again?

If you want to start a job…please go to start job api …provide details and then run that or execute it

Here is sample

Cheers

I am trying authenticate bcoz this automatic authentication works only if orchestrator is already open in another tab. But if orchestrator is not open then we need usernam and password to authenticate.
Can you please help?

@Vaibhav_Shukla

From swagger only automatic authentication works…that is the only way

Cheers

If you have authorised a bearer authorization header is automatically used for your requests.

Expand an Orchestrator API resource with which you want to perform an operation. The closed lock means that you’re authorized.

In the expanded method window, click Try it out. Specify parameter values if required. Click Execute. The request is executed.

@Vaibhav_Shukla

Is there any way to fetch Bearer token.

Also I have noticed if orchestrator is opened in a tab then only swagger automatic authorization works. Otherwise we need username and password.

@Palaniyappan

1 Like

Okai thanks,
Is there any other method for doing API call…
@Anil_G

@Vaibhav_Shukla

May I know from where you want to do the api calls?

cheers

from ATR(MyWizard). we will be using python script.
Means if any new ticket arrive in ATR it should call the UiPath script through API call.

@Anil_G

@Vaibhav_Shukla

Please check this on how to use api call by setting up external application

https://docs.uipath.com/orchestrator/automation-cloud/latest/api-guide/consuming-cloud-api

https://docs.uipath.com/automation-cloud/automation-cloud/latest/admin-guide/authorizing-external-applications#three-parts-to-authorizing-external-applications

cheers

Check this doc for steps to get authorised in swagger
This is one time so that for any api call it gets automatically authenticated

https://docs.uipath.com/orchestrator/standalone/2022.10/api-guide/authorizing-api-calls-in-swagger#obtaining-an-access-token

Cheers @Vaibhav_Shukla

@Palaniyappan @Anil_G @postwick @loginerror

I tried Postman also and when I m passing “tenancy”, “username”, “password”, then it is showing error as “Invalid credentials”.
My account is created as AD user and we connect to orchestrator by clicking window symbol. We are not accessing orchestrator with username and password.
So can you please let me know how I can generate token ??

@Vaibhav_Shukla

Username password will jot work…please create external application and then use from postman…i have provided the related links as welll on how to create external application and how to authorize using it

Cheers

You need a dedicated local Orchestrator user for the API with the necessary permissions granted.

If you are using an AD (Active Directory) user account to connect to Orchestrator by clicking the Windows symbol (presumably using Windows Integrated Authentication or Single Sign-On), it means you are not using a traditional Orchestrator username and password for authentication. In this case, generating a Bearer token via the /api/Account/Authenticate endpoint with a username and password will not work because you are not using those credentials to access Orchestrator.

When using Postman, ensure that you configure it to use Windows Integrated Authentication (also known as NTLM) if Orchestrator is set up this way. Postman has support for Windows Integrated Authentication, but you need to configure it correctly.

  • In Postman, go to your request settings.
  • Under the “Authorization” tab, select “NTLM” as the type.
  • Ensure that your Postman session is running with the same user context that has access to Orchestrator without a separate login prompt.

Reason being - When Orchestrator is configured for Windows Integrated Authentication, it relies on your Windows user account’s authentication, and you don’t need to provide a separate username and password. If you’re already logged into your Windows session with the appropriate AD credentials, you should have access to Orchestrator without needing to generate a Bearer token.

Hope this clarifies @Vaibhav_Shukla

Hello @Palaniyappan

Can you please help to provide complete step by step how I can do this?? Means fetch NTML ??

Check this out

@Vaibhav_Shukla

Hello @Palaniyappan @UiPath_Community

I tried NTML.
Please find screenshot below.


Still I am facing issue it is showing error as “Login Model cannot be null”.
Can you please let me know if I have missed anything or entered anything wrong.
Also please let me know what should be the method(post, get) and url that we need to use in to get NTML token.

Thanks in Advance

1 Like

Check this if ur is on same note

@Vaibhav_Shukla