Support
 
Phone Live Chat
 
Support
 
US: +1 888 720 9500
US: +1 800 443 6694
Intl: +1 925 924 9500
Aus: +1 800 631 268
UK: 0800 028 6590
CN: +86 400 660 8680

Direct Inward Dialing: +1 408 916 9393

 
 
 
 
 
Modify user
 

Modify user attributes API

This API helps in modifying user account in Active Directory from your application.

Request URL (JSON) Format: http://<hostname>:<port>/RestAPI/ModifyUser

Request Parameters:

Parameters Mandatory Description
AuthToken Yes Authentication token that is generated either from the Delegation tab (Delegation > Configuration > Technician Authtokens) or from the My account tab (My Account > Active Authtokens) in the top right corner of the product.
domainName Yes Domain in which the user object has to be modified
inputFormat Yes

User modification template along with attribute details of the user accounts to be modified.

This attribute should be a JSONArray string and should be in the format mentioned below.

[<JSONObject>, <JSONObject>, <JSONObject>];
JSONObject: The key/value pair of LDAP attributes and their corresponding values.

Sample code in java:
JSONArray userDetails = new JSONArray(); JSONObject json = new JSONObject(); json.put("sAMAccountName", "John"); json.put("manager", "Scott"); json.put("department", "Designers"); userDetails.put(json); json = new JSONObject(); json.put("sAMAccountName", "Damien"); json.put("manager", "Scott"); json.put("department", "Designers");json.put("templateName","sampletemplatename");userDetails.put(json);

PRODUCT_NAME Yes Product name/module name from which the request is being sent; will be needed for auditing.
match_ldap_name

Build 7180 and above*

No Specify the search criteria to be picked in case of more than one unique attribute provided in the input format.

The following are the attributes that can be specified along with this parameter:
sAMAccountName, employeeID, userPrincipalName, distinguishedName, cn, name, givenName, sn, displayName, profilePath, scriptPath, employeeNumber, mail, objectSID, and objectGUID.

templateName No Specify the user modification template along with the user accounts to be modified.

If a template is provided, it will apply to all users by default. However, specifying a template name in the inputFormat for a specific user(s) will override the default template for those users.

*The parameter is supported only for the specified build numbers

Response:

The response will be a JSON array string which contains the list of JSONObjects. Each JSONObject in the list represents a user sent in the inputFormat attribute in the request. Each object will contain the following properties about the status.

Parameters Description
status Status of the user modification operation: 'SUCCESS' on successful modification. 'SEVERE' if there is an error.
statusMessage Contains the message about the issues or errors that occur while performing the specified action.
SAM ACCOUNT NAME sAMAccountName of the user account modified.
USER_NAME User name of the user account modified. 

Sample Input / Output

Request 1:

http://admanager:8080/RestAPI/ModifyUser?domainName=admp.local&AuthToken=244f8f17-041d-4c85-9924-02f7351a6fbb&inputFormat=[{"sAMAccountName":"John", "manager":"Scott", "department":"Designers"}, {"sAMAccountName":"Damien", "manager":"Scott", "department":"Designers"}]&PRODUCT_NAME=RESTAPI

Response 1:

[{"USER_NAME":"John","LOG_ON_NAME":"John","statusMessage":"Successfully updated the user.","status":"SUCCESS"},{"USER_NAME":"Damien","LOG_ON_NAME":"Damien","statusMessage":"Successfully updated the user.","status":"SUCCESS"}]

Request 2:

http://admanager:8080/RestAPI/ModifyUser?domainName=division-dc1.local&PRODUCT_NAME=MODULE&match_ldap_name=sAMAccountName&inputFormat=[{"description":"Sales Department Staff", "sAMAccountName":"ByronTest","templateName":"sampletemplatename"}]&AuthToken=73b03d16-c82a-4c5c-ab89-dde5bae2162d

Response 2:

[{"USER_EMAIL":"","SAM Account Name":"Byron","USER_NAME":"Byron","LOG_ON_NAME":"","statusMessage":"Successfully updated the user.","status":"SUCCESS"}]

Authorization:

When technicians send API requests, their authorization will be applied to those requests. That is, if a technician is not authorized to modify a user, the technician cannot modify user accounts using the API either.

Technician-based modify users limit

The total number of user accounts that technicians can modify in a day using the modify user API depends on the total number of licensed help desk technicians (HDTs).

If an API is used to create five AD users, and three of them are successfully created while two fail, it will be considered as three API calls. The maximum number of API calls that an HDT can make is 50/day, irrespective of the tasks that the HDT performs. If you have two HDT licenses, the total number of API calls that you can make is 100/day.

As the per day API call limit is not task-specific, you can perform any operation but the total number of API calls should not exceed 100. That is, an HDTcan perform a variety of operations like user creation, OU creation, password reset, etc., but the number of API calls for all the tasks put together should not exceed 100.

Note:

  • The default admin account will not be considered a HDT.
  • Ensure that you URL encode all the special and reserved characters used in REST API requests. Since the client sending the request (browser, postman or TP tools) does not fall under the purview ADManager Plus, encoding the URL for special, reserved and unsafe characters is solely the users' responsibility.

Reserved characters include ; /? : @ = &
Unsafe characters include < > # % { } | \ ^ ~ [ ] ` "'

ADManager Plus Trusted By

The one-stop solution to Active Directory Management and Reporting
Email Download Link