See Release Notes
Long Term Support Release
Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401]
Dropbox V2 API.
Copyright: | Andrew Nicols <andrew@nicols.co.uk> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 411 lines (14 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
dropbox:: (19 methods):
__construct()
get_login_scopes()
auth_url()
token_url()
get_api_endpoint()
get_content_endpoint()
get_endpoint_for_continue()
fetch_dropbox_data()
has_additional_results()
fetch_dropbox_content()
check_and_handle_api_errors()
get_listing()
search()
supports_thumbnail()
get_thumbnail()
get_file_share_info()
normalize_file_share_info()
callback()
logout()
__construct(issuer $issuer, $callback) X-Ref |
Create the DropBox API Client. param: issuer $issuer The dropbox issuer param: string $callback The callback URL |
get_login_scopes() X-Ref |
Override - Return an empty string to override parent function. Dropbox does not require scopes to be provided and can function without them. Additional information MDL-70268 return: string |
auth_url() X-Ref |
Returns the auth url for OAuth 2.0 request. return: string the auth url |
token_url() X-Ref |
Returns the token url for OAuth 2.0 request. return: string the auth url |
get_api_endpoint($endpoint) X-Ref |
Return the constructed API endpoint URL. param: string $endpoint The endpoint to be contacted return: moodle_url The constructed API URL |
get_content_endpoint($endpoint) X-Ref |
Return the constructed content endpoint URL. param: string $endpoint The endpoint to be contacted return: moodle_url The constructed content URL |
get_endpoint_for_continue(string $endpoint) X-Ref |
Get the continue endpoint for the provided endpoint. param: string $endpoint The original endpoint return: string $endpoint The generated/mapped continue link |
fetch_dropbox_data($endpoint, $data = [], string $resultnode = 'entries') X-Ref |
Make an API call against the specified endpoint with supplied data. param: string $endpoint The endpoint to be contacted param: array $data Any data to pass to the endpoint param: string $resultnode The name of the node that contains the data return: object Content decoded from the endpoint |
has_additional_results($result) X-Ref |
Whether the supplied result is paginated and not the final page. param: object $result The result of an operation return: boolean |
fetch_dropbox_content($endpoint, $data = []) X-Ref |
Fetch content from the specified endpoint with the supplied data. param: string $endpoint The endpoint to be contacted param: array $data Any data to pass to the endpoint return: string The returned data |
check_and_handle_api_errors($data) X-Ref |
Check for an attempt to handle API errors. This function attempts to deal with errors as per https://www.dropbox.com/developers/documentation/http/documentation#error-handling. param: mixed $data The returned content. |
get_listing($path = '') X-Ref |
Get file listing from dropbox. param: string $path The path to query return: object The returned directory listing, or null on failure |
search($query = '') X-Ref |
Get file search results from dropbox. param: string $query The search query return: object The returned directory listing, or null on failure |
supports_thumbnail($entry) X-Ref |
Whether the entry is expected to have a thumbnail. See docs at https://www.dropbox.com/developers/documentation/http/documentation#files-get_thumbnail. param: object $entry The file entry received from the DropBox API return: boolean Whether dropbox has a thumbnail available |
get_thumbnail($path) X-Ref |
Retrieves the thumbnail for the content, as supplied by dropbox. param: string $path The path to fetch a thumbnail for return: string Thumbnail image content |
get_file_share_info($id) X-Ref |
Fetch a valid public share link for the specified file. param: string $id The file path or file id of the file to fetch information for. return: object An object containing the id, path, size, and URL of the entry |
normalize_file_share_info($entry) X-Ref |
Normalize the file share info. param: object $entry Information retrieved from share endpoints return: object Normalized entry information to store as repository information |
callback() X-Ref |
Process the callback. |
logout() X-Ref |
Revoke the current access token. return: string |