Authentication
Dropbox accounts
Files and metadata
File operations
Features in beta
REST API
The REST API is the underlying interface for all of our official Dropbox mobile apps and our SDKs. It's the most direct way to access the API. This reference document is designed for those interested in developing for platforms not supported by the SDKs or for those interested in exploring API features in detail.
General notes
SSL only
We require that all requests are done over SSL.
App folder access type
The default root level access type, app folder (as described in core concepts), is referenced in API URLs by its codename sandbox. This is the only place where such a distinction is made.
UTF-8 encoding
Every string passed to and from the Dropbox API needs to be UTF-8 encoded. For maximum compatibility, normalize to Unicode Normalization Form C (NFC) before UTF-8 encoding.
Version numbers
The current version of our API is version 1. Most version 0 methods will work for the time being, but some of its methods risk being removed (most notably, the version 0 API methods /token and /account).
Date format
All dates in the API are strings in the following format:
"Sat, 21 Aug 2010 22:31:20 +0000"
In code format, which can be used in all programming languages that support strftime or strptime:
"%a, %d %b %Y %H:%M:%S %z"
Locale global request parameter
Dropbox uses the locale parameter to specify language settings of content responses. If your app supports any language other than English, insert the appropriate IETF language tag. When a supported language is specified, Dropbox will returned translated size and/or user_error fields (where applicable).
Error handling
Errors are returned using standard HTTP error code syntax. Any additional info is included in the body of the return call, JSON-formatted. Error codes not listed here are in the REST API methods listed below.
Standard API errors
| Code | Description |
|---|---|
| 400 | Bad input parameter. Error message should indicate which one and why. |
| 401 | Bad or expired token. This can happen if the user or Dropbox revoked or expired an access token. To fix, you should re-authenticate the user. |
| 403 | Bad OAuth request (wrong consumer key, bad nonce, expired timestamp...). Unfortunately, re-authenticating the user won't help here. |
| 404 | File or folder not found at the specified path. |
| 405 | Request method not expected (generally should be GET or POST). |
| 503 | Your app is making too many requests and is being rate limited. 503s can trigger on a per-app or per-user basis. |
| 507 | User is over Dropbox storage quota. |
| 5xx | Server error. Check DropboxOps. |
Authentication methods
Dropbox uses OAuth to authenticate all API requests.
/oauth/request_token
- Description
-
Step 1 of authentication. Obtain an OAuth request token to be used for the rest of the authentication process.
This method corresponds to Obtaining an Unauthorized Request Token in the OAuth Core 1.0 specification.
- URL Structure
-
https://api.dropbox.com/1/oauth/request_token
- Versions
- 0, 1
- Method
- POST
- Parameters
-
There are no Dropbox-specific parameters for this method. See Consumer Obtains a Request Token in the OAuth Core 1.0 specification for a description of the OAuth parameters used for fetching a request token. Since this method is on behalf of an unauthenticated user, no access token or secret should be involved when signing or sending the request.
- Returns
-
A request token and the corresponding request token secret, URL-encoded. This token/secret pair is meant to be used with
/oauth/access_tokento complete the authentication process and cannot be used for any other API calls. See Service Provider Issues an Unauthorized Request Token in the OAuth Core 1.0 specification for additional discussion of the values returned when fetching a request token.Sample response
oauth_token_secret=b9q1n5il4lcc&oauth_token=mh7an9dkrg59
/oauth/authorize
- Description
-
Step 2 of authentication. Applications should direct the user to
/oauth/authorize. This isn't an API call per se, but rather a web endpoint that lets the user log in to Dropbox and choose whether to grant the application the ability to access files on their behalf. The page served by/oauth/authorizeshould be presented to the user through their web browser. Without the user's authorization in this step, it isn't possible for your application to obtain an access token from/oauth/access_token.This method corresponds to Obtaining User Authorization in the OAuth Core 1.0 specification.
- URL Structure
-
https://www.dropbox.com/1/oauth/authorize
Note: This is the only step that requires an endpoint on
www.dropbox.com. All other API requests are done viaapi.dropbox.comorapi-content.dropbox.com. For security's sake, please do not embed this webpage in your web app (e.g. via aniframe). The user must be redirected to the Dropbox website over HTTPS for unhindered and untampered authorization. As soon as authorization is accepted, the user will be redirected back to your website or to the website specified usingoauth_callback(more on that below). If the user declines to authorize your app, no redirect to your site will happen. - Versions
- 0, 1
- Method
- GET
- Parameters
-
oauth_token- Required. The request token obtained via/oauth/request_token.oauth_callback- After the user authorizes an application, the user is redirected to the application-served URL provided by this parameter.locale- If the locale specified is a supported language, Dropbox will direct users to a translated version of the authorization website. See the notes above for more information about supported locales.
- Returns
-
Because the application doesn't call
/oauth/authorizedirectly, there is no direct return value. After the user authorizes the application, use its request token to retrieve an access token via the/oauth/access_tokenAPI call. If theoauth_callbackparameter is omitted, the application must find some other way of determining when the authorization step is complete. For example, the application can have the user explicitly indicate to it that this step is complete, but this flow may be less intuitive for users than the redirect flow.If
oauth_callbackis specified, the application will know authorization is complete when the user is redirected to the given URL. Dropbox will provide the following return value via GET parameters in the URL:oauth_token- The request token that was just authorized. The request token secret isn't sent back.uid- The user's unique Dropbox ID.
/oauth/access_token
- Description
-
Step 3 of authentication. After the
/oauth/authorizestep is complete, the application can call/oauth/access_tokento acquire an access token.This method corresponds to Obtaining an Access Token in the OAuth Core 1.0 specification.
- URL Structure
https://api.dropbox.com/1/oauth/access_token
- Versions
- 0, 1
- Method
- POST
- Parameters
-
There are no Dropbox-specific parameters for this method. See Consumer Requests an Access Token in the OAuth Core 1.0 specification for a description of the parameters used for fetching an access token. Note that the
oauth_tokenandoauth_token_secretfor this method are the request token and request token secret obtained previously via/oauth/request_token. - Returns
-
URL-encoded access token, access token secret, and Dropbox user id. Upon return, the authorization process is now complete and the access token and corresponding secret can be used to sign requests for the main API calls. See Service Provider Grants an Access Token in the OAuth Core 1.0 specification for additional discussion of the values returned when fetching an access token. If your app is configured to work within an app folder, that folder is also created during this step.
Sample response
oauth_token_secret=95grkd9na7hm&oauth_token=ccl4li5n1q9b&uid=100
Dropbox accounts
/account/info
- Description
- Retrieves information about the user's account.
- URL Structure
https://api.dropbox.com/1/account/info
- Versions
- 0, 1
- Method
- GET
- Parameters
-
locale- Use to specify language settings for user error messages and other language specific text. See the notes above for more information about supported locales.
- Returns
-
User account information.
Sample JSON response
{ "referral_link": "https://www.dropbox.com/referrals/r1a2n3d4m5s6t7", "display_name": "John P. User", "uid": 12345678, "country": "US", "quota_info": { "shared": 253738410565, "quota": 107374182400000, "normal": 680031877871 } }Return value definitions
field description referral_linkThe user's referral link. display_nameThe user's display name. uidThe user's unique Dropbox ID. countryThe user's two-letter country code, if available. quota_info/normalThe user's used quota outside of shared folders (bytes). quota_info/sharedThe user's used quota in shared folders (bytes). quota_info/quotaThe user's total quota allocation (bytes).
Files and metadata
/files (GET)
- Description
- Downloads a file. Note that this call goes to the api-content server.
- URL Structure
https://api-content.dropbox.com/1/files/<root>/<path>
root- The root relative to whichpathis specified. Valid values aresandboxanddropbox.path- The path to the file you want to retrieve.
- Versions
- 0, 1
- Method
- GET
- Parameter
-
rev- The revision of the file to retrieve. This defaults to the most recent revision.
- Returns
-
The specified file's contents at the requested revision.
-
The HTTP response contains the content metadata in JSON format within an
x-dropbox-metadataheader. - Errors
-
404 The file wasn't found at the specified path, or wasn't found at the specified rev. - Notes
-
This method also supports HTTP Range Retrieval Requests to allow retrieving partial file contents.
/files_put
- Description
-
Uploads a file using PUT semantics. Note that this call goes to the api-content server.
This method is in most cases simpler to use than /files (POST).
- URL Structure
https://api-content.dropbox.com/1/files_put/<root>/<path>?param=val
root- The root relative to whichpathis specified. Valid values aresandboxanddropbox.path- The full path to the file you want to write to. This parameter should not point to a folder.param=val- The URL-encoded parameters for this request. They cannot be sent in the request body.
- Version
- 1
- Method
- PUT
- Parameters
-
- The body of the request - Required. The file contents to be uploaded. Since the entire PUT/POST body will be treated as the file, any parameters must be passed as part of the request URL. The request URL should be signed just as you would sign any other OAuth request URL.
locale- The metadata returned on successful upload will have itssizefield translated based on the given locale.overwrite- This value, eithertrue(default) orfalse, determines what happens when there's already a file at the specified path. Iftrue, the existing file will be overwritten by the new one. Iffalse, the new file will be automatically renamed (for example, test.txt might be automatically renamed to test (1).txt). The new name can be obtained from the returned metadata.parent_rev- The revision of the file you're editing. Ifparent_revmatches the latest version of the file on the user's Dropbox, that file will be replaced. Otherwise, the new file will be automatically renamed (for example, test.txt might be automatically renamed to test (conflicted copy).txt). If you specify a revision that doesn't exist, the file will not save (error 400). Get the most recentrevby performing a call to /metadata.
- Returns
-
The metadata for the uploaded file. More information on the returned metadata fields are available here.
Sample JSON response
{ "size": "225.4KB", "rev": "35e97029684fe", "thumb_exists": false, "bytes": 230783, "modified": "Tue, 19 Jul 2011 21:55:38 +0000", "path": "/Getting_Started.pdf", "is_dir": false, "icon": "page_white_acrobat", "root": "dropbox", "mime_type": "application/pdf", "revision": 220823 } - Errors
-
411 Chunked encoding was attempted for this upload, but is not supported by Dropbox. - Notes
-
There's a 150MB limit to all uploads through the API. Users looking to upload files larger than 150MB will have to do so through the Dropbox desktop application.
We strongly recommend providing a
Content-Lengthheader set to the size of the uploaded file so that the server can verify that it has received the entire file contents.
/files (POST)
- Description
Uploads a file. Note that this call goes to the api-content server.
We recommend you use /files_put instead due to its simpler interface.
- URL Structure
https://api-content.dropbox.com/1/files/<root>/<path>
root- The root relative to whichpathis specified. Valid values aresandboxanddropbox.path- The path to the folder the file should be uploaded to. This parameter should not point to a file.
- Versions
- 0, 1
- Method
- POST
- Parameters
-
file- Required. The file contents to be uploaded. We require a multipart upload (multipart/form-data), and thefilenameparameter of this field should be set to the desired destination filename. While signing this request for OAuth, thefileparameter should be set to the destination filename, and then switched to the file contents when preparing the multipart request.locale- The metadata returned on successful upload will have itssizefield translated based on the given locale.overwrite- This value, eithertrue(default) orfalse, determines what happens when there's already a file at the specified path. Iftrue, the existing file will be overwritten by the new one. Iffalse, the new file will be automatically renamed (for example, test.txt might be automatically renamed to test (1).txt). The new name can be obtained from the returned metadata.parent_rev- The revision of the file you're editing. Ifparent_revmatches the latest version of the file on the user's Dropbox, that file will be replaced. Otherwise, the new file will be automatically renamed (for example, test.txt might be automatically renamed to test (conflicted copy).txt). If you specify a revision that doesn't exist, the file will not save (error 400). Get the most recentrevby performing a call to /metadata.
- Returns
-
The metadata for the uploaded file. More information on the returned metadata fields are available here.
Sample JSON response
{ "size": "225.4KB", "rev": "35e97029684fe", "thumb_exists": false, "bytes": 230783, "modified": "Tue, 19 Jul 2011 21:55:38 +0000", "path": "/Getting_Started.pdf", "is_dir": false, "icon": "page_white_acrobat", "root": "dropbox", "mime_type": "application/pdf", "revision": 220823 } - Errors
-
400 The file extension is on Dropbox's ignore list (e.g. thumbs.db or .ds_store). 404 The parent_revof the file wasn't found.411 Chunked encoding was attempted for this upload, but is not supported by Dropbox. - Notes
-
There's a 150MB limit to all uploads through the API. Users looking to upload files larger than 150MB will have to do so through the Dropbox desktop application.
/metadata
- Description
- Retrieves file and folder metadata.
- URL Structure
https://api.dropbox.com/1/metadata/<root>/<path>
root- The root relative to whichpathis specified. Valid values aresandboxanddropbox.path- The path to the file or folder.
- Versions
- 0, 1
- Method
- GET
- Parameters
-
file_limit- Default is 10,000. When listing a folder, the service will not report listings containing more than the specified amount of files and will instead respond with a 406 (Not Acceptable) status response.hash- Each call to/metadataon a folder will return ahashfield, generated by hashing all of the metadata contained in that response. On later calls to/metadata, you should provide that value via this parameter so that if nothing has changed, the response will be a 304 (Not Modified) status code instead of the full, potentially very large, folder listing. This parameter is ignored if the specified path is associated with a file or iflist=false. A folder shared between two users will have the same hash for each user.list- The stringstrueandfalseare valid values.trueis the default. Iftrue, the folder's metadata will include acontentsfield with a list of metadata entries for the contents of the folder. Iffalse, thecontentsfield will be omitted.include_deleted- If this parameter is set to true, then files and folders that have been deleted will also be included in the metadata call.rev- If you include a particular revision number, then only the metadata for that revision will be returned.locale- The metadata returned will have itssizefield translated based on the given locale. For more information see above.
- Returns
-
The metadata for the file or folder at the given
<path>. If<path>represents a folder and thelistparameter istrue, the metadata will also include a listing of metadata for the folder's contents.Sample JSON return value for a file
{ "size": "225.4KB", "rev": "35e97029684fe", "thumb_exists": false, "bytes": 230783, "modified": "Tue, 19 Jul 2011 21:55:38 +0000", "path": "/Getting_Started.pdf", "is_dir": false, "icon": "page_white_acrobat", "root": "dropbox", "mime_type": "application/pdf", "revision": 220823 }Sample JSON return value for a folder when
listparameter is set totrue. Iflistisfalsethecontentskey will simply be omitted from the result.{ "size": "0 bytes", "hash": "37eb1ba1849d4b0fb0b28caf7ef3af52", "bytes": 0, "thumb_exists": false, "rev": "714f029684fe", "modified": "Wed, 27 Apr 2011 22:18:51 +0000", "path": "/Public", "is_dir": true, "icon": "folder_public", "root": "dropbox", "contents": [ { "size": "0 bytes", "rev": "35c1f029684fe", "thumb_exists": false, "bytes": 0, "modified": "Mon, 18 Jul 2011 20:13:43 +0000", "path": "/Public/latest.txt", "is_dir": false, "icon": "page_white_text", "root": "dropbox", "mime_type": "text/plain", "revision": 220191 } ], "revision": 29007 }Return value definitions
field description sizeA human-readable description of the file size (translated by locale).bytesThe file size in bytes. is_dirWhether the given entry is a folder or not. is_deletedWhether the given entry is deleted (only included if deleted files are being returned). revA unique identifier for the current revision of a file. This field is the same revas elsewhere in the API and can be used to detect changes and avoid conflicts.hashThe hashof a folder's metadata useful in later calls to/metadata.thumb_existsTrue if the file is an image can be converted to a thumbnail via the /thumbnailscall.iconThe name of the icon used to illustrate the file type in Dropbox's icon library. modifiedThe last time the file was modified on Dropbox, in the standard date format (not included for the root folder). rootThe root or top-level folder depending on your access level. All paths returned are relative to this root level. Permitted values are either dropboxorapp_folder.revisionA deprecated field that semi-uniquely identifies a file. Use revinstead.
Note:
modified,rev, andrevisionaren't returned in the metadata for the root/top-level path. - Errors
-
304 The folder contents have not changed (relies on hashparameter).406 There are too many file entries to return.
/revisions
- Description
Obtains metadata for the previous revisions of a file.
Only revisions up to thirty days old are available (or more if the Dropbox user has Pack-Rat). You can use the revision number in conjunction with the
/restorecall to revert the file to its previous state.- URL Structure
https://api.dropbox.com/1/revisions/<root>/<path>
root- The root relative to whichpathis specified. Valid values aresandboxanddropbox.path- The path to the file.
- Version
- 1
- Method
- GET
- Parameters
-
rev_limit- Default is 10. Max is 1,000. When listing a file, the service will not report listings containing more than the amount specified and will instead respond with a 406 (Not Acceptable) status response.locale- The metadata returned will have itssizefield translated based on the given locale. For more information see above.
- Returns
-
A list of all revisions formatted just like file metadata. More information on the returned metadata fields are available here.
Sample JSON return value
[ { "is_deleted": true, "revision": 4, "rev": "40000000d", "thumb_exists": false, "bytes": 0, "modified": "Wed, 20 Jul 2011 22:41:09 +0000", "path": "/hi2", "is_dir": false, "icon": "page_white", "root": "app_folder", "mime_type": "application/octet-stream", "size": "0 bytes" }, { "revision": 1, "rev": "10000000d", "thumb_exists": false, "bytes": 3, "modified": "Wed, 20 Jul 2011 22:40:43 +0000", "path": "/hi2", "is_dir": false, "icon": "page_white", "root": "app_folder", "mime_type": "application/octet-stream", "size": "3 bytes" } ] - Errors
-
406 Too many file entries to return.
/restore
- Description
-
Restores a file path to a previous revision.
Unlike downloading a file at a given revision and then re-uploading it, this call is atomic. It also saves a bunch of bandwidth.
- URL Structure
-
https://api.dropbox.com/1/restore/<root>/<path>
root- The root relative to whichpathis specified. Valid values aresandboxanddropbox.path- The path to the file.
- Version
- 1
- Method
- POST
- Parameters
-
rev- Required. The revision of the file to restore.locale- The metadata returned will have itssizefield translated based on the given locale. For more information see above.
- Returns
-
The metadata of the restored file. More information on the returned metadata fields are available here.
Sample JSON response
{ "is_deleted": true, "revision": 4, "rev": "40000000d", "thumb_exists": false, "bytes": 0, "modified": "Wed, 20 Jul 2011 22:41:09 +0000", "path": "/hi2", "is_dir": false, "icon": "page_white", "root": "sandbox", "mime_type": "application/octet-stream", "size": "0 bytes" } - Errors
-
404 Unable to find the revision at that path
/search
- Description
-
Returns metadata for all files and folders that match the search query.
Searches are limited to the folder path and its sub-folder hierarchy provided in the call.
- URL Structure
https://api.dropbox.com/1/search/<root>/<path>
root- The root relative to whichpathis specified. Valid values aresandboxanddropbox.path- The path to the folder you want to search from.
- Versions
- 0, 1
- Methods
- GET, POST
- Parameters
-
query- Required. The search string. Must be at least three characters long.file_limit- The maximum and default value is 1,000. No more thanfile_limitsearch results will be returned.include_deleted- If this parameter is set to true, then files and folders that have been deleted will also be included in the search.locale- The metadata returned will have itssizefield translated based on the given locale. For more information see above.
- Returns
-
List of metadata entries for any matching files and folders. More information on the returned metadata fields are available here.
Sample JSON return value for a search for .txt in Dropbox/Public folder
[ { "size": "0 bytes", "rev": "35c1f029684fe", "thumb_exists": false, "bytes": 0, "modified": "Mon, 18 Jul 2011 20:13:43 +0000", "path": "/Public/latest.txt", "is_dir": false, "icon": "page_white_text", "root": "dropbox", "mime_type": "text/plain", "revision": 220191 } ]
/media
- Description
-
Returns a link directly to a file.
Similar to
/shares. The difference is that this bypasses the Dropbox webserver, used to provide a preview of the file, so that you can effectively stream the contents of your media. - URL Structure
https://api.dropbox.com/1/media/<root>/<path>
root- The root relative to whichpathis specified. Valid values aresandboxanddropbox.path- The path to the media file you want a direct link to.
- Version
- 1
- Method
- POST
- Parameters
-
locale- Use to specify language settings for user error messages and other language specific text. See the notes above for more information about supported locales.
- Returns
-
A url that serves the media directly. Also returns the link's expiration date in Dropbox's usual date format.
Sample JSON return value for a file
{ 'url': 'http://www.dropbox.com/s/m/a2mbDa2', 'expires': 'Fri, 16 Sep 2011 01:01:25 +0000' } - Notes
- The
/medialink expires after four hours, allotting enough time to stream files, but not enough to leave a connection open indefinitely.
/thumbnails
- Description
- Gets a thumbnail for an image. Note that this call goes to the api-content server.
- URL Structure
https://api-content.dropbox.com/1/thumbnails/<root>/<path>
root- The root relative to whichpathis specified. Valid values aresandboxanddropbox.path- The path to the image file you want to thumbnail.
- Versions
- 0, 1
- Method
- GET
- Parameters
-
format-JPEG(default) orPNG. For images that are photos,JPEGshould be preferred, whilePNGis better for screenshots and digital art.-
size- One of the following values (defaultsmall):value dimensions (px) small32x32 medium64x64 large128x128 s64x64 m128x128 l640x480 xl1024x768
- Returns
-
A thumbnail of the specified image's contents.
-
The HTTP response contains the content metadata in JSON format within an
x-dropbox-metadataheader. - Errors
-
404 The file path wasn't found or the file extension doesn't allow conversion to a thumbnail. 415 The image is invalid and cannot be converted to a thumbnail. - Notes
-
This method currently supports files with the following file extensions: "jpg", "jpeg", "png", "tiff", "tif", "gif", and "bmp".
Photos that are larger than 20MB in size will not be converted to a thumbnail.
File operations
The various fileops calls provide the standard file operations. Files and folders can be moved, copied, or deleted. Folders can be created.
/fileops/copy
- Description
- Copies a file or folder to a new location.
- URL Structure
https://api.dropbox.com/1/fileops/copy
- Versions
- 0, 1
- Method
- POST
- Parameters
-
root- Required. The root relative to whichfrom_pathandto_pathare specified. Valid values aresandboxanddropbox.from_path- Specifies the file or folder to be copied from relative toroot.to_path- Required. Specifies the destination path, including the new name for the file or folder, relative toroot.locale- The metadata returned will have itssizefield translated based on the given locale. For more information see above.from_copy_ref- Feature in beta. Specifies a copy_ref generated from a previous /copy_ref_beta call. Must be used instead of thefrom_pathparameter.
- Returns
-
Metadata for the copy of the file or folder. More information on the returned metadata fields are available here.
Sample JSON response
{ "size": "15 bytes", "rev": "1f0a503351f", "thumb_exists": false, "bytes": 15, "modified": "Wed, 10 Aug 2011 18:21:29 +0000", "path": "/test1.txt", "is_dir": false, "icon": "page_white_text", "root": "dropbox", "mime_type": "text/plain", "revision": 496342 } - Errors
-
403 An invalid copy operation was attempted (e.g. there is already a file at the given destination, or copying a shared folder into a shared folder). 404 The source file wasn't found at the specified path. 406 Too many files would be involved in the operation for it to complete successfully. The limit is currently 10,000 files and folders.
/fileops/create_folder
- Description
- Creates a folder.
- URL Structure
https://api.dropbox.com/1/fileops/create_folder
- Versions
- 0, 1
- Method
- POST
- Parameters
-
root- Required. The root relative to whichpathis specified. Valid values aresandboxanddropbox.path- Required. The path to the new folder to create relative toroot.locale- The metadata returned will have itssizefield translated based on the given locale. For more information see above.
- Returns
-
Metadata for the new folder. More information on the returned metadata fields are available here.
Sample JSON response
{ "size": "0 bytes", "rev": "1f477dd351f", "thumb_exists": false, "bytes": 0, "modified": "Wed, 10 Aug 2011 18:21:30 +0000", "path": "/new_folder", "is_dir": true, "icon": "folder", "root": "dropbox", "revision": 5023410 } - Errors
-
403 There is already a folder at the given destination.
/fileops/delete
- Description
- Deletes a file or folder.
- URL Structure
https://api.dropbox.com/1/fileops/delete
- Versions
- 0, 1
- Method
- POST
- Parameters
-
root- Required. The root relative to whichpathis specified. Valid values aresandboxanddropbox.path- Required. The path to the file or folder to be deleted.locale- The metadata returned will have itssizefield translated based on the given locale. For more information see above.
- Returns
-
Metadata for the deleted file or folder. More information on the returned metadata fields are available here.
Sample JSON response
{ "size": "0 bytes", "is_deleted": true, "bytes": 0, "thumb_exists": false, "rev": "1f33043551f", "modified": "Wed, 10 Aug 2011 18:21:30 +0000", "path": "/test .txt", "is_dir": false, "icon": "page_white_text", "root": "dropbox", "mime_type": "text/plain", "revision": 492341 } - Errors
-
404 No file wasn't found at the specified path. 406 Too many files would be involved in the operation for it to complete successfully. The limit is currently 10,000 files and folders.
/fileops/move
- Description
- Moves a file or folder to a new location.
- URL Structure
https://api.dropbox.com/1/fileops/move
- Versions
- 0, 1
- Method
- POST
- Parameters
-
root- Required. The root relative to whichfrom_pathandto_pathare specified. Valid values aresandboxanddropbox.from_path- Required. Specifies the file or folder to be moved from relative toroot.to_path- Required. Specifies the destination path, including the new name for the file or folder, relative toroot.locale- The metadata returned will have itssizefield translated based on the given locale. For more information see above.
- Returns
-
Metadata for the moved file or folder. More information on the returned metadata fields are available here.
Sample JSON response
{ "size": "15 bytes", "rev": "1e0a503351f", "thumb_exists": false, "bytes": 15, "modified": "Wed, 10 Aug 2011 18:21:29 +0000", "path": "/test2.txt", "is_dir": false, "icon": "page_white_text", "root": "dropbox", "mime_type": "text/plain", "revision": 496342 } - Errors
-
403 An invalid move operation was attempted (e.g. there is already a file at the given destination, or moving a shared folder into a shared folder). 404 The source file wasn't found at the specified path. 406 Too many files would be involved in the operation for it to complete successfully. The limit is currently 10,000 files and folders.
Beta methods
The methods listed here are not yet ready for release and can run the gamut of functionality. They're released to the public a little earlier than usual to gather feedback, test usage, and general tinkering. These methods are subject to change and, as such, should not be used in production. Feedback is welcome in the Dropbox forums.
/delta_beta2
This method is in beta and may be subject to change or instability while it is tested. It's not available for use in production just yet. See our announcements page for the latest information.
- Description
- A way of letting you keep up with changes to files and folders in a user's Dropbox. You can periodically call
/delta_beta2to get a list of "delta entries", which are instructions on how to update your local state to match the server's state. - URL Structure
https://api.dropbox.com/1/delta_beta2
- Version
- 1
- Method
- POST
- Parameters
-
cursor- Optional. A string that is used to keep track of your current state. On the next call pass in this value to return delta entries that have been recorded since the cursor was returned.
- Returns
-
A JSON object with four fields
entries- A list of "delta entries" (described below).reset- If 'true', reset your local state to be an empty folder before processing the delta entries. This is only 'true' in rare situations.cursor- A string that encodes the latest information that has been returned. On the next call to delta(), pass in this value.has_more- If 'true', then there are more entries available; you can call delta() again immediately to retrieve those entries. If 'false', then wait for at least five minutes (preferably longer) before checking again.
Delta entries - Each entry is a 2-item list of one of the following forms:
[<path>, <metadata>]- Indicates that there is a file/folder at the given path. You should add the entry to your local path. (The metadata value is the same as what would be returned by the /metadata call.)- If the new entry includes parent folders that don't yet exist in your local state, create those parent folders in your local state.
- If the new entry is a file, replace whatever your local state has at path with the new entry.
- If the new entry is a folder, check what your local state has at <path>. If it's a file, replace it with the new entry. If it's a folder, apply the new <metadata> to the folder, but do not modify the folder's children.
[<path>, null]- Indicates that there is no file/folder at the given path. To update your local state to match, anything at path and all its children should be deleted. If your local state doesn't have anything at path, ignore this entry.
Note: Dropbox treats file names in a case-insensitive but case-preserving way. To facilitate this, the <path> values above are lower-cased versions of the actual path. The <metadata> value has the original case-preserved path.
/copy_ref_beta
This method is in beta and may be subject to change or instability while it is tested. It's not available for use in production just yet. See our announcements page for the latest information.
- Description
-
Creates and returns a copy_ref to a file. This reference string can be used to copy that file to another user's Dropbox by passing it in as the
from_copy_refparameter on /fileops/copy. - URL Structure
https://api.dropbox.com/1/copy_ref/<root>/<path>
root- The root relative to whichpathis specified. Valid values aresandboxanddropbox.path- The path to the file you want a copy_ref to refer to.
- Versions
- 1
- Method
- GET
- Returns
-
A copy_ref to the specified file. Also returns the copy_ref's expiration date in Dropbox's usual date format.
Sample JSON return value for a file
{ "copy_ref": "z1X6ATl6aWtzOGq0c3g5Ng", "expires": "Fri, 31 Jan 2042 21:01:05 +0000" }