How to call get all data Tenants in orchestrator cloud api

How can I use the OC API when there is an “Error You are not authorized!”
https://cloud.uipath.com/uipathtrainingroom/TEST/orchestrator_/odata/Tenants
{
“message”: “You are not authorized!”,
“errorCode”: 0,
“result”: null,
“targetUrl”: null,
“success”: false,
“error”: {
“code”: 0,
“message”: “You are not authorized!”,
“details”: “You are not allowed to perform this operation.”,
“validationErrors”: null
},
“unAuthorizedRequest”: true,
“__abp”: true
}

@OOP

Welcome to the community

Looks like your scope is not proper…check and add the required scope

Are you able to perform any other requests?

Cheers

Other information can be retrieved normally. What do you mean by “cope”? Can you provide an example?

@OOP

Did you create an external application in orchestrator to interact with api?

While creating we have to define a scope for the created application

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

Cheers

yes i created on external app api and this is my scope

OR.Administration OR.Administration.Read OR.Administration.Write OR.Assets OR.Assets.Read OR.Assets.Write OR.Execution OR.Execution.Read OR.Execution.Write OR.Folders OR.Folders.Read OR.Folders.Write OR.Jobs OR.Jobs.Read OR.Jobs.Write OR.License OR.License.Read OR.License.Write OR.Machines OR.Machines.Read OR.Machines.Write OR.Robots OR.Robots.Read OR.Robots.Write OR.Settings OR.Settings.Read OR.Settings.Write OR.Users OR.Users.Read OR.Users.Write

@OOP

This looks proper…are you able to do any other request?

Or is it failing for all?

Cheers

I can access other APIs such as Users, Assets or Folders, but I cannot access the API of the tenant.

@OOP

Please check this…looks like you need host admin creds for that

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

cheers

yes i saw this document. but i cannot sure how to set host admin on cloud. Can you have any example?

@OOP

I believe on cloud you cannot set those roles…As we are ideally not the host…I am trying to check on cloud…on on prem I am ablet o authorize but on cloud even I am facing the same error…let me look through and let you know if there is a way to get these details

cheers

Hi @OOP, @Anil_G

Even i am trying to get all the tenant names from the cloud orchestrator. Could you let me know if any of you have found a break through in getting the data.

Thank you.