Share Access Rights Admin API
List Share Accesses
Info | Value |
---|---|
Request URL | /admin/shares/:share_id/accesses /admin/shares/:share_id/accesses/users /admin/shares/:share_id/accesses/groups |
Request VERB | GET |
With the Paths above, if you use /admin/shares/:share_id/accesses it will list both users and groups. If you use /admin/shares/:share_id/accesses/users or /admin/shares/:share_id/accesses/groups, it will only list the users or groups respectively that have access to this share.
Parameter | Type | Description |
---|---|---|
type | String | user or group depending if this access type is for a user or a group. |
user_id/group_id | String | The unique User or Group ID. |
access | String | write if the user/group has write access read if the user/group has read-only access |
view_log | Boolean | The resulting view_log result if success. |
Example Request Using Curl
cat <<EOF | curl -X POST -H "Accept: application/json" \
--user nkpIxMK9ucUUE7FvfNpdAf:x \
https://liquidfiles.company.com/admin/shares/project-alpha/accesses
{"accesses":
[
{
"type": "group",
"group_id": "admins",
"access": "write",
"view_log": true
},
{
"type": "user",
"user_id": "user-company-com",
"access": "read",
"view_log": true
}
]
}
EOF
Create Share Access
Request
Info | Value |
---|---|
Request URL | /admin/shares/:share_id/accesses/users /admin/shares/:share_id/accesses/groups |
Request VERB | POST |
Parameter | Type | Description |
---|---|---|
id | String | The User ID or Group ID that should be given access. |
access | String | write if the user or group should have write access, read if the user or group should have read-only access. If not specified, it will default to false. |
view_log | Boolean | True if the user or group should be able to view the share log. If not specified, it will default to false. |
The response will use the same response parameters that's listed in the List action above.
Example Request Using Curl
cat <<EOF | curl -X POST -d @- -H "Accept: application/json" \
-H "Content-Type: application/json" \
--user nkpIxMK9ucUUE7FvfNpdAf:x \
https://liquidfiles.company.com/admin/shares/project-alpha/accesses/users
{"user":
{
"id": "user-company-com",
"access": "write",
"view_log": true
}
}
EOF
or creating share access for a group. Please note groups in the end of the URL as well as group in the first JSON statement as different from the users/user above.
cat <<EOF | curl -X POST -d @- -H "Accept: application/json" \
-H "Content-Type: application/json" \
--user nkpIxMK9ucUUE7FvfNpdAf:x \
https://liquidfiles.company.com/admin/shares/project-alpha/accesses/groups
{"group":
{
"id": "local-users",
"access": "write",
"view_log": true
}
}
EOF
You can also use a shorter curl format:
curl -X POST -H "Accept: application/json" \
-H "Content-Type: application/json" \
--user nkpIxMK9ucUUE7FvfNpdAf:x \
-d '{"group":{"id":"admins", "access": "write", "view_log":true}}' \
https://test.host/admin/shares/project-alpha/accesses/group
Example Response
The response will list the Share Access that was created.
{"accesses":
{
"type": "group",
"group_id": "admins",
"access": "write",
"view_log": true
}
}
Update Share Access
Request
Info | Value |
---|---|
Request URL | /admin/shares/:share_id/accesses/users /admin/shares/:share_id/accesses/groups |
Request VERB | PUT |
Parameter | Type | Description |
---|---|---|
id | String | The User ID or Group ID that should be given access. |
access | String | write if the user or group should have write access, read if the user or group should have read-only access. If not specified, it will default to false. |
view_log | Boolean | True if the user or group should be able to view the share log. If not specified, it will default to false. |
The response will use the same response parameters that's listed in the List action above.
Example Request Using Curl
cat <<EOF | curl -X POST -d @- -H "Accept: application/json" \
-H "Content-Type: application/json" \
--user nkpIxMK9ucUUE7FvfNpdAf:x \
https://liquidfiles.company.com/admin/shares/project-alpha/accesses/users/user-company-com
{"user":
{
"access": "write",
"view_log": true
}
}
EOF
Update group example.
cat <<EOF | curl -X POST -d @- -H "Accept: application/json" \
-H "Content-Type: application/json" \
--user nkpIxMK9ucUUE7FvfNpdAf:x \
https://liquidfiles.company.com/admin/shares/project-alpha/accesses/groups/local-users
{"group":
{
"access": "write",
"view_log": true
}
}
EOF
Remove Share Access
Request
Info | Value |
---|---|
Request URL | /admin/shares/:share_id/accesses/users /admin/shares/:share_id/accesses/groups |
Request VERB | DELETE |
Parameter | Type | Description |
---|---|---|
id | String | The unique User or Group ID. |
Example Request Using Curl
curl -X DELETE -H "Accept: application/json" \
--user nkpIxMK9ucUUE7FvfNpdAf:x \
https://liquidfiles.company.com/admin/shares/project-alpha/accesses/users/user-company-com
Remove a group example.
curl -X DELETE -H "Accept: application/json" \
--user nkpIxMK9ucUUE7FvfNpdAf:x \
https://liquidfiles.company.com/admin/shares/project-alpha/accesses/groups/local-users