General Information
...
Service | API | Method |
---|
urac | /admin/addUser | POST |
Data Models: Users, Tokens
Workflow: %Link to Architecture Page%
...
WorkFlow: Add User Flow
Input
...
Type: application/json
Name |
| Source | Mandatory | Type | Special Format | Description |
---|
tId | Body or Query | YES | String | N/A | the Id of the tenant where this user is addedtCode | Body or Query | YES | String | N/A | the code of the tenant |
username | Body | YES | String | alphanumeric with _ , - characters only |
|
|
firstName | Body | YES | String | N/A |
| N/A | | Email Address Format (JSON Schema Validation) |
|
profile | Body | NO |
Stringa stringified The profile object. |
groups | Body | NO | Array | N/A | array of group code values |
...
|
status | body | NO | String - enum | 'active', 'inactive', 'pendingNew' |
|
password | body | NO | String |
|
|
confirmation | body | NO | String | Value is as same as password |
|
pin |
| body | NO |
|
|
|
| code |
| YES | String |
|
|
| allowed |
| YES | boolean |
|
|
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":[402],
"details":[
{
"code":402,
"message":"User account already exists."
}
]
}
} |
Error Codes
| |
---|
400 | Database connection error |
402 | User account already exists |
.403 | Unable to register user. please try again413Invalid profile field provided. Profile should be a stringified object. | 414 | Unable to add user. |
611 | invalid tenant id provided |
Example (CURL)
...
Request
Code Block |
---|
language | bash |
---|
title | Calling YOUR Add User API |
---|
|
> CURL -X POST http://127.0.0.1:4000/urac/admin/addUser?tId=5551aca9e179c39b760f7a1a&tCode=DBTN -d 'username=john&firstName=John&lastName=Doe&email=johndoe@domain.com' |
...
Code Block |
---|
language | js |
---|
title | YOUR Add User API response |
---|
|
{
"result": true,
"data": {
"id":"57c6eb28962f94a7caab8a22",
"token": "719b0aed-edd8-47d5-ada0-9e5f93cb8247"
}
} |