Modifying a User
Administrators can use this API to modify a user existing in eG Enterprise.
URL: http://<eG manager IP:port>/api/eg/orchestration/modifyuser
Method: POST
Content-Type: application/json
Parameters | Key values | Example |
---|---|---|
Headers |
managerurl: Base URL of the eG Manager i.e., http://<IP address of the eG console:Port> user: eG username or domain/eG username pwd: Base64 encoded password |
Example: { "userid":"john", "userrole":"AlarmViewer", "password":"******", "org_or_ou":"Org H", "expirydate":"12/12/2024", "alarmsbymail":"saran1@eginnovations.com, "cc":"saranya@eginnovations.com, "bcc":"sample@eginnovations.com" } |
Body |
Default: { "userid":"User ID" } |
|
Optional: { "userrole":"User role", "password":"Password", "org_or_ou":"Name of the Organization/Organizational Unit", "expirydate":"MM/dd/yyyy", "alarmsbymail":"Critical/Major/Minor/ "to":"comma-separated list of Mail IDs/Mobile numbers", "cc":"comma-separated list of Mail IDs/Mobile numbers", "bcc":"comma-separated list of Mail IDs/Mobile numbers" } |
Type | Code | Content |
---|---|---|
JSON |
200 |
{ "Succeed": "User has been modified successfully." } |
Type | Code | Content |
---|---|---|
JSON |
401 UNAUTHORIZED |
{ "Error": "User ID does not exist." } |
Figure 1 : Example to modify a user using Postman REST Client
Modifying a User using cURL
To modify a user through the REST API using cURL, the command should be specified in the following format:
curl --location --request POST "http://<eG Manager IP:Port>/api/eg/orchestration/modifyuser" -H "managerurl:http://<eG Manager IP:Port>" -H "user:<eG username or domain/eG username>" -H "pwd:Base64 encoded password" -H "Content-Type: application/json" --data-raw "{'userid':'User ID', 'userrole':'User role', 'password':'Password', 'org_or_ou':'Name of the Organization/Organizational Unit', 'expirydate':'MM/dd/yyyy', 'alarmsbymail':'Critical/Major/Minor/All', 'to':'comma-separated list of Mail IDs/Mobile numbers', 'cc':'comma-separated list of Mail IDs/Mobile numbers', 'bcc':'comma-separated list of Mail IDs/Mobile numbers'}"
Note that the command specified above contains both the Default and Optional key values. Figure 2 shows an example of modifying a user using cURL.