Manage users
Get a list of users
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| code | condition |
|---|---|
| 200 | Success. |
| media type | data type | description |
|---|---|---|
| application/json | UsersList (JSON) | list of users |
GET /users
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
{
"users" : [ {
"userName" : "...",
"homeVersion" : 12345
}, {
"userName" : "...",
"homeVersion" : 12345
} ]
}
Create a new user
Only users with Infrastructure-Manager role allowed
| name | type | description |
|---|---|---|
| password | form | user password |
| user | form | user name |
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| media type | data type |
|---|---|
| application/x-www-form-urlencoded | (custom) |
| code | condition |
|---|---|
| 200 | User created. |
| 400 | Wrong set of parameters. |
| 403 | You're not allowed to create users. |
| 415 | Wrong content type. |
| media type | data type | description |
|---|---|---|
| text/plain | string | user name |
POST /users
Content-Type: application/x-www-form-urlencoded
Accept: text/plain
Authorization: ...
user=nome.utente&password=passw0rd
...
HTTP/1.1 200 OK
Content-Type: text/plain
...
Delete a user
Only users with Infrastructure-Manager role allowed
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| user | path | user name |
| code | condition |
|---|---|
| 200 | User deleted. |
| 403 | You're not allowed to delete users. |
| 406 | User does not exist. |
| media type | data type | description |
|---|---|---|
| text/plain | string | user name |
DELETE /users/{user}
Content-Type: */*
Accept: text/plain
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: text/plain
...
Get user details
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| user | path | user name |
| code | condition |
|---|---|
| 200 | User found. |
| 406 | User does not exist. |
| media type | data type | description |
|---|---|---|
| application/json | SHUBUser (JSON) | user detail |
GET /users/{user}
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
{
"userName" : "...",
"homeVersion" : 12345
}
Update user to the last 'home' version
Only users with Infrastructure-Manager role allowed
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| user | path | user name |
| media type | data type |
|---|---|
| application/x-www-form-urlencoded | (custom) |
| code | condition |
|---|---|
| 200 | Home update done. |
| 403 | You're not allowed to create users. |
| 415 | Wrong content type. |
| media type | data type | description |
|---|---|---|
| application/json | string (JSON) | user id |
PUT /users/{user}
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
...
Get a list of groups for the specified user
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| user | path | user name |
| code | condition |
|---|---|
| 200 | User found. |
| 500 | User does not exist. |
| media type | data type | description |
|---|---|---|
| application/json | array of string (JSON) | List of groups |
GET /users/{user}/groups
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
...