If a function fails, this property will contain the last error as a string message, otherwise it will be undefined
.
Execute a request against the Dropbox API for an endpoint of Content Download type. For successful requests, the HTTPResponse object will contain an raw data in the responseData
property and, if the data can be converted to a string value, the text version in the responseText
property. The HTTPResponse otherData
property will contain a Javascript object decoded from the JSON returned in the Dropbox-API-Result
header. Refer to Dropbox's API documentation for details about the expected parameters and responses. Drafts will handle wrapping the request in the appropriate OAuth authentication flow.
Object containing options for the request.
Execute a request against the Dropbox API for an endpoint of Content Upload type. For successful requests, the HTTPResponse object will contain an object or array or objects decoded from the JSON returned by Dropbox as appropriate to the request made. Refer to Dropbox's API documentation for details about the expected parameters and responses. Drafts will handle wrapping the request in the appropriate OAuth authentication flow.
Object containing options for the request.
Execute a request against the Dropbox API for an endpoint of RPC type. For successful requests, the HTTPResponse object will contain an object or array or objects decoded from the JSON returned by Dropbox as appropriate to the request made. Refer to Dropbox's API documentation for details about the expected parameters and responses. Drafts will handle wrapping the request in the appropriate OAuth authentication flow.
Object containing options for the request.
Write the contents of the file at the path. Returns true if successful, false if the file could not be written successfully. This will override existing files!
Path related to root of Dropbox folder.
Text to write to file.
Either "add" or "overwrite" to determine if the write method should overwrite an existing file at the path if it exists.
Static
create
Dropbox objects can be used to work with files in a Dropbox account. The
read
andwrite
methods are simple wrappers for uploading and reading content of files on Dropbox.For advanced uses, the
rpcRequest
,contentUploadRequest
andcontentDownloadRequest
methods enable direct use of any Dropbox API 2.0 endpoints. These methods are an advanced feature which return raw results from the Dropbox API and may require advanced understanding of the API to process the results. They do enable full access to the API, however, which enabled things like querying files, listing folder contents, uploading to Paper, etc. For details on availalbe methods, see Dropbox API documentation. In the case of all of these methods Drafts takes care of the OAuth request signing and authentication process when necessary.Example