Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

General Information

...

ServiceAPIMethod
urac/admin/addUserPOST


Data Model: %Link to Data Model%Models: UsersTokens

Workflow: %Link to Architecture Page%

...

NameSourceMandatoryTypeSpecial FormatDescription
tIdBody or QueryYESStringN/Athe Id of the tenant where this user is added
tCodeBody or QueryYESStringN/Athe code of the tenant
usernameBodyYESStringN/Aalphanumeric with _ , - characters only
firstNameBodyYESStringN/A 
lastNameBodyYESStringN/A 
emailBodyYESStringN/A 
profileBodyNOStringN/A 
groupsBodyNOArrayN/Aarray of group code values

 

Output

...

Valid Response

Code Block
languagejs
titleValid Response Sample
{
	"result": true,
	"data": {
		"..."	
	}
}

 

Invalid Response

Code Block
languagejs
titleError Response Sample
{
    "result":false,
    "errors":{
        "codes":[400402],
        "details":[
            {
                "code":400402,
                "message":"ProblemUser withaccount the provided passwordalready exists."
            }
        ]
    }
}



Error Codes


 

Database Error
Code
Description
400
402User account already exists.
403Unable to register user. please try again.
413Invalid profile field provided. Profile should be a stringified object.
414Unable to add user.
611invalid tenant id provided


Example (CURL)

...

Request

Code Block
languagebash
titleCalling YOUR 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'

Response

Code Block
languagejs
titleYOUR API response
{
	"result": true,
	"data": {
		"_id": "57063608622c47b5c097d19b",
		"..."
	}"719b0aed-edd8-47d5-ada0-9e5f93cb8247"
}