{"id":2013,"library":"dropbox","title":"Dropbox API Client","description":"The official Dropbox API Client for Python (v12.0.2) allows programmatic interaction with Dropbox services. It provides a comprehensive interface for file management, sharing, user account information, and more. The library maintains an active development cycle, with frequent updates often driven by API specification changes.","status":"active","version":"12.0.2","language":"en","source_language":"en","source_url":"https://github.com/dropbox/dropbox-sdk-python","tags":["cloud storage","file management","api client","dropbox","oauth"],"install":[{"cmd":"pip install dropbox","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Used for underlying HTTP requests; incorrect pinning was fixed in v12.0.1.","package":"requests","optional":false},{"reason":"Used for underlying HTTP connections; unpinned in v12.0.2.","package":"urllib3","optional":false},{"reason":"Internal dependency for API schema generation and serialization.","package":"stone","optional":false}],"imports":[{"symbol":"Dropbox","correct":"import dropbox\ndbx = dropbox.Dropbox(...)"},{"symbol":"AuthError","correct":"from dropbox.exceptions import AuthError"},{"symbol":"ApiError","correct":"from dropbox.exceptions import ApiError"}],"quickstart":{"code":"import os\nimport dropbox\nfrom dropbox.exceptions import AuthError, ApiError\n\nDROPBOX_ACCESS_TOKEN = os.environ.get('DROPBOX_ACCESS_TOKEN', '')\n\nif not DROPBOX_ACCESS_TOKEN:\n    print(\"Error: DROPBOX_ACCESS_TOKEN environment variable not set.\")\n    print(\"Please set it to your Dropbox API access token.\")\n    exit(1)\n\ntry:\n    # Initialize Dropbox client\n    dbx = dropbox.Dropbox(DROPBOX_ACCESS_TOKEN)\n\n    # Test connection by listing files in the root folder\n    print(\"\\nConnected to Dropbox. Listing root folder content...\")\n    response = dbx.files_list_folder('')\n    \n    for entry in response.entries:\n        print(f\"  {entry.name} ({type(entry).__name__})\")\n\n    print(\"\\nSuccessfully listed folder content.\")\n\nexcept AuthError:\n    print(\"Error: Invalid or expired access token. Please check DROPBOX_ACCESS_TOKEN.\")\nexcept ApiError as err:\n    print(f\"API Error: {err}\")\nexcept Exception as err:\n    print(f\"An unexpected error occurred: {err}\")\n","lang":"python","description":"This quickstart demonstrates how to authenticate with the Dropbox API using an access token loaded from the `DROPBOX_ACCESS_TOKEN` environment variable and then list the contents of your Dropbox root folder."},"warnings":[{"fix":"For specific SSL needs, provide your CA certificate path: `dbx = dropbox.Dropbox(token, ca_certs='/path/to/your/ca.pem')`","message":"Starting with v12.0.0, the SDK no longer provides a hardcoded CA bundle. If your environment requires specific SSL certificate handling or you relied on the internal bundle, you may need to explicitly provide a `ca_certs` argument to the `Dropbox` client.","severity":"breaking","affected_versions":">=12.0.0"},{"fix":"Upgrade to `dropbox==12.0.2` or later to resolve potential dependency conflicts.","message":"Versions prior to v12.0.2 had incorrect or overly strict dependency pinning for `requests` and `urllib3`, which could lead to conflicts with other libraries in your environment. These issues were resolved in v12.0.2.","severity":"gotcha","affected_versions":"<12.0.2"},{"fix":"Ensure you are using a generated access token (e.g., from the Dropbox App Console or obtained via the OAuth flow after exchanging a code) when initializing the client. Store it securely, preferably in an environment variable.","message":"The `dropbox.Dropbox` client constructor expects a long-lived 'access token' (e.g., for OAuth2 or personal apps), not a short-lived 'authorization code'. Attempting to use an authorization code directly will result in an `AuthError`.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}