FilesRoutes

open class FilesRoutes

Routes for the files namespace

  • Copy a file or folder to a different location in the user’s Dropbox. If the source path is a folder all its contents will be copied.

    Declaration

    Swift

    @discardableResult
    open func copyV2(fromPath: String, toPath: String, allowSharedFolder: Bool = false, autorename: Bool = false, allowOwnershipTransfer: Bool = false) -> RpcRequest<Files.RelocationResultSerializer, Files.RelocationErrorSerializer>

    Parameters

    allowSharedFolder

    This flag has no effect.

    autorename

    If there’s a conflict, have the Dropbox server try to autorename the file to avoid the conflict.

    allowOwnershipTransfer

    Allow moves by owner even if it would result in an ownership transfer for the content being moved. This does not apply to copies.

    Return Value

    Through the response callback, the caller will receive a Files.RelocationResult object on success or a Files.RelocationError object on failure.

  • Copy multiple files or folders to different locations at once in the user’s Dropbox. This route will replace copyBatch. The main difference is this route will return status for each entry, while copyBatch raises failure if any entry fails. This route will either finish synchronously, or return a job ID and do the async copy job in background. Please use copyBatchCheckV2 to check the job status.

    Declaration

    Swift

    @discardableResult
    open func copyBatchV2(entries: Array<Files.RelocationPath>, autorename: Bool = false) -> RpcRequest<Files.RelocationBatchV2LaunchSerializer, VoidSerializer>

    Parameters

    entries

    List of entries to be moved or copied. Each entry is RelocationPath.

    autorename

    If there’s a conflict with any file, have the Dropbox server try to autorename that file to avoid the conflict.

    Return Value

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

  • Returns the status of an asynchronous job for copyBatchV2. It returns list of results for each entry.

    Declaration

    Swift

    @discardableResult
    open func copyBatchCheckV2(asyncJobId: String) -> RpcRequest<Files.RelocationBatchV2JobStatusSerializer, 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 Files.RelocationBatchV2JobStatus object on success or a Async.PollError object on failure.

  • Get a copy reference to a file or folder. This reference string can be used to save that file or folder to another user’s Dropbox by passing it to copyReferenceSave.

    Declaration

    Swift

    @discardableResult
    open func copyReferenceGet(path: String) -> RpcRequest<Files.GetCopyReferenceResultSerializer, Files.GetCopyReferenceErrorSerializer>

    Parameters

    path

    The path to the file or folder you want to get a copy reference to.

    Return Value

    Through the response callback, the caller will receive a Files.GetCopyReferenceResult object on success or a Files.GetCopyReferenceError object on failure.

  • Save a copy reference returned by copyReferenceGet to the user’s Dropbox.

    Declaration

    Swift

    @discardableResult
    open func copyReferenceSave(copyReference: String, path: String) -> RpcRequest<Files.SaveCopyReferenceResultSerializer, Files.SaveCopyReferenceErrorSerializer>

    Parameters

    copyReference

    A copy reference returned by copyReferenceGet.

    path

    Path in the user’s Dropbox that is the destination.

    Return Value

    Through the response callback, the caller will receive a Files.SaveCopyReferenceResult object on success or a Files.SaveCopyReferenceError object on failure.

  • Create a folder at a given path.

    Declaration

    Swift

    @discardableResult
    open func createFolderV2(path: String, autorename: Bool = false) -> RpcRequest<Files.CreateFolderResultSerializer, Files.CreateFolderErrorSerializer>

    Parameters

    path

    Path in the user’s Dropbox to create.

    autorename

    If there’s a conflict, have the Dropbox server try to autorename the folder to avoid the conflict.

    Return Value

    Through the response callback, the caller will receive a Files.CreateFolderResult object on success or a Files.CreateFolderError object on failure.

  • Create multiple folders at once. This route is asynchronous for large batches, which returns a job ID immediately and runs the create folder batch asynchronously. Otherwise, creates the folders and returns the result synchronously for smaller inputs. You can force asynchronous behaviour by using the forceAsync in CreateFolderBatchArg flag. Use createFolderBatchCheck to check the job status.

    Declaration

    Swift

    @discardableResult
    open func createFolderBatch(paths: Array<String>, autorename: Bool = false, forceAsync: Bool = false) -> RpcRequest<Files.CreateFolderBatchLaunchSerializer, VoidSerializer>

    Parameters

    paths

    List of paths to be created in the user’s Dropbox. Duplicate path arguments in the batch are considered only once.

    autorename

    If there’s a conflict, have the Dropbox server try to autorename the folder to avoid the conflict.

    forceAsync

    Whether to force the create to happen asynchronously.

    Return Value

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

  • Returns the status of an asynchronous job for createFolderBatch. If success, it returns list of result for each entry.

    Declaration

    Swift

    @discardableResult
    open func createFolderBatchCheck(asyncJobId: String) -> RpcRequest<Files.CreateFolderBatchJobStatusSerializer, 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 Files.CreateFolderBatchJobStatus object on success or a Async.PollError object on failure.

  • Delete the file or folder at a given path. If the path is a folder, all its contents will be deleted too. A successful response indicates that the file or folder was deleted. The returned metadata will be the corresponding FileMetadata or FolderMetadata for the item at time of deletion, and not a DeletedMetadata object.

    Declaration

    Swift

    @discardableResult
    open func deleteV2(path: String, parentRev: String? = nil) -> RpcRequest<Files.DeleteResultSerializer, Files.DeleteErrorSerializer>

    Parameters

    path

    Path in the user’s Dropbox to delete.

    parentRev

    Perform delete if given “rev” matches the existing file’s latest “rev”. This field does not support deleting a folder.

    Return Value

    Through the response callback, the caller will receive a Files.DeleteResult object on success or a Files.DeleteError object on failure.

  • Delete multiple files/folders at once. This route is asynchronous, which returns a job ID immediately and runs the delete batch asynchronously. Use deleteBatchCheck to check the job status.

    Declaration

    Swift

    @discardableResult
    open func deleteBatch(entries: Array<Files.DeleteArg>) -> RpcRequest<Files.DeleteBatchLaunchSerializer, VoidSerializer>

    Return Value

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

  • Returns the status of an asynchronous job for deleteBatch. If success, it returns list of result for each entry.

    Declaration

    Swift

    @discardableResult
    open func deleteBatchCheck(asyncJobId: String) -> RpcRequest<Files.DeleteBatchJobStatusSerializer, 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 Files.DeleteBatchJobStatus object on success or a Async.PollError object on failure.

  • Download a file from a user’s Dropbox.

    Declaration

    Swift

    @discardableResult
    open func download(path: String, rev: String? = nil, overwrite: Bool = false, destination: @escaping (URL, HTTPURLResponse) -> URL) -> DownloadRequestFile<Files.FileMetadataSerializer, Files.DownloadErrorSerializer>

    Parameters

    path

    The path of the file to download.

    rev

    Please specify revision in path instead.

    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

    A closure used to compute the destination, given the temporary file location and the response.

    Return Value

    Through the response callback, the caller will receive a Files.FileMetadata object on success or a Files.DownloadError object on failure.

  • Download a file from a user’s Dropbox.

    Declaration

    Swift

    @discardableResult
    open func download(path: String, rev: String? = nil) -> DownloadRequestMemory<Files.FileMetadataSerializer, Files.DownloadErrorSerializer>

    Parameters

    path

    The path of the file to download.

    rev

    Please specify revision in path instead.

    Return Value

    Through the response callback, the caller will receive a Files.FileMetadata object on success or a Files.DownloadError object on failure.

  • Download a folder from the user’s Dropbox, as a zip file. The folder must be less than 20 GB in size and any single file within must be less than 4 GB in size. The resulting zip must have fewer than 10,000 total file and folder entries, including the top level folder. The input cannot be a single file.

    Declaration

    Swift

    @discardableResult
    open func downloadZip(path: String, overwrite: Bool = false, destination: @escaping (URL, HTTPURLResponse) -> URL) -> DownloadRequestFile<Files.DownloadZipResultSerializer, Files.DownloadZipErrorSerializer>

    Parameters

    path

    The path of the folder to download.

    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

    A closure used to compute the destination, given the temporary file location and the response.

    Return Value

    Through the response callback, the caller will receive a Files.DownloadZipResult object on success or a Files.DownloadZipError object on failure.

  • Download a folder from the user’s Dropbox, as a zip file. The folder must be less than 20 GB in size and any single file within must be less than 4 GB in size. The resulting zip must have fewer than 10,000 total file and folder entries, including the top level folder. The input cannot be a single file.

    Declaration

    Swift

    @discardableResult
    open func downloadZip(path: String) -> DownloadRequestMemory<Files.DownloadZipResultSerializer, Files.DownloadZipErrorSerializer>

    Parameters

    path

    The path of the folder to download.

    Return Value

    Through the response callback, the caller will receive a Files.DownloadZipResult object on success or a Files.DownloadZipError object on failure.

  • Export a file from a user’s Dropbox. This route only supports exporting files that cannot be downloaded directly and whose fileMetadata in ExportResult has exportAs in ExportInfo populated.

    Declaration

    Swift

    @discardableResult
    open func export(path: String, exportFormat: String? = nil, overwrite: Bool = false, destination: @escaping (URL, HTTPURLResponse) -> URL) -> DownloadRequestFile<Files.ExportResultSerializer, Files.ExportErrorSerializer>

    Parameters

    path

    The path of the file to be exported.

    exportFormat

    The file format to which the file should be exported. This must be one of the formats listed in the file’s export_options returned by getMetadata. If none is specified, the default format (specified in export_as in file metadata) will 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

    A closure used to compute the destination, given the temporary file location and the response.

    Return Value

    Through the response callback, the caller will receive a Files.ExportResult object on success or a Files.ExportError object on failure.

  • Export a file from a user’s Dropbox. This route only supports exporting files that cannot be downloaded directly and whose fileMetadata in ExportResult has exportAs in ExportInfo populated.

    Declaration

    Swift

    @discardableResult
    open func export(path: String, exportFormat: String? = nil) -> DownloadRequestMemory<Files.ExportResultSerializer, Files.ExportErrorSerializer>

    Parameters

    path

    The path of the file to be exported.

    exportFormat

    The file format to which the file should be exported. This must be one of the formats listed in the file’s export_options returned by getMetadata. If none is specified, the default format (specified in export_as in file metadata) will be used.

    Return Value

    Through the response callback, the caller will receive a Files.ExportResult object on success or a Files.ExportError object on failure.

  • Return the lock metadata for the given list of paths.

    Declaration

    Swift

    @discardableResult
    open func getFileLockBatch(entries: Array<Files.LockFileArg>) -> RpcRequest<Files.LockFileBatchResultSerializer, Files.LockFileErrorSerializer>

    Parameters

    entries

    List of ‘entries’. Each ‘entry’ contains a path of the file which will be locked or queried. Duplicate path arguments in the batch are considered only once.

    Return Value

    Through the response callback, the caller will receive a Files.LockFileBatchResult object on success or a Files.LockFileError object on failure.

  • Returns the metadata for a file or folder. Note: Metadata for the root folder is unsupported.

    Declaration

    Swift

    @discardableResult
    open func getMetadata(path: String, includeMediaInfo: Bool = false, includeDeleted: Bool = false, includeHasExplicitSharedMembers: Bool = false, includePropertyGroups: FileProperties.TemplateFilterBase? = nil) -> RpcRequest<Files.MetadataSerializer, Files.GetMetadataErrorSerializer>

    Parameters

    path

    The path of a file or folder on Dropbox.

    includeMediaInfo

    If true, mediaInfo in FileMetadata is set for photo and video.

    includeDeleted

    If true, DeletedMetadata will be returned for deleted file or folder, otherwise notFound in LookupError will be returned.

    includeHasExplicitSharedMembers

    If true, the results will include a flag for each file indicating whether or not that file has any explicit members.

    includePropertyGroups

    If set to a valid list of template IDs, propertyGroups in FileMetadata is set if there exists property data associated with the file and each of the listed templates.

    Return Value

    Through the response callback, the caller will receive a Files.Metadata object on success or a Files.GetMetadataError object on failure.

  • Get a preview for a file. Currently, PDF previews are generated for files with the following extensions: .ai, .doc, .docm, .docx, .eps, .gdoc, .gslides, .odp, .odt, .pps, .ppsm, .ppsx, .ppt, .pptm, .pptx, .rtf. HTML previews are generated for files with the following extensions: .csv, .ods, .xls, .xlsm, .gsheet, .xlsx. Other formats will return an unsupported extension error.

    Declaration

    Swift

    @discardableResult
    open func getPreview(path: String, rev: String? = nil, overwrite: Bool = false, destination: @escaping (URL, HTTPURLResponse) -> URL) -> DownloadRequestFile<Files.FileMetadataSerializer, Files.PreviewErrorSerializer>

    Parameters

    path

    The path of the file to preview.

    rev

    Please specify revision in path instead.

    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

    A closure used to compute the destination, given the temporary file location and the response.

    Return Value

    Through the response callback, the caller will receive a Files.FileMetadata object on success or a Files.PreviewError object on failure.

  • Get a preview for a file. Currently, PDF previews are generated for files with the following extensions: .ai, .doc, .docm, .docx, .eps, .gdoc, .gslides, .odp, .odt, .pps, .ppsm, .ppsx, .ppt, .pptm, .pptx, .rtf. HTML previews are generated for files with the following extensions: .csv, .ods, .xls, .xlsm, .gsheet, .xlsx. Other formats will return an unsupported extension error.

    Declaration

    Swift

    @discardableResult
    open func getPreview(path: String, rev: String? = nil) -> DownloadRequestMemory<Files.FileMetadataSerializer, Files.PreviewErrorSerializer>

    Parameters

    path

    The path of the file to preview.

    rev

    Please specify revision in path instead.

    Return Value

    Through the response callback, the caller will receive a Files.FileMetadata object on success or a Files.PreviewError object on failure.

  • Get a temporary link to stream content of a file. This link will expire in four hours and afterwards you will get 410 Gone. This URL should not be used to display content directly in the browser. The Content-Type of the link is determined automatically by the file’s mime type.

    Declaration

    Swift

    @discardableResult
    open func getTemporaryLink(path: String) -> RpcRequest<Files.GetTemporaryLinkResultSerializer, Files.GetTemporaryLinkErrorSerializer>

    Parameters

    path

    The path to the file you want a temporary link to.

    Return Value

    Through the response callback, the caller will receive a Files.GetTemporaryLinkResult object on success or a Files.GetTemporaryLinkError object on failure.

  • Get a one-time use temporary upload link to upload a file to a Dropbox location. This endpoint acts as a delayed upload. The returned temporary upload link may be used to make a POST request with the data to be uploaded. The upload will then be perfomed with the CommitInfo previously provided to getTemporaryUploadLink but evaluated only upon consumption. Hence, errors stemming from invalid CommitInfo with respect to the state of the user’s Dropbox will only be communicated at consumption time. Additionally, these errors are surfaced as generic HTTP 409 Conflict responses, potentially hiding issue details. The maximum temporary upload link duration is 4 hours. Upon consumption or expiration, a new link will have to be generated. Multiple links may exist for a specific upload path at any given time. The POST request on the temporary upload link must have its Content-Type set to “application/octet-stream”. Example temporary upload link consumption request: curl -X POST https://content.dropboxapi.com/apitul/1/bNi2uIYF51cVBND –header “Content-Type: application/octet-stream” –data-binary @local_file.txt A successful temporary upload link consumption request returns the content hash of the uploaded data in JSON format. Example succesful temporary upload link consumption response: {“content-hash”: “599d71033d700ac892a0e48fa61b125d2f5994”} An unsuccessful temporary upload link consumption request returns any of the following status codes: HTTP 400 Bad Request: Content-Type is not one of application/octet-stream and text/plain or request is invalid. HTTP 409 Conflict: The temporary upload link does not exist or is currently unavailable, the upload failed, or another error happened. HTTP 410 Gone: The temporary upload link is expired or consumed. Example unsuccessful temporary upload link consumption response: Temporary upload link has been recently consumed.

    Declaration

    Swift

    @discardableResult
    open func getTemporaryUploadLink(commitInfo: Files.CommitInfo, duration: Double = 14400.0) -> RpcRequest<Files.GetTemporaryUploadLinkResultSerializer, VoidSerializer>

    Parameters

    commitInfo

    Contains the path and other optional modifiers for the future upload commit. Equivalent to the parameters provided to upload.

    duration

    How long before this link expires, in seconds. Attempting to start an upload with this link longer than this period of time after link creation will result in an error.

    Return Value

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

  • Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won’t be converted to a thumbnail.

    Declaration

    Swift

    @discardableResult
    open func getThumbnail(path: String, format: Files.ThumbnailFormat = .jpeg, size: Files.ThumbnailSize = .w64h64, mode: Files.ThumbnailMode = .strict, overwrite: Bool = false, destination: @escaping (URL, HTTPURLResponse) -> URL) -> DownloadRequestFile<Files.FileMetadataSerializer, Files.ThumbnailErrorSerializer>

    Parameters

    path

    The path to the image file you want to thumbnail.

    format

    The format for the thumbnail image, jpeg (default) or png. For images that are photos, jpeg should be preferred, while png is better for screenshots and digital arts.

    size

    The size for the thumbnail image.

    mode

    How to resize and crop the image to achieve the desired size.

    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

    A closure used to compute the destination, given the temporary file location and the response.

    Return Value

    Through the response callback, the caller will receive a Files.FileMetadata object on success or a Files.ThumbnailError object on failure.

  • Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won’t be converted to a thumbnail.

    Declaration

    Swift

    @discardableResult
    open func getThumbnail(path: String, format: Files.ThumbnailFormat = .jpeg, size: Files.ThumbnailSize = .w64h64, mode: Files.ThumbnailMode = .strict) -> DownloadRequestMemory<Files.FileMetadataSerializer, Files.ThumbnailErrorSerializer>

    Parameters

    path

    The path to the image file you want to thumbnail.

    format

    The format for the thumbnail image, jpeg (default) or png. For images that are photos, jpeg should be preferred, while png is better for screenshots and digital arts.

    size

    The size for the thumbnail image.

    mode

    How to resize and crop the image to achieve the desired size.

    Return Value

    Through the response callback, the caller will receive a Files.FileMetadata object on success or a Files.ThumbnailError object on failure.

  • Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won’t be converted to a thumbnail.

    Declaration

    Swift

    @discardableResult
    open func getThumbnailV2(resource: Files.PathOrLink, format: Files.ThumbnailFormat = .jpeg, size: Files.ThumbnailSize = .w64h64, mode: Files.ThumbnailMode = .strict, overwrite: Bool = false, destination: @escaping (URL, HTTPURLResponse) -> URL) -> DownloadRequestFile<Files.PreviewResultSerializer, Files.ThumbnailV2ErrorSerializer>

    Parameters

    resource

    Information specifying which file to preview. This could be a path to a file, a shared link pointing to a file, or a shared link pointing to a folder, with a relative path.

    format

    The format for the thumbnail image, jpeg (default) or png. For images that are photos, jpeg should be preferred, while png is better for screenshots and digital arts.

    size

    The size for the thumbnail image.

    mode

    How to resize and crop the image to achieve the desired size.

    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

    A closure used to compute the destination, given the temporary file location and the response.

    Return Value

    Through the response callback, the caller will receive a Files.PreviewResult object on success or a Files.ThumbnailV2Error object on failure.

  • Get a thumbnail for an image. This method currently supports files with the following file extensions: jpg, jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won’t be converted to a thumbnail.

    Declaration

    Swift

    @discardableResult
    open func getThumbnailV2(resource: Files.PathOrLink, format: Files.ThumbnailFormat = .jpeg, size: Files.ThumbnailSize = .w64h64, mode: Files.ThumbnailMode = .strict) -> DownloadRequestMemory<Files.PreviewResultSerializer, Files.ThumbnailV2ErrorSerializer>

    Parameters

    resource

    Information specifying which file to preview. This could be a path to a file, a shared link pointing to a file, or a shared link pointing to a folder, with a relative path.

    format

    The format for the thumbnail image, jpeg (default) or png. For images that are photos, jpeg should be preferred, while png is better for screenshots and digital arts.

    size

    The size for the thumbnail image.

    mode

    How to resize and crop the image to achieve the desired size.

    Return Value

    Through the response callback, the caller will receive a Files.PreviewResult object on success or a Files.ThumbnailV2Error object on failure.

  • Get thumbnails for a list of images. We allow up to 25 thumbnails in a single batch. This method currently supports files with the following file extensions: jpg, jpeg, png, tiff, tif, gif, webp, ppm and bmp. Photos that are larger than 20MB in size won’t be converted to a thumbnail.

    Declaration

    Swift

    @discardableResult
    open func getThumbnailBatch(entries: Array<Files.ThumbnailArg>) -> RpcRequest<Files.GetThumbnailBatchResultSerializer, Files.GetThumbnailBatchErrorSerializer>

    Parameters

    entries

    List of files to get thumbnails.

    Return Value

    Through the response callback, the caller will receive a Files.GetThumbnailBatchResult object on success or a Files.GetThumbnailBatchError object on failure.

  • Starts returning the contents of a folder. If the result’s hasMore in ListFolderResult field is true, call listFolderContinue with the returned cursor in ListFolderResult to retrieve more entries. If you’re using recursive in ListFolderArg set to true to keep a local cache of the contents of a Dropbox account, iterate through each entry in order and process them as follows to keep your local state in sync: For each FileMetadata, store the new entry at the given path in your local state. If the required parent folders don’t exist yet, create them. If there’s already something else at the given path, replace it and remove all its children. For each FolderMetadata, store the new entry at the given path in your local state. If the required parent folders don’t exist yet, create them. If there’s already something else at the given path, replace it but leave the children as they are. Check the new entry’s readOnly in FolderSharingInfo and set all its children’s read-only statuses to match. For each DeletedMetadata, if your local state has something at the given path, remove it and all its children. If there’s nothing at the given path, ignore this entry. Note: auth.RateLimitError may be returned if multiple listFolder or listFolderContinue calls with same parameters are made simultaneously by same API app for same user. If your app implements retry logic, please hold off the retry until the previous request finishes.

    Declaration

    Swift

    @discardableResult
    open func listFolder(path: String, recursive: Bool = false, includeMediaInfo: Bool = false, includeDeleted: Bool = false, includeHasExplicitSharedMembers: Bool = false, includeMountedFolders: Bool = true, limit: UInt32? = nil, sharedLink: Files.SharedLink? = nil, includePropertyGroups: FileProperties.TemplateFilterBase? = nil, includeNonDownloadableFiles: Bool = true) -> RpcRequest<Files.ListFolderResultSerializer, Files.ListFolderErrorSerializer>

    Parameters

    path

    A unique identifier for the file.

    recursive

    If true, the list folder operation will be applied recursively to all subfolders and the response will contain contents of all subfolders.

    includeMediaInfo

    If true, mediaInfo in FileMetadata is set for photo and video. This parameter will no longer have an effect starting December 2, 2019.

    includeDeleted

    If true, the results will include entries for files and folders that used to exist but were deleted.

    includeHasExplicitSharedMembers

    If true, the results will include a flag for each file indicating whether or not that file has any explicit members.

    includeMountedFolders

    If true, the results will include entries under mounted folders which includes app folder, shared folder and team folder.

    limit

    The maximum number of results to return per request. Note: This is an approximate number and there can be slightly more entries returned in some cases.

    sharedLink

    A shared link to list the contents of. If the link is password-protected, the password must be provided. If this field is present, path in ListFolderArg will be relative to root of the shared link. Only non-recursive mode is supported for shared link.

    includePropertyGroups

    If set to a valid list of template IDs, propertyGroups in FileMetadata is set if there exists property data associated with the file and each of the listed templates.

    includeNonDownloadableFiles

    If true, include files that are not downloadable, i.e. Google Docs.

    Return Value

    Through the response callback, the caller will receive a Files.ListFolderResult object on success or a Files.ListFolderError object on failure.

  • Once a cursor has been retrieved from listFolder, use this to paginate through all files and retrieve updates to the folder, following the same rules as documented for listFolder.

    Declaration

    Swift

    @discardableResult
    open func listFolderContinue(cursor: String) -> RpcRequest<Files.ListFolderResultSerializer, Files.ListFolderContinueErrorSerializer>

    Parameters

    cursor

    The cursor returned by your last call to listFolder or listFolderContinue.

    Return Value

    Through the response callback, the caller will receive a Files.ListFolderResult object on success or a Files.ListFolderContinueError object on failure.

  • A way to quickly get a cursor for the folder’s state. Unlike listFolder, listFolderGetLatestCursor doesn’t return any entries. This endpoint is for app which only needs to know about new files and modifications and doesn’t need to know about files that already exist in Dropbox.

    Declaration

    Swift

    @discardableResult
    open func listFolderGetLatestCursor(path: String, recursive: Bool = false, includeMediaInfo: Bool = false, includeDeleted: Bool = false, includeHasExplicitSharedMembers: Bool = false, includeMountedFolders: Bool = true, limit: UInt32? = nil, sharedLink: Files.SharedLink? = nil, includePropertyGroups: FileProperties.TemplateFilterBase? = nil, includeNonDownloadableFiles: Bool = true) -> RpcRequest<Files.ListFolderGetLatestCursorResultSerializer, Files.ListFolderErrorSerializer>

    Parameters

    path

    A unique identifier for the file.

    recursive

    If true, the list folder operation will be applied recursively to all subfolders and the response will contain contents of all subfolders.

    includeMediaInfo

    If true, mediaInfo in FileMetadata is set for photo and video. This parameter will no longer have an effect starting December 2, 2019.

    includeDeleted

    If true, the results will include entries for files and folders that used to exist but were deleted.

    includeHasExplicitSharedMembers

    If true, the results will include a flag for each file indicating whether or not that file has any explicit members.

    includeMountedFolders

    If true, the results will include entries under mounted folders which includes app folder, shared folder and team folder.

    limit

    The maximum number of results to return per request. Note: This is an approximate number and there can be slightly more entries returned in some cases.

    sharedLink

    A shared link to list the contents of. If the link is password-protected, the password must be provided. If this field is present, path in ListFolderArg will be relative to root of the shared link. Only non-recursive mode is supported for shared link.

    includePropertyGroups

    If set to a valid list of template IDs, propertyGroups in FileMetadata is set if there exists property data associated with the file and each of the listed templates.

    includeNonDownloadableFiles

    If true, include files that are not downloadable, i.e. Google Docs.

    Return Value

    Through the response callback, the caller will receive a Files.ListFolderGetLatestCursorResult object on success or a Files.ListFolderError object on failure.

  • A longpoll endpoint to wait for changes on an account. In conjunction with listFolderContinue, this call gives you a low-latency way to monitor an account for file changes. The connection will block until there are changes available or a timeout occurs. This endpoint is useful mostly for client-side apps. If you’re looking for server-side notifications, check out our webhooks documentation https://www.dropbox.com/developers/reference/webhooks.

    Declaration

    Swift

    @discardableResult
    open func listFolderLongpoll(cursor: String, timeout: UInt64 = 30) -> RpcRequest<Files.ListFolderLongpollResultSerializer, Files.ListFolderLongpollErrorSerializer>

    Parameters

    cursor

    A cursor as returned by listFolder or listFolderContinue. Cursors retrieved by setting includeMediaInfo in ListFolderArg to true are not supported.

    timeout

    A timeout in seconds. The request will block for at most this length of time, plus up to 90 seconds of random jitter added to avoid the thundering herd problem. Care should be taken when using this parameter, as some network infrastructure does not support long timeouts.

    Return Value

    Through the response callback, the caller will receive a Files.ListFolderLongpollResult object on success or a Files.ListFolderLongpollError object on failure.

  • Returns revisions for files based on a file path or a file id. The file path or file id is identified from the latest file entry at the given file path or id. This end point allows your app to query either by file path or file id by setting the mode parameter appropriately. In the path in ListRevisionsMode (default) mode, all revisions at the same file path as the latest file entry are returned. If revisions with the same file id are desired, then mode must be set to id in ListRevisionsMode. The id in ListRevisionsMode mode is useful to retrieve revisions for a given file across moves or renames.

    Declaration

    Swift

    @discardableResult
    open func listRevisions(path: String, mode: Files.ListRevisionsMode = .path, limit: UInt64 = 10) -> RpcRequest<Files.ListRevisionsResultSerializer, Files.ListRevisionsErrorSerializer>

    Parameters

    path

    The path to the file you want to see the revisions of.

    mode

    Determines the behavior of the API in listing the revisions for a given file path or id.

    limit

    The maximum number of revision entries returned.

    Return Value

    Through the response callback, the caller will receive a Files.ListRevisionsResult object on success or a Files.ListRevisionsError object on failure.

  • Lock the files at the given paths. A locked file will be writable only by the lock holder. A successful response indicates that the file has been locked. Returns a list of the locked file paths and their metadata after this operation.

    Declaration

    Swift

    @discardableResult
    open func lockFileBatch(entries: Array<Files.LockFileArg>) -> RpcRequest<Files.LockFileBatchResultSerializer, Files.LockFileErrorSerializer>

    Parameters

    entries

    List of ‘entries’. Each ‘entry’ contains a path of the file which will be locked or queried. Duplicate path arguments in the batch are considered only once.

    Return Value

    Through the response callback, the caller will receive a Files.LockFileBatchResult object on success or a Files.LockFileError object on failure.

  • Move a file or folder to a different location in the user’s Dropbox. If the source path is a folder all its contents will be moved. Note that we do not currently support case-only renaming.

    Declaration

    Swift

    @discardableResult
    open func moveV2(fromPath: String, toPath: String, allowSharedFolder: Bool = false, autorename: Bool = false, allowOwnershipTransfer: Bool = false) -> RpcRequest<Files.RelocationResultSerializer, Files.RelocationErrorSerializer>

    Parameters

    allowSharedFolder

    This flag has no effect.

    autorename

    If there’s a conflict, have the Dropbox server try to autorename the file to avoid the conflict.

    allowOwnershipTransfer

    Allow moves by owner even if it would result in an ownership transfer for the content being moved. This does not apply to copies.

    Return Value

    Through the response callback, the caller will receive a Files.RelocationResult object on success or a Files.RelocationError object on failure.

  • Move multiple files or folders to different locations at once in the user’s Dropbox. Note that we do not currently support case-only renaming. This route will replace moveBatch. The main difference is this route will return status for each entry, while moveBatch raises failure if any entry fails. This route will either finish synchronously, or return a job ID and do the async move job in background. Please use moveBatchCheckV2 to check the job status.

    Declaration

    Swift

    @discardableResult
    open func moveBatchV2(entries: Array<Files.RelocationPath>, autorename: Bool = false, allowOwnershipTransfer: Bool = false) -> RpcRequest<Files.RelocationBatchV2LaunchSerializer, VoidSerializer>

    Parameters

    allowOwnershipTransfer

    Allow moves by owner even if it would result in an ownership transfer for the content being moved. This does not apply to copies.

    Return Value

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

  • Returns the status of an asynchronous job for moveBatchV2. It returns list of results for each entry.

    Declaration

    Swift

    @discardableResult
    open func moveBatchCheckV2(asyncJobId: String) -> RpcRequest<Files.RelocationBatchV2JobStatusSerializer, 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 Files.RelocationBatchV2JobStatus object on success or a Async.PollError object on failure.

  • Creates a new Paper doc with the provided content.

    Declaration

    Swift

    @discardableResult
    open func paperCreate(path: String, importFormat: Files.ImportFormat, input: Data) -> UploadRequest<Files.PaperCreateResultSerializer, Files.PaperCreateErrorSerializer>

    Parameters

    path

    The fully qualified path to the location in the user’s Dropbox where the Paper Doc should be created. This should include the document’s title and end with .paper.

    importFormat

    The format of the provided data.

    input

    The file to upload, as an Data object.

    Return Value

    Through the response callback, the caller will receive a Files.PaperCreateResult object on success or a Files.PaperCreateError object on failure.

  • Creates a new Paper doc with the provided content.

    Declaration

    Swift

    @discardableResult
    open func paperCreate(path: String, importFormat: Files.ImportFormat, input: URL) -> UploadRequest<Files.PaperCreateResultSerializer, Files.PaperCreateErrorSerializer>

    Parameters

    path

    The fully qualified path to the location in the user’s Dropbox where the Paper Doc should be created. This should include the document’s title and end with .paper.

    importFormat

    The format of the provided data.

    input

    The file to upload, as an URL object.

    Return Value

    Through the response callback, the caller will receive a Files.PaperCreateResult object on success or a Files.PaperCreateError object on failure.

  • Creates a new Paper doc with the provided content.

    Declaration

    Swift

    @discardableResult
    open func paperCreate(path: String, importFormat: Files.ImportFormat, input: InputStream) -> UploadRequest<Files.PaperCreateResultSerializer, Files.PaperCreateErrorSerializer>

    Parameters

    path

    The fully qualified path to the location in the user’s Dropbox where the Paper Doc should be created. This should include the document’s title and end with .paper.

    importFormat

    The format of the provided data.

    input

    The file to upload, as an InputStream object.

    Return Value

    Through the response callback, the caller will receive a Files.PaperCreateResult object on success or a Files.PaperCreateError object on failure.

  • Updates an existing Paper doc with the provided content.

    Declaration

    Swift

    @discardableResult
    open func paperUpdate(path: String, importFormat: Files.ImportFormat, docUpdatePolicy: Files.PaperDocUpdatePolicy, paperRevision: Int64? = nil, input: Data) -> UploadRequest<Files.PaperUpdateResultSerializer, Files.PaperUpdateErrorSerializer>

    Parameters

    path

    Path in the user’s Dropbox to update. The path must correspond to a Paper doc or an error will be returned.

    importFormat

    The format of the provided data.

    docUpdatePolicy

    How the provided content should be applied to the doc.

    paperRevision

    The latest doc revision. Required when doc_update_policy is update. This value must match the current revision of the doc or error revision_mismatch will be returned.

    input

    The file to upload, as an Data object.

    Return Value

    Through the response callback, the caller will receive a Files.PaperUpdateResult object on success or a Files.PaperUpdateError object on failure.

  • Updates an existing Paper doc with the provided content.

    Declaration

    Swift

    @discardableResult
    open func paperUpdate(path: String, importFormat: Files.ImportFormat, docUpdatePolicy: Files.PaperDocUpdatePolicy, paperRevision: Int64? = nil, input: URL) -> UploadRequest<Files.PaperUpdateResultSerializer, Files.PaperUpdateErrorSerializer>

    Parameters

    path

    Path in the user’s Dropbox to update. The path must correspond to a Paper doc or an error will be returned.

    importFormat

    The format of the provided data.

    docUpdatePolicy

    How the provided content should be applied to the doc.

    paperRevision

    The latest doc revision. Required when doc_update_policy is update. This value must match the current revision of the doc or error revision_mismatch will be returned.

    input

    The file to upload, as an URL object.

    Return Value

    Through the response callback, the caller will receive a Files.PaperUpdateResult object on success or a Files.PaperUpdateError object on failure.

  • Updates an existing Paper doc with the provided content.

    Declaration

    Swift

    @discardableResult
    open func paperUpdate(path: String, importFormat: Files.ImportFormat, docUpdatePolicy: Files.PaperDocUpdatePolicy, paperRevision: Int64? = nil, input: InputStream) -> UploadRequest<Files.PaperUpdateResultSerializer, Files.PaperUpdateErrorSerializer>

    Parameters

    path

    Path in the user’s Dropbox to update. The path must correspond to a Paper doc or an error will be returned.

    importFormat

    The format of the provided data.

    docUpdatePolicy

    How the provided content should be applied to the doc.

    paperRevision

    The latest doc revision. Required when doc_update_policy is update. This value must match the current revision of the doc or error revision_mismatch will be returned.

    input

    The file to upload, as an InputStream object.

    Return Value

    Through the response callback, the caller will receive a Files.PaperUpdateResult object on success or a Files.PaperUpdateError object on failure.

  • Permanently delete the file or folder at a given path (see https://www.dropbox.com/en/help/40). If the given file or folder is not yet deleted, this route will first delete it. It is possible for this route to successfully delete, then fail to permanently delete. Note: This endpoint is only available for Dropbox Business apps.

    Declaration

    Swift

    @discardableResult
    open func permanentlyDelete(path: String, parentRev: String? = nil) -> RpcRequest<VoidSerializer, Files.DeleteErrorSerializer>

    Parameters

    path

    Path in the user’s Dropbox to delete.

    parentRev

    Perform delete if given “rev” matches the existing file’s latest “rev”. This field does not support deleting a folder.

    Return Value

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

  • Restore a specific revision of a file to the given path.

    Declaration

    Swift

    @discardableResult
    open func restore(path: String, rev: String) -> RpcRequest<Files.FileMetadataSerializer, Files.RestoreErrorSerializer>

    Parameters

    path

    The path to save the restored file.

    rev

    The revision to restore.

    Return Value

    Through the response callback, the caller will receive a Files.FileMetadata object on success or a Files.RestoreError object on failure.

  • Save the data from a specified URL into a file in user’s Dropbox. Note that the transfer from the URL must complete within 5 minutes, or the operation will time out and the job will fail. If the given path already exists, the file will be renamed to avoid the conflict (e.g. myfile (1).txt).

    Declaration

    Swift

    @discardableResult
    open func saveUrl(path: String, url: String) -> RpcRequest<Files.SaveUrlResultSerializer, Files.SaveUrlErrorSerializer>

    Parameters

    path

    The path in Dropbox where the URL will be saved to.

    url

    The URL to be saved.

    Return Value

    Through the response callback, the caller will receive a Files.SaveUrlResult object on success or a Files.SaveUrlError object on failure.

  • Check the status of a saveUrl job.

    Declaration

    Swift

    @discardableResult
    open func saveUrlCheckJobStatus(asyncJobId: String) -> RpcRequest<Files.SaveUrlJobStatusSerializer, 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 Files.SaveUrlJobStatus object on success or a Async.PollError object on failure.

  • Searches for files and folders. Note: searchV2 along with searchContinueV2 can only be used to retrieve a maximum of 10,000 matches. Recent changes may not immediately be reflected in search results due to a short delay in indexing. Duplicate results may be returned across pages. Some results may not be returned.

    Declaration

    Swift

    @discardableResult
    open func searchV2(query: String, options: Files.SearchOptions? = nil, matchFieldOptions: Files.SearchMatchFieldOptions? = nil, includeHighlights: Bool? = nil) -> RpcRequest<Files.SearchV2ResultSerializer, Files.SearchErrorSerializer>

    Parameters

    query

    The string to search for. May match across multiple fields based on the request arguments.

    options

    Options for more targeted search results.

    matchFieldOptions

    Options for search results match fields.

    includeHighlights

    Deprecated and moved this option to SearchMatchFieldOptions.

    Return Value

    Through the response callback, the caller will receive a Files.SearchV2Result object on success or a Files.SearchError object on failure.

  • Fetches the next page of search results returned from searchV2. Note: searchV2 along with searchContinueV2 can only be used to retrieve a maximum of 10,000 matches. Recent changes may not immediately be reflected in search results due to a short delay in indexing. Duplicate results may be returned across pages. Some results may not be returned.

    Declaration

    Swift

    @discardableResult
    open func searchContinueV2(cursor: String) -> RpcRequest<Files.SearchV2ResultSerializer, Files.SearchErrorSerializer>

    Parameters

    cursor

    The cursor returned by your last call to searchV2. Used to fetch the next page of results.

    Return Value

    Through the response callback, the caller will receive a Files.SearchV2Result object on success or a Files.SearchError object on failure.

  • Unlock the files at the given paths. A locked file can only be unlocked by the lock holder or, if a business account, a team admin. A successful response indicates that the file has been unlocked. Returns a list of the unlocked file paths and their metadata after this operation.

    Declaration

    Swift

    @discardableResult
    open func unlockFileBatch(entries: Array<Files.UnlockFileArg>) -> RpcRequest<Files.LockFileBatchResultSerializer, Files.LockFileErrorSerializer>

    Parameters

    entries

    List of ‘entries’. Each ‘entry’ contains a path of the file which will be unlocked. Duplicate path arguments in the batch are considered only once.

    Return Value

    Through the response callback, the caller will receive a Files.LockFileBatchResult object on success or a Files.LockFileError object on failure.

  • Create a new file with the contents provided in the request. Do not use this to upload a file larger than 150 MB. Instead, create an upload session with uploadSessionStart. Calls to this endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more information, see the Data transport limit page https://www.dropbox.com/developers/reference/data-transport-limit.

    Declaration

    Swift

    @discardableResult
    open func upload(path: String, mode: Files.WriteMode = .add, autorename: Bool = false, clientModified: Date? = nil, mute: Bool = false, propertyGroups: Array<FileProperties.PropertyGroup>? = nil, strictConflict: Bool = false, input: Data) -> UploadRequest<Files.FileMetadataSerializer, Files.UploadErrorSerializer>

    Parameters

    path

    Path in the user’s Dropbox to save the file.

    mode

    Selects what to do if the file already exists.

    autorename

    If there’s a conflict, as determined by mode, have the Dropbox server try to autorename the file to avoid conflict.

    clientModified

    The value to store as the clientModified timestamp. Dropbox automatically records the time at which the file was written to the Dropbox servers. It can also record an additional timestamp, provided by Dropbox desktop clients, mobile clients, and API apps of when the file was actually created or modified.

    mute

    Normally, users are made aware of any file modifications in their Dropbox account via notifications in the client software. If true, this tells the clients that this modification shouldn’t result in a user notification.

    propertyGroups

    List of custom properties to add to file.

    strictConflict

    Be more strict about how each WriteMode detects conflict. For example, always return a conflict error when mode = update in WriteMode and the given “rev” doesn’t match the existing file’s “rev”, even if the existing file has been deleted. This also forces a conflict even when the target path refers to a file with identical contents.

    input

    The file to upload, as an Data object.

    Return Value

    Through the response callback, the caller will receive a Files.FileMetadata object on success or a Files.UploadError object on failure.

  • Create a new file with the contents provided in the request. Do not use this to upload a file larger than 150 MB. Instead, create an upload session with uploadSessionStart. Calls to this endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more information, see the Data transport limit page https://www.dropbox.com/developers/reference/data-transport-limit.

    Declaration

    Swift

    @discardableResult
    open func upload(path: String, mode: Files.WriteMode = .add, autorename: Bool = false, clientModified: Date? = nil, mute: Bool = false, propertyGroups: Array<FileProperties.PropertyGroup>? = nil, strictConflict: Bool = false, input: URL) -> UploadRequest<Files.FileMetadataSerializer, Files.UploadErrorSerializer>

    Parameters

    path

    Path in the user’s Dropbox to save the file.

    mode

    Selects what to do if the file already exists.

    autorename

    If there’s a conflict, as determined by mode, have the Dropbox server try to autorename the file to avoid conflict.

    clientModified

    The value to store as the clientModified timestamp. Dropbox automatically records the time at which the file was written to the Dropbox servers. It can also record an additional timestamp, provided by Dropbox desktop clients, mobile clients, and API apps of when the file was actually created or modified.

    mute

    Normally, users are made aware of any file modifications in their Dropbox account via notifications in the client software. If true, this tells the clients that this modification shouldn’t result in a user notification.

    propertyGroups

    List of custom properties to add to file.

    strictConflict

    Be more strict about how each WriteMode detects conflict. For example, always return a conflict error when mode = update in WriteMode and the given “rev” doesn’t match the existing file’s “rev”, even if the existing file has been deleted. This also forces a conflict even when the target path refers to a file with identical contents.

    input

    The file to upload, as an URL object.

    Return Value

    Through the response callback, the caller will receive a Files.FileMetadata object on success or a Files.UploadError object on failure.

  • Create a new file with the contents provided in the request. Do not use this to upload a file larger than 150 MB. Instead, create an upload session with uploadSessionStart. Calls to this endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more information, see the Data transport limit page https://www.dropbox.com/developers/reference/data-transport-limit.

    Declaration

    Swift

    @discardableResult
    open func upload(path: String, mode: Files.WriteMode = .add, autorename: Bool = false, clientModified: Date? = nil, mute: Bool = false, propertyGroups: Array<FileProperties.PropertyGroup>? = nil, strictConflict: Bool = false, input: InputStream) -> UploadRequest<Files.FileMetadataSerializer, Files.UploadErrorSerializer>

    Parameters

    path

    Path in the user’s Dropbox to save the file.

    mode

    Selects what to do if the file already exists.

    autorename

    If there’s a conflict, as determined by mode, have the Dropbox server try to autorename the file to avoid conflict.

    clientModified

    The value to store as the clientModified timestamp. Dropbox automatically records the time at which the file was written to the Dropbox servers. It can also record an additional timestamp, provided by Dropbox desktop clients, mobile clients, and API apps of when the file was actually created or modified.

    mute

    Normally, users are made aware of any file modifications in their Dropbox account via notifications in the client software. If true, this tells the clients that this modification shouldn’t result in a user notification.

    propertyGroups

    List of custom properties to add to file.

    strictConflict

    Be more strict about how each WriteMode detects conflict. For example, always return a conflict error when mode = update in WriteMode and the given “rev” doesn’t match the existing file’s “rev”, even if the existing file has been deleted. This also forces a conflict even when the target path refers to a file with identical contents.

    input

    The file to upload, as an InputStream object.

    Return Value

    Through the response callback, the caller will receive a Files.FileMetadata object on success or a Files.UploadError object on failure.

  • Append more data to an upload session. When the parameter close is set, this call will close the session. A single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more information, see the Data transport limit page https://www.dropbox.com/developers/reference/data-transport-limit.

    Declaration

    Swift

    @discardableResult
    open func uploadSessionAppendV2(cursor: Files.UploadSessionCursor, close: Bool = false, input: Data) -> UploadRequest<VoidSerializer, Files.UploadSessionLookupErrorSerializer>

    Parameters

    cursor

    Contains the upload session ID and the offset.

    close

    If true, the current session will be closed, at which point you won’t be able to call uploadSessionAppendV2 anymore with the current session.

    input

    The file to upload, as an Data object.

    Return Value

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

  • Append more data to an upload session. When the parameter close is set, this call will close the session. A single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more information, see the Data transport limit page https://www.dropbox.com/developers/reference/data-transport-limit.

    Declaration

    Swift

    @discardableResult
    open func uploadSessionAppendV2(cursor: Files.UploadSessionCursor, close: Bool = false, input: URL) -> UploadRequest<VoidSerializer, Files.UploadSessionLookupErrorSerializer>

    Parameters

    cursor

    Contains the upload session ID and the offset.

    close

    If true, the current session will be closed, at which point you won’t be able to call uploadSessionAppendV2 anymore with the current session.

    input

    The file to upload, as an URL object.

    Return Value

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

  • Append more data to an upload session. When the parameter close is set, this call will close the session. A single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more information, see the Data transport limit page https://www.dropbox.com/developers/reference/data-transport-limit.

    Declaration

    Swift

    @discardableResult
    open func uploadSessionAppendV2(cursor: Files.UploadSessionCursor, close: Bool = false, input: InputStream) -> UploadRequest<VoidSerializer, Files.UploadSessionLookupErrorSerializer>

    Parameters

    cursor

    Contains the upload session ID and the offset.

    close

    If true, the current session will be closed, at which point you won’t be able to call uploadSessionAppendV2 anymore with the current session.

    input

    The file to upload, as an InputStream object.

    Return Value

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

  • Finish an upload session and save the uploaded data to the given file path. A single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more information, see the Data transport limit page https://www.dropbox.com/developers/reference/data-transport-limit.

    Declaration

    Swift

    @discardableResult
    open func uploadSessionFinish(cursor: Files.UploadSessionCursor, commit: Files.CommitInfo, input: Data) -> UploadRequest<Files.FileMetadataSerializer, Files.UploadSessionFinishErrorSerializer>

    Parameters

    cursor

    Contains the upload session ID and the offset.

    commit

    Contains the path and other optional modifiers for the commit.

    input

    The file to upload, as an Data object.

    Return Value

    Through the response callback, the caller will receive a Files.FileMetadata object on success or a Files.UploadSessionFinishError object on failure.

  • Finish an upload session and save the uploaded data to the given file path. A single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more information, see the Data transport limit page https://www.dropbox.com/developers/reference/data-transport-limit.

    Declaration

    Swift

    @discardableResult
    open func uploadSessionFinish(cursor: Files.UploadSessionCursor, commit: Files.CommitInfo, input: URL) -> UploadRequest<Files.FileMetadataSerializer, Files.UploadSessionFinishErrorSerializer>

    Parameters

    cursor

    Contains the upload session ID and the offset.

    commit

    Contains the path and other optional modifiers for the commit.

    input

    The file to upload, as an URL object.

    Return Value

    Through the response callback, the caller will receive a Files.FileMetadata object on success or a Files.UploadSessionFinishError object on failure.

  • Finish an upload session and save the uploaded data to the given file path. A single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. Calls to this endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more information, see the Data transport limit page https://www.dropbox.com/developers/reference/data-transport-limit.

    Declaration

    Swift

    @discardableResult
    open func uploadSessionFinish(cursor: Files.UploadSessionCursor, commit: Files.CommitInfo, input: InputStream) -> UploadRequest<Files.FileMetadataSerializer, Files.UploadSessionFinishErrorSerializer>

    Parameters

    cursor

    Contains the upload session ID and the offset.

    commit

    Contains the path and other optional modifiers for the commit.

    input

    The file to upload, as an InputStream object.

    Return Value

    Through the response callback, the caller will receive a Files.FileMetadata object on success or a Files.UploadSessionFinishError object on failure.

  • This route helps you commit many files at once into a user’s Dropbox. Use uploadSessionStart and uploadSessionAppendV2 to upload file contents. We recommend uploading many files in parallel to increase throughput. Once the file contents have been uploaded, rather than calling uploadSessionFinish, use this route to finish all your upload sessions in a single request. close in UploadSessionStartArg or close in UploadSessionAppendArg needs to be true for the last uploadSessionStart or uploadSessionAppendV2 call. The maximum size of a file one can upload to an upload session is 350 GB. This route will return a job_id immediately and do the async commit job in background. Use uploadSessionFinishBatchCheck to check the job status. For the same account, this route should be executed serially. That means you should not start the next job before current job finishes. We allow up to 1000 entries in a single request. Calls to this endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more information, see the Data transport limit page https://www.dropbox.com/developers/reference/data-transport-limit.

    Declaration

    Swift

    @discardableResult
    open func uploadSessionFinishBatch(entries: Array<Files.UploadSessionFinishArg>) -> RpcRequest<Files.UploadSessionFinishBatchLaunchSerializer, VoidSerializer>

    Parameters

    entries

    Commit information for each file in the batch.

    Return Value

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

  • Returns the status of an asynchronous job for uploadSessionFinishBatch. If success, it returns list of result for each entry.

    Declaration

    Swift

    @discardableResult
    open func uploadSessionFinishBatchCheck(asyncJobId: String) -> RpcRequest<Files.UploadSessionFinishBatchJobStatusSerializer, 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 Files.UploadSessionFinishBatchJobStatus object on success or a Async.PollError object on failure.

  • Upload sessions allow you to upload a single file in one or more requests, for example where the size of the file is greater than 150 MB. This call starts a new upload session with the given data. You can then use uploadSessionAppendV2 to add more data and uploadSessionFinish to save all the data to a file in Dropbox. A single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. An upload session can be used for a maximum of 7 days. Attempting to use an sessionId in UploadSessionStartResult with uploadSessionAppendV2 or uploadSessionFinish more than 7 days after its creation will return a notFound in UploadSessionLookupError. Calls to this endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more information, see the Data transport limit page https://www.dropbox.com/developers/reference/data-transport-limit. By default, upload sessions require you to send content of the file in sequential order via consecutive uploadSessionStart, uploadSessionAppendV2, uploadSessionFinish calls. For better performance, you can instead optionally use a concurrent in UploadSessionType upload session. To start a new concurrent session, set sessionType in UploadSessionStartArg to concurrent in UploadSessionType. After that, you can send file data in concurrent uploadSessionAppendV2 requests. Finally finish the session with uploadSessionFinish. There are couple of constraints with concurrent sessions to make them work. You can not send data with uploadSessionStart or uploadSessionFinish call, only with uploadSessionAppendV2 call. Also data uploaded in uploadSessionAppendV2 call must be multiple of 4194304 bytes (except for last uploadSessionAppendV2 with close in UploadSessionStartArg to true, that may contain any remaining data).

    Declaration

    Swift

    @discardableResult
    open func uploadSessionStart(close: Bool = false, sessionType: Files.UploadSessionType? = nil, input: Data) -> UploadRequest<Files.UploadSessionStartResultSerializer, Files.UploadSessionStartErrorSerializer>

    Parameters

    close

    If true, the current session will be closed, at which point you won’t be able to call uploadSessionAppendV2 anymore with the current session.

    sessionType

    Type of upload session you want to start. If not specified, default is sequential in UploadSessionType.

    input

    The file to upload, as an Data object.

    Return Value

    Through the response callback, the caller will receive a Files.UploadSessionStartResult object on success or a Files.UploadSessionStartError object on failure.

  • Upload sessions allow you to upload a single file in one or more requests, for example where the size of the file is greater than 150 MB. This call starts a new upload session with the given data. You can then use uploadSessionAppendV2 to add more data and uploadSessionFinish to save all the data to a file in Dropbox. A single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. An upload session can be used for a maximum of 7 days. Attempting to use an sessionId in UploadSessionStartResult with uploadSessionAppendV2 or uploadSessionFinish more than 7 days after its creation will return a notFound in UploadSessionLookupError. Calls to this endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more information, see the Data transport limit page https://www.dropbox.com/developers/reference/data-transport-limit. By default, upload sessions require you to send content of the file in sequential order via consecutive uploadSessionStart, uploadSessionAppendV2, uploadSessionFinish calls. For better performance, you can instead optionally use a concurrent in UploadSessionType upload session. To start a new concurrent session, set sessionType in UploadSessionStartArg to concurrent in UploadSessionType. After that, you can send file data in concurrent uploadSessionAppendV2 requests. Finally finish the session with uploadSessionFinish. There are couple of constraints with concurrent sessions to make them work. You can not send data with uploadSessionStart or uploadSessionFinish call, only with uploadSessionAppendV2 call. Also data uploaded in uploadSessionAppendV2 call must be multiple of 4194304 bytes (except for last uploadSessionAppendV2 with close in UploadSessionStartArg to true, that may contain any remaining data).

    Declaration

    Swift

    @discardableResult
    open func uploadSessionStart(close: Bool = false, sessionType: Files.UploadSessionType? = nil, input: URL) -> UploadRequest<Files.UploadSessionStartResultSerializer, Files.UploadSessionStartErrorSerializer>

    Parameters

    close

    If true, the current session will be closed, at which point you won’t be able to call uploadSessionAppendV2 anymore with the current session.

    sessionType

    Type of upload session you want to start. If not specified, default is sequential in UploadSessionType.

    input

    The file to upload, as an URL object.

    Return Value

    Through the response callback, the caller will receive a Files.UploadSessionStartResult object on success or a Files.UploadSessionStartError object on failure.

  • Upload sessions allow you to upload a single file in one or more requests, for example where the size of the file is greater than 150 MB. This call starts a new upload session with the given data. You can then use uploadSessionAppendV2 to add more data and uploadSessionFinish to save all the data to a file in Dropbox. A single request should not upload more than 150 MB. The maximum size of a file one can upload to an upload session is 350 GB. An upload session can be used for a maximum of 7 days. Attempting to use an sessionId in UploadSessionStartResult with uploadSessionAppendV2 or uploadSessionFinish more than 7 days after its creation will return a notFound in UploadSessionLookupError. Calls to this endpoint will count as data transport calls for any Dropbox Business teams with a limit on the number of data transport calls allowed per month. For more information, see the Data transport limit page https://www.dropbox.com/developers/reference/data-transport-limit. By default, upload sessions require you to send content of the file in sequential order via consecutive uploadSessionStart, uploadSessionAppendV2, uploadSessionFinish calls. For better performance, you can instead optionally use a concurrent in UploadSessionType upload session. To start a new concurrent session, set sessionType in UploadSessionStartArg to concurrent in UploadSessionType. After that, you can send file data in concurrent uploadSessionAppendV2 requests. Finally finish the session with uploadSessionFinish. There are couple of constraints with concurrent sessions to make them work. You can not send data with uploadSessionStart or uploadSessionFinish call, only with uploadSessionAppendV2 call. Also data uploaded in uploadSessionAppendV2 call must be multiple of 4194304 bytes (except for last uploadSessionAppendV2 with close in UploadSessionStartArg to true, that may contain any remaining data).

    Declaration

    Swift

    @discardableResult
    open func uploadSessionStart(close: Bool = false, sessionType: Files.UploadSessionType? = nil, input: InputStream) -> UploadRequest<Files.UploadSessionStartResultSerializer, Files.UploadSessionStartErrorSerializer>

    Parameters

    close

    If true, the current session will be closed, at which point you won’t be able to call uploadSessionAppendV2 anymore with the current session.

    sessionType

    Type of upload session you want to start. If not specified, default is sequential in UploadSessionType.

    input

    The file to upload, as an InputStream object.

    Return Value

    Through the response callback, the caller will receive a Files.UploadSessionStartResult object on success or a Files.UploadSessionStartError object on failure.