SharingRoutes

public class SharingRoutes : DropboxTransportClientOwning

Routes for the sharing namespace For Objective-C compatible routes see DBSharingRoutes

  • Adds specified members to a file.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func addFileMember(
        file: String,
        members: [Sharing.MemberSelector],
        customMessage: String? = nil,
        quiet: Bool = false,
        accessLevel: Sharing.AccessLevel = .viewer,
        addMessageAsComment: Bool = false
    ) -> RpcRequest<ArraySerializer<Sharing.FileMemberActionResultSerializer>, Sharing.AddFileMemberErrorSerializer>

    Parameters

    file

    File to which to add members.

    members

    Members to add. Note that even an email address is given, this may result in a user being directly added to the membership if that email is the user’s main account email.

    customMessage

    Message to send to added members in their invitation.

    quiet

    Whether added members should be notified via email and device notifications of their invitation.

    accessLevel

    AccessLevel union object, describing what access level we want to give new members.

    addMessageAsComment

    If the custom message should be added as a comment on the file.

    Return Value

    Through the response callback, the caller will receive a Array<Sharing.FileMemberActionResult> object on success or a Sharing.AddFileMemberError object on failure.

  • Allows an owner or editor (if the ACL update policy allows) of a shared folder to add another member. For the new member to get access to all the functionality for this folder, you will need to call mountFolder on their behalf.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func addFolderMember(
        sharedFolderId: String,
        members: [Sharing.AddMember],
        quiet: Bool = false,
        customMessage: String? = nil
    ) -> RpcRequest<VoidSerializer, Sharing.AddFolderMemberErrorSerializer>

    Parameters

    sharedFolderId

    The ID for the shared folder.

    members

    The intended list of members to add. Added members will receive invites to join the shared folder.

    quiet

    Whether added members should be notified via email and device notifications of their invite.

    customMessage

    Optional message to display to added members in their invitation.

    Return Value

    Through the response callback, the caller will receive a Void object on success or a Sharing.AddFolderMemberError object on failure.

  • Returns the status of an asynchronous job.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func checkJobStatus(asyncJobId: String) -> RpcRequest<Sharing.JobStatusSerializer, Async.PollErrorSerializer>

    Parameters

    asyncJobId

    Id of the asynchronous job. This is the value of a response returned from the method that launched the job.

    Return Value

    Through the response callback, the caller will receive a Sharing.JobStatus object on success or a Async.PollError object on failure.

  • Returns the status of an asynchronous job for sharing a folder.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func checkRemoveMemberJobStatus(asyncJobId: String)
        -> RpcRequest<Sharing.RemoveMemberJobStatusSerializer, Async.PollErrorSerializer>

    Parameters

    asyncJobId

    Id of the asynchronous job. This is the value of a response returned from the method that launched the job.

    Return Value

    Through the response callback, the caller will receive a Sharing.RemoveMemberJobStatus object on success or a Async.PollError object on failure.

  • Returns the status of an asynchronous job for sharing a folder.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func checkShareJobStatus(asyncJobId: String) -> RpcRequest<Sharing.ShareFolderJobStatusSerializer, Async.PollErrorSerializer>

    Parameters

    asyncJobId

    Id of the asynchronous job. This is the value of a response returned from the method that launched the job.

    Return Value

    Through the response callback, the caller will receive a Sharing.ShareFolderJobStatus object on success or a Async.PollError object on failure.

  • Create a shared link with custom settings. If no settings are given then the default visibility is public_ in RequestedVisibility (The resolved visibility, though, may depend on other aspects such as team and shared folder settings).

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func createSharedLinkWithSettings(
        path: String,
        settings: Sharing.SharedLinkSettings? = nil
    ) -> RpcRequest<Sharing.SharedLinkMetadataSerializer, Sharing.CreateSharedLinkWithSettingsErrorSerializer>

    Parameters

    path

    The path to be shared by the shared link.

    settings

    The requested settings for the newly created shared link.

    Return Value

    Through the response callback, the caller will receive a Sharing.SharedLinkMetadata object on success or a Sharing.CreateSharedLinkWithSettingsError object on failure.

  • Returns shared file metadata.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func getFileMetadata(
        file: String,
        actions: [Sharing.FileAction]? = nil
    ) -> RpcRequest<Sharing.SharedFileMetadataSerializer, Sharing.GetFileMetadataErrorSerializer>

    Parameters

    file

    The file to query.

    actions

    A list of FileActions corresponding to FilePermissions that should appear in the response’s permissions in SharedFileMetadata field describing the actions the authenticated user can perform on the file.

    Return Value

    Through the response callback, the caller will receive a Sharing.SharedFileMetadata object on success or a Sharing.GetFileMetadataError object on failure.

  • Returns shared file metadata.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func getFileMetadataBatch(
        files: [String],
        actions: [Sharing.FileAction]? = nil
    ) -> RpcRequest<ArraySerializer<Sharing.GetFileMetadataBatchResultSerializer>, Sharing.SharingUserErrorSerializer>

    Parameters

    files

    The files to query.

    actions

    A list of FileActions corresponding to FilePermissions that should appear in the response’s permissions in SharedFileMetadata field describing the actions the authenticated user can perform on the file.

    Return Value

    Through the response callback, the caller will receive a Array<Sharing.GetFileMetadataBatchResult> object on success or a Sharing.SharingUserError object on failure.

  • Returns shared folder metadata by its folder ID.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func getFolderMetadata(
        sharedFolderId: String,
        actions: [Sharing.FolderAction]? = nil
    ) -> RpcRequest<Sharing.SharedFolderMetadataSerializer, Sharing.SharedFolderAccessErrorSerializer>

    Parameters

    sharedFolderId

    The ID for the shared folder.

    actions

    A list of FolderActions corresponding to FolderPermissions that should appear in the response’s permissions in SharedFolderMetadata field describing the actions the authenticated user can perform on the folder.

    Return Value

    Through the response callback, the caller will receive a Sharing.SharedFolderMetadata object on success or a Sharing.SharedFolderAccessError object on failure.

  • Download the shared link’s file from a user’s Dropbox.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func getSharedLinkFile(
        url: String,
        path: String? = nil,
        linkPassword: String? = nil,
        overwrite: Bool = false,
        destination: URL
    ) -> DownloadRequestFile<Sharing.SharedLinkMetadataSerializer, Sharing.GetSharedLinkFileErrorSerializer>

    Parameters

    url

    URL of the shared link.

    path

    If the shared link is to a folder, this parameter can be used to retrieve the metadata for a specific file or sub-folder in this folder. A relative path should be used.

    linkPassword

    If the shared link has a password, this parameter can be used.

    overwrite

    A boolean to set behavior in the event of a naming conflict. True will overwrite conflicting file at destination. False will take no action (but if left unhandled in destination closure, an NSError will be thrown).

    destination

    The location to write the download to.

    Return Value

    Through the response callback, the caller will receive a Sharing.SharedLinkMetadata object on success or a Sharing.GetSharedLinkFileError object on failure.

  • Download the shared link’s file from a user’s Dropbox.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func getSharedLinkFile(
        url: String,
        path: String? = nil,
        linkPassword: String? = nil
    ) -> DownloadRequestMemory<Sharing.SharedLinkMetadataSerializer, Sharing.GetSharedLinkFileErrorSerializer>

    Parameters

    url

    URL of the shared link.

    path

    If the shared link is to a folder, this parameter can be used to retrieve the metadata for a specific file or sub-folder in this folder. A relative path should be used.

    linkPassword

    If the shared link has a password, this parameter can be used.

    Return Value

    Through the response callback, the caller will receive a Sharing.SharedLinkMetadata object on success or a Sharing.GetSharedLinkFileError object on failure.

  • Get the shared link’s metadata.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func getSharedLinkMetadata(
        url: String,
        path: String? = nil,
        linkPassword: String? = nil
    ) -> RpcRequest<Sharing.SharedLinkMetadataSerializer, Sharing.SharedLinkErrorSerializer>

    Parameters

    url

    URL of the shared link.

    path

    If the shared link is to a folder, this parameter can be used to retrieve the metadata for a specific file or sub-folder in this folder. A relative path should be used.

    linkPassword

    If the shared link has a password, this parameter can be used.

    Return Value

    Through the response callback, the caller will receive a Sharing.SharedLinkMetadata object on success or a Sharing.SharedLinkError object on failure.

  • Use to obtain the members who have been invited to a file, both inherited and uninherited members.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func listFileMembers(
        file: String,
        actions: [Sharing.MemberAction]? = nil,
        includeInherited: Bool = true,
        limit: UInt32 = 100
    ) -> RpcRequest<Sharing.SharedFileMembersSerializer, Sharing.ListFileMembersErrorSerializer>

    Parameters

    file

    The file for which you want to see members.

    actions

    The actions for which to return permissions on a member.

    includeInherited

    Whether to include members who only have access from a parent shared folder.

    limit

    Number of members to return max per query. Defaults to 100 if no limit is specified.

    Return Value

    Through the response callback, the caller will receive a Sharing.SharedFileMembers object on success or a Sharing.ListFileMembersError object on failure.

  • Get members of multiple files at once. The arguments to this route are more limited, and the limit on query result size per file is more strict. To customize the results more, use the individual file endpoint. Inherited users and groups are not included in the result, and permissions are not returned for this endpoint.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func listFileMembersBatch(
        files: [String],
        limit: UInt32 = 10
    ) -> RpcRequest<ArraySerializer<Sharing.ListFileMembersBatchResultSerializer>, Sharing.SharingUserErrorSerializer>

    Parameters

    files

    Files for which to return members.

    limit

    Number of members to return max per query. Defaults to 10 if no limit is specified.

    Return Value

    Through the response callback, the caller will receive a Array<Sharing.ListFileMembersBatchResult> object on success or a Sharing.SharingUserError object on failure.

  • Once a cursor has been retrieved from listFileMembers or listFileMembersBatch, use this to paginate through all shared file members.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func listFileMembersContinue(cursor: String)
        -> RpcRequest<Sharing.SharedFileMembersSerializer, Sharing.ListFileMembersContinueErrorSerializer>

    Parameters

    cursor

    The cursor returned by your last call to listFileMembers, listFileMembersContinue, or listFileMembersBatch.

    Return Value

    Through the response callback, the caller will receive a Sharing.SharedFileMembers object on success or a Sharing.ListFileMembersContinueError object on failure.

  • Returns shared folder membership by its folder ID.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func listFolderMembers(
        sharedFolderId: String,
        actions: [Sharing.MemberAction]? = nil,
        limit: UInt32 = 1_000
    ) -> RpcRequest<Sharing.SharedFolderMembersSerializer, Sharing.SharedFolderAccessErrorSerializer>

    Parameters

    sharedFolderId

    The ID for the shared folder.

    Return Value

    Through the response callback, the caller will receive a Sharing.SharedFolderMembers object on success or a Sharing.SharedFolderAccessError object on failure.

  • Once a cursor has been retrieved from listFolderMembers, use this to paginate through all shared folder members.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func listFolderMembersContinue(cursor: String)
        -> RpcRequest<Sharing.SharedFolderMembersSerializer, Sharing.ListFolderMembersContinueErrorSerializer>

    Parameters

    cursor

    The cursor returned by your last call to listFolderMembers or listFolderMembersContinue.

    Return Value

    Through the response callback, the caller will receive a Sharing.SharedFolderMembers object on success or a Sharing.ListFolderMembersContinueError object on failure.

  • Return the list of all shared folders the current user has access to.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func listFolders(
        limit: UInt32 = 1_000,
        actions: [Sharing.FolderAction]? = nil
    ) -> RpcRequest<Sharing.ListFoldersResultSerializer, VoidSerializer>

    Parameters

    limit

    The maximum number of results to return per request.

    actions

    A list of FolderActions corresponding to FolderPermissions that should appear in the response’s permissions in SharedFolderMetadata field describing the actions the authenticated user can perform on the folder.

    Return Value

    Through the response callback, the caller will receive a Sharing.ListFoldersResult object on success or a Void object on failure.

  • Once a cursor has been retrieved from listFolders, use this to paginate through all shared folders. The cursor must come from a previous call to listFolders or listFoldersContinue.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func listFoldersContinue(cursor: String)
        -> RpcRequest<Sharing.ListFoldersResultSerializer, Sharing.ListFoldersContinueErrorSerializer>

    Parameters

    cursor

    The cursor returned by the previous API call specified in the endpoint description.

    Return Value

    Through the response callback, the caller will receive a Sharing.ListFoldersResult object on success or a Sharing.ListFoldersContinueError object on failure.

  • Return the list of all shared folders the current user can mount or unmount.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func listMountableFolders(
        limit: UInt32 = 1_000,
        actions: [Sharing.FolderAction]? = nil
    ) -> RpcRequest<Sharing.ListFoldersResultSerializer, VoidSerializer>

    Parameters

    limit

    The maximum number of results to return per request.

    actions

    A list of FolderActions corresponding to FolderPermissions that should appear in the response’s permissions in SharedFolderMetadata field describing the actions the authenticated user can perform on the folder.

    Return Value

    Through the response callback, the caller will receive a Sharing.ListFoldersResult object on success or a Void object on failure.

  • Once a cursor has been retrieved from listMountableFolders, use this to paginate through all mountable shared folders. The cursor must come from a previous call to listMountableFolders or listMountableFoldersContinue.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func listMountableFoldersContinue(cursor: String)
        -> RpcRequest<Sharing.ListFoldersResultSerializer, Sharing.ListFoldersContinueErrorSerializer>

    Parameters

    cursor

    The cursor returned by the previous API call specified in the endpoint description.

    Return Value

    Through the response callback, the caller will receive a Sharing.ListFoldersResult object on success or a Sharing.ListFoldersContinueError object on failure.

  • Returns a list of all files shared with current user. Does not include files the user has received via shared folders, and does not include unclaimed invitations.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func listReceivedFiles(
        limit: UInt32 = 100,
        actions: [Sharing.FileAction]? = nil
    ) -> RpcRequest<Sharing.ListFilesResultSerializer, Sharing.SharingUserErrorSerializer>

    Parameters

    limit

    Number of files to return max per query. Defaults to 100 if no limit is specified.

    actions

    A list of FileActions corresponding to FilePermissions that should appear in the response’s permissions in SharedFileMetadata field describing the actions the authenticated user can perform on the file.

    Return Value

    Through the response callback, the caller will receive a Sharing.ListFilesResult object on success or a Sharing.SharingUserError object on failure.

  • Get more results with a cursor from listReceivedFiles.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func listReceivedFilesContinue(cursor: String)
        -> RpcRequest<Sharing.ListFilesResultSerializer, Sharing.ListFilesContinueErrorSerializer>

    Parameters

    cursor

    Cursor in cursor in ListFilesResult.

    Return Value

    Through the response callback, the caller will receive a Sharing.ListFilesResult object on success or a Sharing.ListFilesContinueError object on failure.

  • List shared links of this user. If no path is given, returns a list of all shared links for the current user. For members of business teams using team space and member folders, returns all shared links in the team member’s home folder unless the team space ID is specified in the request header. For more information, refer to the Namespace Guide https://www.dropbox.com/developers/reference/namespace-guide. If a non-empty path is given, returns a list of all shared links that allow access to the given path - direct links to the given path and links to parent folders of the given path. Links to parent folders can be suppressed by setting direct_only to true.

    • scope: sharing.read

    Declaration

    Swift

    @discardableResult
    public func listSharedLinks(
        path: String? = nil,
        cursor: String? = nil,
        directOnly: Bool? = nil
    ) -> RpcRequest<Sharing.ListSharedLinksResultSerializer, Sharing.ListSharedLinksErrorSerializer>

    Parameters

    path

    See listSharedLinks description.

    cursor

    The cursor returned by your last call to listSharedLinks.

    directOnly

    See listSharedLinks description.

    Return Value

    Through the response callback, the caller will receive a Sharing.ListSharedLinksResult object on success or a Sharing.ListSharedLinksError object on failure.

  • Modify the shared link’s settings. If the requested visibility conflict with the shared links policy of the team or the shared folder (in case the linked file is part of a shared folder) then the resolvedVisibility in LinkPermissions of the returned SharedLinkMetadata will reflect the actual visibility of the shared link and the requestedVisibility in LinkPermissions will reflect the requested visibility.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func modifySharedLinkSettings(
        url: String,
        settings: Sharing.SharedLinkSettings,
        removeExpiration: Bool = false
    ) -> RpcRequest<Sharing.SharedLinkMetadataSerializer, Sharing.ModifySharedLinkSettingsErrorSerializer>

    Parameters

    url

    URL of the shared link to change its settings.

    settings

    Set of settings for the shared link.

    removeExpiration

    If set to true, removes the expiration of the shared link.

    Return Value

    Through the response callback, the caller will receive a Sharing.SharedLinkMetadata object on success or a Sharing.ModifySharedLinkSettingsError object on failure.

  • The current user mounts the designated folder. Mount a shared folder for a user after they have been added as a member. Once mounted, the shared folder will appear in their Dropbox.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func mountFolder(sharedFolderId: String)
        -> RpcRequest<Sharing.SharedFolderMetadataSerializer, Sharing.MountFolderErrorSerializer>

    Parameters

    sharedFolderId

    The ID of the shared folder to mount.

    Return Value

    Through the response callback, the caller will receive a Sharing.SharedFolderMetadata object on success or a Sharing.MountFolderError object on failure.

  • The current user relinquishes their membership in the designated file. Note that the current user may still have inherited access to this file through the parent folder.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func relinquishFileMembership(file: String) -> RpcRequest<VoidSerializer, Sharing.RelinquishFileMembershipErrorSerializer>

    Parameters

    file

    The path or id for the file.

    Return Value

    Through the response callback, the caller will receive a Void object on success or a Sharing.RelinquishFileMembershipError object on failure.

  • The current user relinquishes their membership in the designated shared folder and will no longer have access to the folder. A folder owner cannot relinquish membership in their own folder. This will run synchronously if leave_a_copy is false, and asynchronously if leave_a_copy is true.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func relinquishFolderMembership(
        sharedFolderId: String,
        leaveACopy: Bool = false
    ) -> RpcRequest<Async.LaunchEmptyResultSerializer, Sharing.RelinquishFolderMembershipErrorSerializer>

    Parameters

    sharedFolderId

    The ID for the shared folder.

    leaveACopy

    Keep a copy of the folder’s contents upon relinquishing membership. This must be set to false when the folder is within a team folder or another shared folder.

    Return Value

    Through the response callback, the caller will receive a Async.LaunchEmptyResult object on success or a Sharing.RelinquishFolderMembershipError object on failure.

  • Removes a specified member from the file.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func removeFileMember2(
        file: String,
        member: Sharing.MemberSelector
    ) -> RpcRequest<Sharing.FileMemberRemoveActionResultSerializer, Sharing.RemoveFileMemberErrorSerializer>

    Parameters

    file

    File from which to remove members.

    member

    Member to remove from this file. Note that even if an email is specified, it may result in the removal of a user (not an invitee) if the user’s main account corresponds to that email address.

    Return Value

    Through the response callback, the caller will receive a Sharing.FileMemberRemoveActionResult object on success or a Sharing.RemoveFileMemberError object on failure.

  • Allows an owner or editor (if the ACL update policy allows) of a shared folder to remove another member.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func removeFolderMember(
        sharedFolderId: String,
        member: Sharing.MemberSelector,
        leaveACopy: Bool
    ) -> RpcRequest<Async.LaunchResultBaseSerializer, Sharing.RemoveFolderMemberErrorSerializer>

    Parameters

    sharedFolderId

    The ID for the shared folder.

    member

    The member to remove from the folder.

    leaveACopy

    If true, the removed user will keep their copy of the folder after it’s unshared, assuming it was mounted. Otherwise, it will be removed from their Dropbox. This must be set to false when removing a group, or when the folder is within a team folder or another shared folder.

    Return Value

    Through the response callback, the caller will receive a Async.LaunchResultBase object on success or a Sharing.RemoveFolderMemberError object on failure.

  • Revoke a shared link. Note that even after revoking a shared link to a file, the file may be accessible if there are shared links leading to any of the file parent folders. To list all shared links that enable access to a specific file, you can use the listSharedLinks with the file as the path in ListSharedLinksArg argument.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func revokeSharedLink(url: String) -> RpcRequest<VoidSerializer, Sharing.RevokeSharedLinkErrorSerializer>

    Parameters

    url

    URL of the shared link.

    Return Value

    Through the response callback, the caller will receive a Void object on success or a Sharing.RevokeSharedLinkError object on failure.

  • Change the inheritance policy of an existing Shared Folder. Only permitted for shared folders in a shared team root. If a asyncJobId in ShareFolderLaunch is returned, you’ll need to call checkShareJobStatus until the action completes to get the metadata for the folder.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func setAccessInheritance(
        sharedFolderId: String,
        accessInheritance: Sharing
            .AccessInheritance = .inherit
    ) -> RpcRequest<Sharing.ShareFolderLaunchSerializer, Sharing.SetAccessInheritanceErrorSerializer>

    Parameters

    accessInheritance

    The access inheritance settings for the folder.

    sharedFolderId

    The ID for the shared folder.

    Return Value

    Through the response callback, the caller will receive a Sharing.ShareFolderLaunch object on success or a Sharing.SetAccessInheritanceError object on failure.

  • Share a folder with collaborators. Most sharing will be completed synchronously. Large folders will be completed asynchronously. To make testing the async case repeatable, set ShareFolderArg.force_async. If a asyncJobId in ShareFolderLaunch is returned, you’ll need to call checkShareJobStatus until the action completes to get the metadata for the folder.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func shareFolder(
        path: String,
        aclUpdatePolicy: Sharing.AclUpdatePolicy? = nil,
        forceAsync: Bool = false,
        memberPolicy: Sharing.MemberPolicy? = nil,
        sharedLinkPolicy: Sharing.SharedLinkPolicy? = nil,
        viewerInfoPolicy: Sharing.ViewerInfoPolicy? = nil,
        accessInheritance: Sharing.AccessInheritance = .inherit,
        actions: [Sharing.FolderAction]? = nil,
        linkSettings: Sharing.LinkSettings? = nil
    ) -> RpcRequest<Sharing.ShareFolderLaunchSerializer, Sharing.ShareFolderErrorSerializer>

    Parameters

    actions

    A list of FolderActions corresponding to FolderPermissions that should appear in the response’s permissions in SharedFolderMetadata field describing the actions the authenticated user can perform on the folder.

    linkSettings

    Settings on the link for this folder.

    Return Value

    Through the response callback, the caller will receive a Sharing.ShareFolderLaunch object on success or a Sharing.ShareFolderError object on failure.

  • Transfer ownership of a shared folder to a member of the shared folder. User must have owner in AccessLevel access to the shared folder to perform a transfer.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func transferFolder(
        sharedFolderId: String,
        toDropboxId: String
    ) -> RpcRequest<VoidSerializer, Sharing.TransferFolderErrorSerializer>

    Parameters

    sharedFolderId

    The ID for the shared folder.

    toDropboxId

    A account or team member ID to transfer ownership to.

    Return Value

    Through the response callback, the caller will receive a Void object on success or a Sharing.TransferFolderError object on failure.

  • The current user unmounts the designated folder. They can re-mount the folder at a later time using mountFolder.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func unmountFolder(sharedFolderId: String) -> RpcRequest<VoidSerializer, Sharing.UnmountFolderErrorSerializer>

    Parameters

    sharedFolderId

    The ID for the shared folder.

    Return Value

    Through the response callback, the caller will receive a Void object on success or a Sharing.UnmountFolderError object on failure.

  • Remove all members from this file. Does not remove inherited members.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func unshareFile(file: String) -> RpcRequest<VoidSerializer, Sharing.UnshareFileErrorSerializer>

    Parameters

    file

    The file to unshare.

    Return Value

    Through the response callback, the caller will receive a Void object on success or a Sharing.UnshareFileError object on failure.

  • Allows a shared folder owner to unshare the folder. You’ll need to call checkJobStatus to determine if the action has completed successfully.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func unshareFolder(
        sharedFolderId: String,
        leaveACopy: Bool = false
    ) -> RpcRequest<Async.LaunchEmptyResultSerializer, Sharing.UnshareFolderErrorSerializer>

    Parameters

    sharedFolderId

    The ID for the shared folder.

    leaveACopy

    If true, members of this shared folder will get a copy of this folder after it’s unshared. Otherwise, it will be removed from their Dropbox. The current user, who is an owner, will always retain their copy.

    Return Value

    Through the response callback, the caller will receive a Async.LaunchEmptyResult object on success or a Sharing.UnshareFolderError object on failure.

  • Changes a member’s access on a shared file.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func updateFileMember(
        file: String,
        member: Sharing.MemberSelector,
        accessLevel: Sharing.AccessLevel
    ) -> RpcRequest<Sharing.MemberAccessLevelResultSerializer, Sharing.FileMemberActionErrorSerializer>

    Parameters

    file

    File for which we are changing a member’s access.

    member

    The member whose access we are changing.

    accessLevel

    The new access level for the member.

    Return Value

    Through the response callback, the caller will receive a Sharing.MemberAccessLevelResult object on success or a Sharing.FileMemberActionError object on failure.

  • Allows an owner or editor of a shared folder to update another member’s permissions.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func updateFolderMember(
        sharedFolderId: String,
        member: Sharing.MemberSelector,
        accessLevel: Sharing.AccessLevel
    ) -> RpcRequest<Sharing.MemberAccessLevelResultSerializer, Sharing.UpdateFolderMemberErrorSerializer>

    Parameters

    sharedFolderId

    The ID for the shared folder.

    member

    The member of the shared folder to update. Only the dropboxId in MemberSelector may be set at this time.

    accessLevel

    The new access level for member. owner in AccessLevel is disallowed.

    Return Value

    Through the response callback, the caller will receive a Sharing.MemberAccessLevelResult object on success or a Sharing.UpdateFolderMemberError object on failure.

  • Update the sharing policies for a shared folder. User must have owner in AccessLevel access to the shared folder to update its policies.

    • scope: sharing.write

    Declaration

    Swift

    @discardableResult
    public func updateFolderPolicy(
        sharedFolderId: String,
        memberPolicy: Sharing.MemberPolicy? = nil,
        aclUpdatePolicy: Sharing.AclUpdatePolicy? = nil,
        viewerInfoPolicy: Sharing.ViewerInfoPolicy? = nil,
        sharedLinkPolicy: Sharing.SharedLinkPolicy? = nil,
        linkSettings: Sharing.LinkSettings? = nil,
        actions: [Sharing.FolderAction]? = nil
    ) -> RpcRequest<Sharing.SharedFolderMetadataSerializer, Sharing.UpdateFolderPolicyErrorSerializer>

    Parameters

    sharedFolderId

    The ID for the shared folder.

    memberPolicy

    Who can be a member of this shared folder. Only applicable if the current user is on a team.

    aclUpdatePolicy

    Who can add and remove members of this shared folder.

    viewerInfoPolicy

    Who can enable/disable viewer info for this shared folder.

    sharedLinkPolicy

    The policy to apply to shared links created for content inside this shared folder. The current user must be on a team to set this policy to members in SharedLinkPolicy.

    linkSettings

    Settings on the link for this folder.

    actions

    A list of FolderActions corresponding to FolderPermissions that should appear in the response’s permissions in SharedFolderMetadata field describing the actions the authenticated user can perform on the folder.

    Return Value

    Through the response callback, the caller will receive a Sharing.SharedFolderMetadata object on success or a Sharing.UpdateFolderPolicyError object on failure.