Unable to parse token! - This error is coming when i am using Personal Access token

Unable to parse token! - This error is coming when i am using Personal Access token

  • I have generated personal access token and provided all the permissions. then also it is not working
  • basically i have to access the api/licensing/tenantAllocations?accountGlobalId
    this api for fetch all the data for tenants and i am trying it on fcm

Please help

Hi @Devansh_Goswami_IN

Can you please provide a screenshot of the first Authorize API call you made to authenticate into UiPath Orchestrator as well. It will assist in checking if the bearer was created correctly and if the expiration date is shown.

Thanks!

Do we need to hit the authentication api?, claude says this attached in screenshot.
I have multiple questions-
1- What kind or level or authentication is required to access data of api this (I have admin level permissions ).
2- if yes what will be the steps to hit this api successfully.

For other apis i used this token generation api https://cloud.uipath.com/identity_/connect/token and it works perfect with required scopes

I assume you are trying to hit this UiPath API:

Yes, you always need to authenticate when trying to hit any API within UiPath’s ecosystem. You can refer to the Swagger UI to select the one you need - but it will first ask you to authenticate: https://cloud.uipath.com/{Your_Orchestrator}/{Your_Tenant}t/orchestrator_/swagger/index.html#/Tenants/Tenants_GetById

The authentication API you are referring to is 100% correct: https://cloud.uipath.com/identity_/connect/token

You need to first hit this API to authenticate and pass these as Parameters with your necessary scopes:

Once you get the bearer from this response, use THAT in your next API as the input bearer and you should be able to authorize successfully.

Let me know if this helps you.

@Devansh_Goswami_IN

Can you tell what details you want to get

here is a complete api guide based on waht APi you would want to use Automation Cloud - Available resources

cheers


i want to access these data via api. and these data are coming from the api which mentioned above (extracted from developers option)

I would recommend using these API’s to get this information:

  1. Use this API for runtime license data:

  1. Use this API for consumption license data:

The other types of issues for “Unable to Parse Token” are:

  • Insufficient Permissions: Verify that you or external application associated with the token has the necessary scopes and permissions for the specific API endpoint being called.
  • Environment Mismatch: Ensure you are using the correct endpoint URL for your deployment. Automation Cloud and On-Premises Orchestrator use different authentication endpoints and formats.

These api do not provide the data of these below -
No doubt one of it provide data of unattended and test automation but what i need is Data Fabric Unit
Robot Units
AI Units
Agent Units
Heals.

“unattendedRobot”: 0,
“unattendedHostingRobot”: null,
“nonProductionRobot”: null,
“testingRobot”: 0,
“appTestRobot”: null,
“aiRobot”: null,
“gpus”: null,
“dataServiceUnit”: 0,
“robotUnits”: 0,
“aiUnits”: 0,
“agentUnits”: 0,
“platformUnits”: null,
“performanceTesting”: null,
“heals”: 0,
“testHeals”: null,
“medicalRecordSummarizationUnits”: null,
“lendingUnits”: null

and in this api
GET /odata/LicensesRuntime/UiPath.Server.Configuration.OData.GetLicensesRuntime(robotType=‘{robotType}’)
we get choice of

Unattended
NonProduction
Attended
Unattended
Development
Studio
RpaDeveloper
StudioX
CitizenDeveloper
Headless
StudioPro
RpaDeveloperPro
TestAutomation
AutomationCloud
Serverless
AutomationKit
ServerlessTestAutomation
AutomationCloudTestAutomation
AttendedStudioWeb
Hosting
AssistantWeb
ProcessOrchestration
AgentService
AppTest
PerformanceTest
BusinessRule
CaseManagement
Flow

I am not understanding 100% - you’re saying you need the following:

  • Data Fabric Unit
  • Robot Units
  • AI Units
  • Agent Units
  • Heals.

But in your repsonse it shows them there:

“unattendedRobot”: 0,
“unattendedHostingRobot”: null,
“nonProductionRobot”: null,
“testingRobot”: 0,
“appTestRobot”: null,
“aiRobot”: null,
“gpus”: null,
“dataServiceUnit”: 0,
“robotUnits”: 0,
“aiUnits”: 0,
“agentUnits”: 0,
“platformUnits”: null,
“performanceTesting”: null,
“heals”: 0,
“testHeals”: null,
“medicalRecordSummarizationUnits”: null,
“lendingUnits”: null

Does this not give you what you are looking for? It should all be there.

What else are you looking for? :slight_smile:

Haha sorry i confused you, what i need is * Data Fabric Unit

  • Robot Units
  • AI Units
  • Agent Units
  • Heals.

and this respone i got from developer options from orchestrator
“unattendedRobot”: 0,
“unattendedHostingRobot”: null,
“nonProductionRobot”: null,
“testingRobot”: 0,
“appTestRobot”: null,
“aiRobot”: null,
“gpus”: null,
“dataServiceUnit”: 0,
“robotUnits”: 0,
“aiUnits”: 0,
“agentUnits”: 0,
“platformUnits”: null,
“performanceTesting”: null,
“heals”: 0,
so there it was showing the api from which data is coming is https://cloud.uipath.com/xxxx/portal_/api/licensing/tenantAllocations?accountGlobalId = xxx

so i tried accessing this api but it says 403 forbidden

If it’s saying 403 Unauthorized, it means that you have not got the right permissions/scopes to be able to access the data - but it means the API is successful.

So in your External App, go and give yourself access to the following Application scopes:

  • OR.Monitoring OR.Monitoring.Write OR.Monitoring.Read
  • PM.Audit PM.Audit.Read PM.Audit.Write
  • OR.License OR.License.Read OR.License.Write
  • OR.Administration OR.Administration.Read OR.Administration.Write
  • OR.Analytics OR.Analytics.Read OR.Analytics.Write
  • OR.Audit OR.Audit.Read OR.Audit.Write
  • OR.Execution OR.Execution.Read OR.Execution.Write
  • OR.Jobs OR.Jobs.Read OR.Jobs.Write

For the purpose of testing, just give yourself ALL scope access - and then test your API. If it’s 200 success, then you can refine your scopes to the list above :slight_smile: