Enabling CORS for calling UiPath API and running process from client-side with Cloud Orchestrator deployment

How can I enable CORS to call the UiPath API and run a process from the client-side when my UiPath process is deployed on Cloud Orchestrator?

@Aman_Tiwari

If you are talking about giving access to api …then you need to go to admin and create an external application there which gives you oauth access details

https://docs.uipath.com/automation-cloud/docs/managing-external-applications

Cheers

Hey,

TO be enable CORS, either you can install a CORS plugin in browser, which will make the request to think its CORS complaint and request would go through.

If its a UiPath api, then cors would be enabled you have to reach out to your network team to help you in that regard.

Thanks,
Hope this helps

Hello Anil,
Basically I want to run the process deployed on the cloud orchestrator from a share point side, on a click of a button.

@Aman_Tiwari

Then enable orchestrator api…and in your sharepoint on click of button give a trigger to call the start job api with required details

For api details check below

<Orchestratorurl>/swagger/index.html

Cheers

Hi @Anil_G ,
i have done that but while calling that api from the sharepoint, we are getting the cors error.

@Aman_Tiwari

Are you not using oauth authentication?

Are you ising orchestrator api Details?

Cheers

I encountered a CORS error when attempting to run the following APIs:

  1. API for obtaining the access token: Endpoint: https://account.uipath.com/oauth/token This API is used to authenticate and obtain the access token required for making subsequent API requests.
  2. API for retrieving the release key: Endpoint: https://cloud.uipath.com/${account_logical_name}/${tenant_logical_name}/orchestrator_/odata This API is used to retrieve the release key for a specific process.
  3. API for starting the process: Endpoint: ${orchestrator_url}/Jobs/UiPath.Server.Configuration.OData.StartJobs This API is used to initiate the process with the provided input arguments.

While these APIs worked properly in a Node.js environment, I encountered a CORS error when running them in SharePoint. This error occurs due to cross-origin restrictions imposed by web browsers.

To address this, I attempted to create an external application in UiPath Cloud Orchestrator. However, when using the “https://cloud.uipath.com/identity_/connect/token” API to obtain the token, I received a 404 error, indicating that the requested resource was not found.

@Aman_Tiwari

External application has to be used and I guess you are using a wrong set I believe…please check this

Cheers