Provision robot for the user

Hi,
I am trying to provide the developer license for the developer using Rest API. This way I can optimize the license by swapping the license for the developers before the developer starts work.

I tried to first get the current license for the user:

https://cloud.uipath.com/XX/XXTenant/odata/Users(41802)

This gives me the one of the outputs

"RobotProvision": {
  "UserName": "autogen\\xxuser_local",
  "RobotId": 21733,
  "RobotType": "Development",
  "ExecutionSettings": {}
},

Now, as per the following documentation, if I try to provision the bot for the user
Users Requests as per same payload given above, by using the PUT method for the following API,

https://cloud.uipath.com/XX/XXTenant/odata/Users(41802)

I get the following error, any idea on this?

{
  "message": "User not found",
  "errorCode": 1002,
  "resourceIds": null
}

@Palaniyappan @ignasi.peiris Any idea on this one?

Hey there @Vishal_Kalra !

Trying on my end, I seem to get a different output, but Iā€™m using On-prem Orchestrator. will keep you posted!
image

As a tip, generally if the API is not behaving the way I expect or understand that it should, I will perform the actions needed in the Web UI while using the Browsers Network Inspector to watch the Requests and Responses to ensure I am building the Requests as needed.

You can also look at Swagger documentation to see the full payload example

https://cloud.uipath.com/--organization--/--tenant--/orchestrator_/swagger/index.html#/Users/Users_PutById

{
  "Name": "string",
  "Surname": "string",
  "UserName": "string",
  "Domain": "string",
  "DirectoryIdentifier": "string",
  "FullName": "string",
  "EmailAddress": "user@example.com",
  "IsEmailConfirmed": true,
  "LastLoginTime": "2021-11-26T04:37:25.737Z",
  "IsActive": true,
  "CreationTime": "2021-11-26T04:37:25.737Z",
  "AuthenticationSource": "string",
  "Password": "string",
  "IsExternalLicensed": true,
  "UserRoles": [
    {
      "UserId": 0,
      "RoleId": 0,
      "UserName": "string",
      "RoleName": "string",
      "RoleType": "Mixed",
      "Id": 0
    }
  ],
  "RolesList": [
    "string"
  ],
  "LoginProviders": [
    "string"
  ],
  "OrganizationUnits": [
    {
      "DisplayName": "string",
      "Id": 0
    }
  ],
  "TenantId": 0,
  "TenancyName": "string",
  "TenantDisplayName": "string",
  "TenantKey": "string",
  "Type": "User",
  "ProvisionType": "Manual",
  "LicenseType": "NonProduction",
  "RobotProvision": {
    "UserName": "string",
    "ExecutionSettings": {},
    "RobotId": 0,
    "RobotType": "NonProduction"
  },
  "UnattendedRobot": {
    "UserName": "string",
    "Password": "string",
    "CredentialStoreId": 0,
    "CredentialType": "Default",
    "CredentialExternalName": "string",
    "ExecutionSettings": {},
    "LimitConcurrentExecution": true,
    "RobotId": 0,
    "MachineMappingsCount": 0
  },
  "NotificationSubscription": {
    "Queues": true,
    "Robots": true,
    "Jobs": true,
    "Schedules": true,
    "Tasks": true,
    "QueueItems": true,
    "Insights": true,
    "CloudRobots": true
  },
  "Key": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "MayHaveUserSession": true,
  "MayHaveRobotSession": true,
  "MayHaveUnattendedSession": true,
  "BypassBasicAuthRestriction": true,
  "MayHavePersonalWorkspace": true,
  "UpdatePolicy": {
    "Type": "None",
    "SpecificVersion": "string"
  },
  "LastModificationTime": "2021-11-26T04:37:25.737Z",
  "LastModifierUserId": 0,
  "CreatorUserId": 0,
  "Id": 0
}

Thanks @codemonkee , this helped me resolve it.

1 Like

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