Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Image Removed

...

On This Page

Table of Contents

Overview

This feature will allow the user to remove permissions from either the source or destination via the REST API. To do this, we can use the following DELETE calls to remove all, or some of the permissions as desired. This can be applied to both files and folders.

Files

This will delete all permissions on the specified file path as specified by the ID. No body is needed for this request.

Code Block
DELETE /connections/{connection}/files/{id}/permissions/all

This will delete all permissions as specified by the file path (no ID as the call above). No body is needed for this request.

Code Block
DELETE /connections/{connection}/files/permissions/all?path={filePath}

This will delete permissions to a specified file path. Also requires request body.

Code Block
DELETE /connections/{connection}/files/permissions?path={filePath}

This will delete permissions to a specified file path. In order to successfully remove permissions, we need to provide a body that lists the desired permissions to be removed. This can be one or many. To obtain, you may change the DELETE above to GET, and copy/paste the response from there. Example request body below:

Request Body

Code Block
[
    {
        "sid": {
            "name": "TestUser02",
            "email": "Tuser02@company.onmicrosoft.com",
            "username": "Tuser02@company.onmicrosoft.com",
            "id": "75",
            "external_id": "i:0#.f|membership|Tuser02@company.onmicrosoft.com",
            "type": "account",
            "principal_type": 1
        },
        "rights": [
            "read_write"
        ]
    }
]

Folders

Removing permissions from Folders is much the same as Files above. Those with /all do not require bodies. Calls pointing to a specific folder do, and follow the same pattern as Files.

This will delete all permissions on the specified file path as specified by the ID. No body is needed for this request.

Code Block
DELETE /connections/{connection}/folders/{id}/permissions/all

This will delete all permissions as specified by the folder path (no ID as the call above). No body is needed for this request.

Code Block
DELETE /connections/{connection}/folders/permissions/all?path={folderPath}

This will delete permissions to a specified folder path.

Code Block
DELETE /connections/{connection}/folders/permissions?path={folderPath}

In order to successfully remove permissions, we need to provide a body that lists the desired permissions to be removed. See the above Files call for instruction on how to obtain this information.