Skip to content

REST: Users and groups management

bugzmanov edited this page Aug 2, 2012 · 14 revisions

Genesis internal user management

List users

Path: /rest/users

Type: GET

Example response:

    [
        {
           "username": "john",
           "email": "[email protected]",
           "firstName": "John",
           "lastName": "Doe",
           "jobTitle": "Developer"
        },
        {
           "username": "jane",
           "email": "[email protected]",
           "firstName": "Jane",
           "lastName": "Doe",
           "jobTitle": "Jane Doe"
        }
    ]

Create user

Path: /rest/users

Type: POST

Input data:

{
    "username": "jane",
    "email": "[email protected]",
    "firstName": "Jane",
    "lastName": "Doe",
    "jobTitle": "Jane Doe",
    "password": "qwerty",
    "groups": ["group1", "group2"]
}
Entry name Type Mandatory Description
username String Y User name
email String Y User email
firstName String Y User first name
lastName String Y User last name
jobTitle String N User job title
password String Y User password
groups Array of string N List of existing groups to assign to a user

Example response

Success

{ "result": { "username":"jane1", "email":"[email protected]", "firstName":"Jane", "lastName":"Doe", "jobTitle":"Jane Doe" }, "isSuccess":true }

В

Error

**
**SeeВ [Common result object][1]

В

Delete user

Path: /rest/users/{username}

Type: DELETE

Results:

**Success:В **Deleted user. SeeВ [Create user][2]

Failure: SeeВ [Common result object][3]

Update user

Path:В /rest/users/{username}

Type:В PUT

Input data:

{ "email": "[email protected]", "firstName": "Jane", "lastName": "Doe", "jobTitle": "Jane Doe", "groups": ["group1", "group2"] }

Clone this wiki locally