How to add Directory User using the API?

How to add directory user?

How to add directory user?

Any actions that can be done from web browser is also possible by Orchestrator API. When viewed/ created/ edited/ deleted anything from web browser, it creates HTTP request to Orchestrator, which can be captured in the network log of the web browser developer tool (F12 key) and mimic it for the API. Although the API varies depends on Orchestrator version,

  1. Below is the API, used for Orchestrator 2023.10.0.

Endpoint POST /odata/Users

Body

{

"Name": "",

"Surname": "",

"DirectoryIdentifier": "ad|S-1-5-21-1436557885-1187206025-2706295637-2102@hama",

"Domain": "hama",

"RolesList": [

"Orchestrator Administrator"

],

"Type": "DirectoryUser",

"NotificationSubscription": {

"QueueItems": true,

"Robots": true,

"Jobs": true,

"Tasks": true,

"Schedules": true,

"Queues": true,

"Insights": true,

"CloudRobots": true,

"Export": true

},

"MayHaveRobotSession": true,

"MayHaveUnattendedSession": true,

"MayHavePersonalWorkspace": false,

"BypassBasicAuthRestriction": false,

"RobotProvision": {

"ExecutionSettings": {}

},

"UnattendedRobot": {

"UserName": "hama\\domainuser1",

"CredentialStoreId": 1,

"CredentialType": "Default",

"LimitConcurrentExecution": false,

"Password": "password123",

"ExecutionSettings": {}

},

"IsExternalLicensed": false,

"RestrictToPersonalWorkspace": false,

"LicenseType": "StudioPro",

"UpdatePolicy": {

"Type": "None"

}

}

  1. Not all parameters in the API used from the web browser is necessary. Try omitting some parameters and see if the parameters are optional or not with Swagger.

For example, the following body works too

{

"DirectoryIdentifier": "ad|S-1-5-21-1436557885-1187206025-2706295637-2102@hama",

"Domain": "hama",

"RolesList": [

"Orchestrator Administrator"

],

"Type": "DirectoryUser"

}

Body

  1. In this Orchestrator version, get the value of DirectoryIdentifier from a response of another API
  • GET /api/DirectoryService/SearchForUsersAndGroups?domain=hama&prefix=user1&searchContext=Users