General Information
...
Service | API | Method |
---|---|---|
urac | /admin/addUser | POST |
Data Model: %Link to Data Model%Models: Users, Tokens
Workflow: %Link to Architecture Page%
...
Name | Source | Mandatory | Type | Special Format | Description |
---|---|---|---|---|---|
tId | Body or Query | YES | String | N/A | the Id of the tenant where this user is added |
tCode | Body or Query | YES | String | N/A | the code of the tenant |
username | Body | YES | String | N/A | alphanumeric with _ , - characters only |
firstName | Body | YES | String | N/A | |
lastName | Body | YES | String | N/A | |
Body | YES | String | N/A | ||
profile | Body | NO | String | N/A | |
groups | Body | NO | Array | N/A | array of group code values |
Output
...
Valid Response
Code Block | ||||
---|---|---|---|---|
| ||||
{ "result": true, "data": { "..." } } |
Invalid Response
Code Block | ||||
---|---|---|---|---|
| ||||
{ "result":false, "errors":{ "codes":[400402], "details":[ { "code":400402, "message":"ProblemUser withaccount the provided passwordalready exists." } ] } } |
Error Codes
Code | Description | 400 | Database Error
---|---|
402 | User account already exists. |
403 | Unable to register user. please try again. |
413 | Invalid profile field provided. Profile should be a stringified object. |
414 | Unable to add user. |
611 | invalid tenant id provided |
Example (CURL)
...
Request
Code Block | ||||
---|---|---|---|---|
| ||||
> 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' |
Response
Code Block | ||||
---|---|---|---|---|
| ||||
{ "result": true, "data": { "_id": "57063608622c47b5c097d19b", "..." }"719b0aed-edd8-47d5-ada0-9e5f93cb8247" } |