-
Notifications
You must be signed in to change notification settings - Fork 10
REST: Users and groups management
bugzmanov edited this page Aug 2, 2012
·
14 revisions
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"
}
]
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 |
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
Path: /rest/users/(username)
Type: DELETE
Results:
Success: Deleted user. SeeВ Create user
Failure: SeeВ [Common result object][3]
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
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}]