...
Service | API | Method |
---|
urac | /admin/editUser | POST |
Data Model: %Link to Data Model%Models: Users, Groups
Workflow: %Link to Architecture Page%
Input
...
| Name | Source | Mandatory | Type | Special Format | Description |
---|
uId | Query | YES | String | N/A | |
username | Body | YES | String | alphanumeric with _ , - characters only | |
firstName | Body | YES | String | N/A | |
lastName | Body | YES | String | N/A | |
email | Body | YES | String | N/A | |
status | Body | YES | String | N/A | restricted to either 'active' OR 'inactive' |
groups | Body | NO | Array | N/A | array of group code values |
config | Body | NO | Object | N/A | |
| | Name | Source | Mandatory | Type | Special Format | Description |
---|
keys | Body | NO | Object | N/A | | packages | Body | NO | Object | N/A | |
|
Output
...
Valid Response
Code Block |
---|
language | js |
---|
title | Valid Response Sample |
---|
|
{
"result": true,
"data": {
"..."
}true
} |
Invalid Response
Code Block |
---|
language | js |
---|
title | Error Response Sample |
---|
|
{
"result":false,
"errors":{
"codes":[400405],
"details":[
{
"code":400405,
"message":"Problem with the provided passwordUnable to find User. Please try again."
}
]
}
} |
Error Codes
| |
---|
400 | Database Error |
---|
405 | Unable to find User. Please try again. |
407 | Problem validating Request. Please try again. |
410 | username taken, please choose another username |
411 | invalid user id provided |
413 | Invalid profile field provided. Profile should be a stringified object. |
415 | Unable to find group. |
500 | This record in locked. You cannot modify or delete it |
Example (CURL)
...
Request
Code Block |
---|
language | bash |
---|
title | Calling YOUR Edit User API |
---|
|
> CURL -X POST http://127.0.0.1:4000/urac/admin/...editUser?uId=123 -d 'username=john&firstName=John&lastName=Doe&email=johndoe@domain.com&status=active' |
Response
Code Block |
---|
language | js |
---|
title | YOUR Edit User API response |
---|
|
{
"result": true,
"data": {
"_id": "57063608622c47b5c097d19b",
"..."
}true
} |