1. Core Dropbox API: File and Folder Management
The Dropbox API provides powerful endpoints for managing files and folders in the cloud. This allows users to upload, download, organize, and delete files, as well as create and manage folders.
Key Endpoints:
Upload Files:
- Endpoint:
POST /2/files/upload
- Description: Upload a file to Dropbox. This endpoint requires the file’s metadata (name, path, etc.) and the content itself. It’s optimized for large file uploads and supports resuming uploads.
Download Files:
- Endpoint:
POST /2/files/download
- Description: Allows users to download a file from Dropbox. The response is the file content, so it can be saved locally on the user’s device.
List Folder:
- Endpoint:
POST /2/files/list_folder
- Description: Retrieves metadata for the files and folders in a specific directory. This is essential for building file explorers and browsing the user’s Dropbox storage.
Create Folder:
- Endpoint:
POST /2/files/create_folder_v2
- Description: This endpoint allows users to create a new folder in their Dropbox storage.
Delete File/Folder:
- Endpoint:
POST /2/files/delete_v2
- Description: This endpoint deletes a file or folder from Dropbox permanently.
Move/Copy Files:
- Endpoint:
POST /2/files/move_v2
,POST /2/files/copy_v2
- Description: Moves or copies a file or folder within Dropbox storage.
Get Metadata:
- Endpoint:
POST /2/files/get_metadata
- Description: Retrieves the metadata of a file or folder (such as name, size, path, modification time, etc.).
2. Authentication APIs
Dropbox uses OAuth 2.0 for authentication, which is a standard protocol for token-based authentication. It allows third-party applications to securely access Dropbox on behalf of users without needing to store sensitive credentials.
Key Endpoints:
OAuth 2.0 Authorization Flow:
- Endpoint:
GET /oauth2/authorize
- Description: Redirects the user to Dropbox’s authentication page where they can authorize the application to access their Dropbox account. Once authorized, the application receives an authorization code.
Exchange Authorization Code for Access Token:
- Endpoint:
POST /oauth2/token
- Description: After the user authorizes access, the application exchanges the authorization code for an access token, which can be used to authenticate API requests.
Revoke Access Token:
- Endpoint:
POST /oauth2/revoke
- Description: This endpoint allows the revocation of an access token, effectively logging the user out of the application.
Check User Account:
- Endpoint:
POST /2/users/get_current_account
- Description: Retrieve the current user’s account information, such as their display name, email, and account ID, to confirm the logged-in user.
3. File Sharing API
Dropbox allows users to share files and folders with other users, either by sending direct invites or by generating a public link.
Key Endpoints:
Create Shared Link:
- Endpoint:
POST /2/sharing/create_shared_link_with_settings
- Description: Create a public or private link to a file or folder. This link can be shared with others, and you can set permissions (view or edit).
List Shared Links:
- Endpoint:
POST /2/sharing/list_shared_links
- Description: Retrieves all shared links for a specific user or file. You can query by file path or by the user’s account.
Unshare File:
- Endpoint:
POST /2/sharing/revoke_shared_link
- Description: Revokes a shared link, which makes the file or folder no longer accessible via that link.
Invite Members to Shared Folder:
- Endpoint:
POST /2/sharing/add_folder_member
- Description: Allows adding team members or external users to a shared folder. Users can have different roles (e.g., editor or viewer).
4. Dropbox Paper API
Dropbox Paper is a collaborative workspace where teams can work together on documents. It integrates with the Dropbox ecosystem and allows users to create, share, and collaborate on rich media documents.
Key Endpoints:
Create Paper Doc:
- Endpoint:
POST /2/paper/docs/create
- Description: Create a new document in Dropbox Paper. You can define document content in the request body.
Get Paper Document Metadata:
- Endpoint:
POST /2/paper/docs/get_metadata
- Description: Fetch metadata related to a Paper document, such as title, creator, last modified time, and document ID.
Update Paper Document:
- Endpoint:
POST /2/paper/docs/update
- Description: Update the content of an existing Paper document.
List Paper Documents:
- Endpoint:
POST /2/paper/docs/list
- Description: Lists the documents within the authenticated user’s Dropbox Paper account.
5. Search API
Dropbox offers a powerful search feature to allow users to search for files and folders across their Dropbox account, including their Paper docs and metadata.
Key Endpoints:
Search Files:
- Endpoint:
POST /2/files/search_v2
- Description: Allows searching for files or folders within Dropbox by specifying search terms. The response includes a list of files and folders that match the search query.
Search Paper Docs:
- Endpoint:
POST /2/paper/docs/search
- Description: Allows searching through Dropbox Paper documents for specific content or keywords.
6. Webhooks API
Webhooks allow Dropbox to notify external applications about changes in a user’s Dropbox account. For example, if a file is modified or deleted, Dropbox can send an HTTP request to your server with the change event.
Key Endpoints:
Create Webhook Subscription:
- Endpoint:
POST /2/webhooks/list_subscriptions
- Description: Subscribes a user to Dropbox webhook notifications. The external system is notified whenever a change happens to a file or folder in the user’s Dropbox account.
Delete Webhook Subscription:
- Endpoint:
POST /2/webhooks/delete_subscription
- Description: Removes a webhook subscription, stopping further notifications from Dropbox.
7. Team APIs (For Dropbox Business)
Dropbox offers additional functionality for teams and organizations (such as managing shared workspaces, user roles, and teams). These APIs help admins manage and track team activity.
Key Endpoints:
List Members of a Team:
- Endpoint:
POST /2/team/members/list
- Description: Lists all members of a Dropbox Business team.
Add Members to a Team:
- Endpoint:
POST /2/team/members/add
- Description: Adds one or more members to a Dropbox Business team.
Remove Member from a Team:
- Endpoint:
POST /2/team/members/remove
- Description: Removes a member from a team. This could be a user who no longer requires access.