Versions Compared

Key

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

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

General Information

...

ServiceAPIMethodData ModelsWorkflow
urac/admin/editUseruserPUT

...

...

Description

This API updates a user record that matches the id sent in the query.

Input

...

Type: application/json
passwordbody

Example of config:


NameSourceMandatoryTypeSpecial FormatDescription
uIdidQueryBodyYESStringN/AUser ID
usernameBodyYESNOStringalphanumeric with _ , - characters onlyUsername
firstNameBodyYESNOStringN/AFirst Name
lastNameBodyYESNOStringN/ALast Name
emailBodyYESNOStringEmail Address Format (JSON Schema Validation)Email
statusBodyYESNOString - Enum

'active',

'inactive' , 'pendingNew'

restricted to either 'active' OR , 'inactive', or 'pendingNew'
groupsBodyNOArrayArray of Stringsarray of group code values
profileBodyNOObjectN/AProfilebodyNOStringconfirmation
lnBodyNOStringSame Password ValuepinbodyNOcodeNOBooleanset to True to change pin to a random generated code allowedNOBooleanconfigBodyNOObjectN/A
NameSourceMandatoryTypeSpecial FormatDescription
keysBodyNOObjectN/AAdditional Properties: acl (Object) 
packagesBodyNOObjectN/AallowedTenantsBodyNOArrayarray of allowedTenant objects
NameSourceMandatoryTypeSpecial FormatDescription
tenantBodyNOObject

Properties:

  • id (String)
  • code (String)
  • pin (Object)
    • code (Boolean)
    • allowed (Boolean)
groupsBodyNOArray
Code Block
languageactionscript3
titleconfig
 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


language
phoneBodyNOString
Phone number 


Output

...

Response

SOAJS has a unified response. Check out this link to understand more the schema of SOAJS response 

Valid Response

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


Invalid Response

Code Block
languagejs
titleError Response Sample
linenumberstrue
collapsetrue
{
    "result":false,
    "errors":{
        "codes":[405602],
        "details":[
            {
                "code":405602,
                "message":"UnableModel toerror: find User. Please try again.+ %model_error%"
            }
        ]
    }
}

Response schema

Follow this link to check out the response JSON Schema

SOAJS Error Codes



Code
Description
405Unable to find User. Please try again.407Problem validating Request. Please try again.410username taken, please choose another username411invalid user id provided415Unable to find group.500This record in locked. You cannot modify or delete it

Example (CURL)

Request

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

...

languagejs
titleEdit User API response

...

400

Business logic required data are missing

602Model error: + %model_error%