General Information
...
Service | API | Method |
---|
urac | /admin/editUser | POST |
Data Model: %Link to Data Model%Models: Users, Groups
Workflow: %Link to Architecture Page% Edit User Flow
Input
...
Type: application/json
| 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 | Email Address Format (JSON Schema Validation) |
|
status | Body | YES | String - Enum | 'active', 'inactive' | restricted to either 'active' OR 'inactive' |
groups | Body | NO | Array | Array of Strings | array of group code values |
profile | Body | NO | Object | N/A |
|
password | body | NO | String |
|
|
confirmation | body | NO | String | Same Password Value |
|
pin |
| body | NO |
|
|
|
| code |
| NO | Boolean | set to True to change pin to a random generated code |
|
| allowed |
| NO | Boolean |
|
|
config | Body | NO | Object | N/A |
|
|
Name | Source | Mandatory | Type | Special Format | Description |
---|
keys | Body | NO | Object | N/A | Additional Properties: acl (Object) | packages | Body | NO | Object | N/A |
| allowedTenants | Body | NO | Array |
| array of allowedTenant objects |
Name | Source | Mandatory | Type | Special Format | Description |
---|
tenant | Body | NO | Object |
| Properties: - id (String)
- code (String)
- pin (Object)
- code (Boolean)
- allowed (Boolean)
| groups | Body | NO | Array |
|
|
|
Example of config: Code Block |
---|
language | actionscript3 |
---|
title | config |
---|
| config: {
packages: {},
keys: {},
allowedTenants: [
{"tenant": {
id: "THYME_tID",
code: "THYME_CODE",
pin: {"code": "1235", "allowed": true}
},
groups: ["waiter"]
},
{tenant: {
id: "ELVIRA_tID",
code: "ELVIRA_CODE"
},
groups: ["manager]
}
]
}, |
|
Output
...
Valid Response
Code Block |
---|
language | js |
---|
title | Valid Response Sample |
---|
|
{
"result": true,
"data": {
"..."
}
} |
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 |
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
} |