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

Delete user

Path: /rest/users/(username)

Type: DELETE

Results:

Success: Deleted user. SeeВ Create user

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"]
}

Success

See В Create user

Error

**
**SeeВ Common result object

Genesis internal user group management

List groups

Path:В /rest/groups

**Type:В **GET

Example response:

[{"name":"group-1", "description":"group-1 description", "mailingList":"[email protected]", "id":1}, {"name":"group-2", "description":"group-2 description", "mailingList":"[email protected]", "id":2}]

Clone this wiki locally