Get Tenant ID to License Consumption "You are not authorized!"

please remove consumption keyword in there for timebeing and try with only

/api/Stats/GetLicenseStats

like i mentioned in my earlier post

there is something off with getconsumptionlicensestats, it gives blank response. but getLicenseStats should work for you

Also, try with below, it should give you success response

https://cloud.uipath.com/bestit/BESTITDefault/orchestrator_/odata/Settings/UiPath.Server.Configuration.OData.GetLicense

@luca.plein

Atleast one step ahead youa re getting 200 resoonse. now coming to empty response thats because the license consumption stats or license type have changed a lot during past year and that might have broken this api…can you please tell exactly what youa re looking at to get so that we can check other apis which might give you that info?

is it that how many licenses are consumed is what youa re tryign to get?

cheers

I’m trying to get how much of each type of license is being used, the percentage of hours a license is occupied in 24h (but I believe this is not the case now), how many are still free and that kind of thing.

@luca.plein

Could you please show me your scope again? from external application set up as well the one you are passing in insomnia to get access token. I feel something is messed up at scope part.

i am able to get response from this api, response looks somewhat like below, do you think these kind of details would help you ?

or you would need to hit some other license api? below is the one for GetLicenseStats endpoint

OR.Administration OR.Monitoring OR.License OR.Jobs OR.Machines OR.Queues OR.Robots OR.Folders OR.Execution OR.Jobs OR.Users

i think this not help sry ;-;

@luca.plein

There is 1 more api to get the license runtimes allocated to different machines.

its output is as below, please see which one suits your need better:

Regards
Sonali

want to get how much of a license is being consumed, for example, of the 720 hours, how many of those hours was the license in use executing something?

@luca.plein

Could you please show screenshot from external application and insomnia for scope part please?

Hi @luca.plein

Than you for defining your requirement.

For getting such views, i would not recommend api usage as I dont think there is any direct api for same but such kind of details can be pulled from orchestrator db.

So, I would suggest to explore Insights for same. It has alot of inbuilt templates already for use by UiPath, you can consider customizing on top of same. or built totally new one for your reference.

I am attaching below a sample of what you asked from Insights dashboard. I think this is quite similar to your ask.

Hope this helps.

Regards
Sonali

@luca.plein

i see why you are getting authentication error.

in your access token request endpoint, I dont see a organisation name “bestit”

Kindly provide that and then try, it should work.

thank you this helps a lot

1 Like

sorry this didn’t work, i’ll try this another way thanks

So my only option would be to pay for UiPath Insights?

I just tried in my organization with a Personal access token for a user that is the admin and it worked:

Access https://cloud.uipath.com/YOUR_ORG_NAME/portal_/profile/personal-access-token/add (you can create maximum 5 Personal access tokens per user)

Make sure that YOUR_PERSONAL_ACCESS_TOKEN_VALUE has this OR.Monitoring.Read permission for Orchestrator API Access.

Tenant ID you can get from the URL of the Orchestrator when you open in browser.

Method: GET
URL:
https://cloud.uipath.com/YOUR_ORG_NAME/YOUR_TENANT_NAME/orchestrator_/api/Stats/GetLicenseStats?days=7&tenantId=YOUR_ORCHESTRATOR_TENANT_ID
In Headers add this:

Authorization: "Bearer YOUR_PERSONAL_ACCESS_TOKEN_VALUE"

1 Like

Hi @luca.plein

First, please confirm if The response that I shared from GetLicenseStats api above, does that solve your purpose? If yes, then we can spend efforts in getting that api work for you.

If not, and you are looking to get response similar to GetLicenseComsuptionStats, then I would suggest below 2 steps

  1. if you are in enterprise license, raise a support ticket to UiPath asking about GetLicrnseComsuptionStats api as that would solve your purpose but is broken currently. I am also looping @marian.platonov for his inputs on this api.

  2. if output of step 1) is GetLicenseCounsumptionStats api can not be used going further and UiPath doesn’t plan on fixing/recreating that, then yes, Insights is your option. Using Insights you will be able to customize the consumption stats anyway you want. But you will have to buy license for that.

So, My next question would be are you on enterprise license or community one?

If enterprise, you can talk to UiPath local sales team about the same and get quotes.

There might be an option as well to just get a trial for same so you have enough time to figure out if Insights really is the answer to your problem.
And then later you can plan to actually buy or Not buy that.

Please note: pro trial is available for community users as well but I am not quite sure at the moment if it also allows Insights usage. I can check on that for you if you are on community version.

Hope this helps.

Regards
Sonali

1 Like

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