seafile-web-api-2.1

Department Libraries

The department library is also called group owned library.

Add Group Owned Library

POST http://192.168.1.113:8000/api/v2.1/groups/{group_id}/group-owned-libraries/

Request parameters

Sample request

curl -d "repo_name=group-owned-repo-4&permission=r" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "http://192.168.1.113:8000/api/v2.1/groups/53/group-owned-libraries/"

sample response

{
    "repo_id": "9bc59af9-265e-4110-a0e2-619450a5cb35",
    "permission": "r",
    "encrypted": false,
    "owner_email": "53@seafile_group",
    "mtime": "2018-04-23T17:25:37+08:00",
    "repo_name": "group-owned-repo-4",
    "size": 0
}

Errors

Delete Group Owned Library

DELETE http://192.168.1.113:8000/api/v2.1/groups/{group_id}/group-owned-libraries/{repo_id}/

Request parameters

Sample request

curl -X DELETE -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "http://192.168.1.113:8000/api/v2.1/groups/53/group-owned-libraries/9bc59af9-265e-4110-a0e2-619450a5cb35/"

sample response

{"success":true}

Errors

Get Group Owned Library User Share Info

GET http://192.168.1.113:8000/api/v2.1/group-owned-libraries/{repo_id}/user-share/

Request parameters

Sample request

curl -H 'Authorization: Token 5eba8c2f983404e33b140b13a1d050b9a4440e03' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/group-owned-libraries/4902dcc7-29be-4020-81e9-4e512f97db1e/user-share/"

sample response

[
    {
        "permission": "rw",
        "user_name": "1",
        "user_email": "1@1.com",
        "user_contact_email": "1@1.com"
    },
    {
        "permission": "rw",
        "user_name": "1",
        "user_email": "1@111.com",
        "user_contact_email": "1@111.com"
    },
    {
        "permission": "rw",
        "user_name": "10",
        "user_email": "10@10.com",
        "user_contact_email": "10@10.com"
    }
]

Errors

Share Group Owned Library to User

POST http://192.168.1.113:8000/api/v2.1/group-owned-libraries/{repo_id}/user-share/

Request parameters

Sample request

curl -d "permission=r&username=1@1.com&username=2@1.com" -H 'Authorization: Token 5eba8c2f983404e33b140b13a1d050b9a4440e03' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/group-owned-libraries/4902dcc7-29be-4020-81e9-4e512f97db1e/user-share/"

sample response

{
    "failed": [
        {
            "email": "2@1.com",
            "error_msg": "User 2@1.com not found."
        }
    ],
    "success": [
        {
            "permission": "r",
            "user_name": "1",
            "user_email": "1@1.com",
            "user_contact_email": "1@1.com"
        }
    ]
}

Errors

Modify Group Owned Library User Share Permission

PUT http://192.168.1.113:8000/api/v2.1/group-owned-libraries/{repo_id}/user-share/

Request parameters

Sample request

curl -X PUT -d "permission=rw&username=1@1.com" -H 'Authorization: Token 5eba8c2f983404e33b140b13a1d050b9a4440e03' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/group-owned-libraries/4902dcc7-29be-4020-81e9-4e512f97db1e/user-share/"

sample response

{
    "success": true
}

Errors

Delete Group Owned Library User Share

DELETE http://192.168.1.113:8000/api/v2.1/group-owned-libraries/{repo_id}/user-share/

Request parameters

Sample request

curl -X DELETE -d "username=1@1.com" -H 'Authorization: Token 5eba8c2f983404e33b140b13a1d050b9a4440e03' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/group-owned-libraries/4902dcc7-29be-4020-81e9-4e512f97db1e/user-share/"

sample response

{
    "success": true
}

Errors

Get Group Owned Library Group Share Info

GET http://192.168.1.113:8000/api/v2.1/group-owned-libraries/{repo_id}/group-share/

Request parameters

Sample request

curl -H 'Authorization: Token 5eba8c2f983404e33b140b13a1d050b9a4440e03' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/group-owned-libraries/4902dcc7-29be-4020-81e9-4e512f97db1e/group-share/"

sample response

[
    {
        "permission": "r",
        "group_id": 71,
        "group_name": "asd"
    },
    {
        "permission": "r",
        "group_id": 70,
        "group_name": "group-of-lian"
    }
]

Errors

Share Group Owned Library to Group

POST http://192.168.1.113:8000/api/v2.1/group-owned-libraries/{repo_id}/group-share/

Request parameters

Sample request

curl -d "permission=r&group_id=89&group_id=71&group_id=70" -H 'Authorization: Token 5eba8c2f983404e33b140b13a1d050b9a4440e03' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/group-owned-libraries/4902dcc7-29be-4020-81e9-4e512f97db1e/group-share/"

sample response

{
    "failed": [
        {
            "error_msg": "Group 89 not found"
        },
        {
            "error_msg": "This item has been shared to asd.",
            "group_name": "asd"
        }
    ],
    "success": [
        {
            "permission": "r",
            "group_id": 70,
            "group_name": "group-of-lian"
        }
    ]
}

Errors

Modify Group Owned Library Group Share Permission

PUT http://192.168.1.113:8000/api/v2.1/group-owned-libraries/{repo_id}/group-share/

Request parameters

Sample request

curl -X PUT -d "permission=rw&group_id=70" -H 'Authorization: Token 5eba8c2f983404e33b140b13a1d050b9a4440e03' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/group-owned-libraries/4902dcc7-29be-4020-81e9-4e512f97db1e/group-share/"

sample response

{
    "success": true
}

Errors

Delete Group Owned Library Group Share

DELETE http://192.168.1.113:8000/api/v2.1/group-owned-libraries/{repo_id}/group-share/

Request parameters

Sample request

curl -X DELETE -d "group_id=71" -H 'Authorization: Token 5eba8c2f983404e33b140b13a1d050b9a4440e03' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/group-owned-libraries/4902dcc7-29be-4020-81e9-4e512f97db1e/group-share/"

sample response

{
    "success": true
}

Errors

Modify Group Owned Library Sub-Folder Permission

PUT http://192.168.1.113:8000/api/v2.1/groups/{group_id}/group-owned-libraries/{repo_id}/

Request parameters

Sample request

curl -X PUT -d "path=/tmp/&permission=r" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "http://192.168.1.113:8000/api/v2.1/groups/53/group-owned-libraries/9bc59af9-265e-4110-a0e2-619450a5cb35/"

sample response

{"success":true}

Errors