Summary:
List information about users. Note, from Entuity v21.0 upwards, you can also manage user lists in config sets (see Config Sets - Users).
URL:
http(s)://{server hostname}/api/users
Methods summary
- GET Method - lists available users.
- POST Method - creates a new user.
GET Method detail
The list of users returned is restricted for non-administrators: only the user object corresponding to the current user is returned.
Response:
Response includes a list of users. Each user has following attributes.
Name | Description |
---|---|
id | user id unique to the server. |
name | user name. |
serverId | Entuity server Id on which resource resides. |
Examples:
INPUT
curl -u admin:admin https://localhost/api/users?media=json
OUTPUT
{
"items": [ {
"serverId": "ee934fe2-1f4d-4f1e-a0b5-a87b261eb30a",
"id": "3",
"name": "admin"
} ],
"count": 1
}
INPUT
curl -u admin:admin https://localhost/api/users?media=xml
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<items count="1">
<item xsi:type="namedItem" name="admin" id="3" serverId="ee934fe2-1f4d-4f1e-a0b5-a87b261eb30a" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"/>
</items>
POST Method detail
Creates a new user.
Request:
Name | Description |
---|---|
name | username. |
password | user password. |
Response:
The list of users after an update, as GET method would return them.
Example:
INPUT
curl -u admin:admin https://localhost/api/users?media=json -X POST -H "content-type:application/json" -d \
'{
"name" : "John",
"password" : "little"
}'
OUTPUT
{
"items": [ {
"serverId": "ee934fe2-1f4d-4f1e-a0b5-a87b261eb30a",
"id": "6",
"name": "John"
}, {
"serverId": "ee934fe2-1f4d-4f1e-a0b5-a87b261eb30a",
"id": "3",
"name": "admin"
} ],
"count": 2
}
INPUT
curl -u admin:admin https://localhost/api/users?media=xml -X POST -H "content-type:application/xml" -d \
'<userPasswordWrapper>
<name>John</name>
<password>little</password>
</userPasswordWrapper>'
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<items count="2">
<item xsi:type="namedItem" name="John" id="6" serverId="ee934fe2-1f4d-4f1e-a0b5-a87b261eb30a" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"/>
<item xsi:type="namedItem" name="admin" id="3" serverId="ee934fe2-1f4d-4f1e-a0b5-a87b261eb30a" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"/>
</items>
Comments
0 comments
Please sign in to leave a comment.