Add user to space
Adds user {uid} as member of space {id}. Optional privileges can be passed in the request body, otherwise default privileges will be set for the user in this space.
This operation can only be invoked by the user {uid} to add himself to the
space (if he is not a member already) and requires space_add_user
privilege in the space. If privileges are specified in the request,
space_set_privileges privilege is also required.
Administrators having the oz_spaces_add_relationships and
oz_users_add_relationships admin privileges can add any user to any space,
though oz_spaces_set_privileges privilege is required if privileges are
specified in the request.
Example cURL requests
Add user to space
curl -u username:password -H "Content-type: application/json" -X PUT \
https://$HOST/api/v3/onezone/spaces/$SPACE_ID/users/$USER_ID
Path parameters
| Parameter | Type & Description |
|---|---|
| id required | string Space Id. |
| uid required | string User Id. |
Request body
| Property | Type & Description |
|---|---|
privileges array of strings A list of privileges in the space. | |
Request Examples
onezone-rest-cli addSpaceUser id=b752ceafabb662b4e5728b2ded25cdd1 uid=a5b469a2b0516b662a49da74d6d7d7bcResponses
The user was added to the space.
Invalid request.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authentication error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authorization error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Resource not found.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Internal server Error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}