Direct Inward Dialing: +1 408 916 9393
This API can be used to enable any disabled user account . It can also be used to set the expiry date of user accounts.
Request URL (JSON) format: http://<hostname>:<port>/RestAPI/EnableUser
Request parameters:
Parameter Name | Mandatory | Description |
PRODUCT_NAME | Yes | Product name / module name from which the request is being sent; will be needed for auditing. |
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 name of the user accounts. |
inputFormat | Yes | Details of each user account to be enabled. This attribute should be a JSONArray string and must be in format mentioned below. [<JSONObject>, <JSONObject>, <JSONObject>]; JSONObject - The key/value pair of LDAP attributes and the values. Sample code in java: JSONArray userDetails = new JSONArray(); JSONObject json = new JSONObject(); json.put("sAMAccountName", "John"); userDetails.put(json); json = new JSONObject(); json.put("sAMAccountName", "Mat"); userDetails.put(json); NOTE: You can specify any of the following attributes as search criteria to locate user objects using REST API requests:
|
accountExpires Build 6657 and above* |
No | If you do not want to set an account expiry date, specify the value of the accountExpires parameter as Never. Otherwise use EndOf if you want to set the account expiry date. |
expireTime Build 6657 and above* |
No | This parameter is mandatory only if End Of option is specified for the accountExpires parameter. The expireTime must be set in the MM-dd-yyyy format. |
duration* Build 7180 and above* |
No | The time period after which the user accounts must be disabled. |
durationType* Build 7180 and above* |
No | Specify a custom date or specify the duration in terms of minutes, hours, or, 'n' number of days. |
*The parameter is supported only for the specified build numbers
*When the duration and durationType parameters are specified in an API call, a workflow request is automatically created to enable users. However, only help desk technicians configured as requesters can raise a workflow request in ADManager Plus. Thus, ensure that you have the appropriate permissions before using these parameters, or simply send an API call without specifying these parameters to enable users.
Response:
The response will be a JSONArray string which contains the list of JSONObjects. Each JSONObject in the list represents a user account sent in the inputFormat parameter in the request. Each object will contain the following properties.
Parameter Name | Description |
userPrincipalName | userPrincipalName of the user. |
sAMAccountName | sAMAccountName of the user. |
objectSID | objectSID of the user |
statusMessage | Contains the appropriate message if an issue/error occurs while processing the request. |
Sample Input / Output
Request 1:
http://Byron:8080/RestAPI/EnableUser?AuthToken=a70d9e6c-4167-4de4-a6a1-3b3aff50c82&PRODUCT_NAME=MODULE_NAME&domainName=admanagerplus.com&inputFormat=[{"sAMAccountName":"colin.altonen"}]&accountExpires=Never
Response 1:
[{"userPrincipalName":"colin.altonen@admanagerplus.com","sAMAccountName":"colin.altone n","objectSID":"S-1-5-21-2996321955-1937665885-1535019402-3881","statusMessage":"Successfully modified."}]
Request 2:
http://Byron:8080/RestAPI/DisableUser?AuthToken=a70d9e6c-4167-4de4-a6a1-3b3aff50c82&PRODUCT_NAME=MODULE_NAME&domainName=admanagerplus.com&inputFormat=[{"sAMAccountName":"colin.altonen"}]&accountExpires=EndOf&expireTime=12-21-2018
Request 3:
http://Byron:8080/RestAPI/EnableUser?AuthToken=73b03d16-c82a-4c5c-ab89-dde5bae2162d&PRODUCT_NAME=MODULE_NAME&domainName=admpdev.com&inputFormat=[{"sAMAccountName":"Byron"}]&duration=1&durationType=days
Response 2:
[{"sAMAccountName":"Byron","statusMessage":"Successfully Modified.","status":"1"}]
Technician-based enable users limit
The total number of user accounts that technicians can enable in a day using the enable user API depends on the total number of licensed help desk technicians (HDTs) in ADManager Plus.
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 an HDT can make is 50/day, irrespective of the tasks 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:
Reserved characters include ; / ? : @ = &
Unsafe characters include < > # % { } | \ ^ ~ [ ] ` "'
Escape characters include /, ' ' and " "