{"id":20935014,"url":"https://github.com/leandrosardi/my-dropbox-api","last_synced_at":"2026-03-06T15:30:56.031Z","repository":{"id":152046903,"uuid":"625204061","full_name":"leandrosardi/my-dropbox-api","owner":"leandrosardi","description":"Ruby gem for managing DropBox uploading, downloading and sharing DropBox files and folders.","archived":false,"fork":false,"pushed_at":"2025-03-18T18:19:45.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-09T21:29:38.946Z","etag":null,"topics":["dropbox","dropbox-api","dropbox-client","dropbox-sdk","dropbox-uploader","dropbox-v2"],"latest_commit_sha":null,"homepage":"https://ConnectionSphere.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leandrosardi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-04-08T11:38:54.000Z","updated_at":"2025-08-24T14:40:28.000Z","dependencies_parsed_at":"2025-05-13T20:32:40.131Z","dependency_job_id":"079c6b53-0206-406c-829c-0c0bd184b82d","html_url":"https://github.com/leandrosardi/my-dropbox-api","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/leandrosardi/my-dropbox-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandrosardi%2Fmy-dropbox-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandrosardi%2Fmy-dropbox-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandrosardi%2Fmy-dropbox-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandrosardi%2Fmy-dropbox-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leandrosardi","download_url":"https://codeload.github.com/leandrosardi/my-dropbox-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandrosardi%2Fmy-dropbox-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30183410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T14:42:24.748Z","status":"ssl_error","status_checked_at":"2026-03-06T14:42:14.925Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dropbox","dropbox-api","dropbox-client","dropbox-sdk","dropbox-uploader","dropbox-v2"],"created_at":"2024-11-18T22:12:32.737Z","updated_at":"2026-03-06T15:30:55.992Z","avatar_url":"https://github.com/leandrosardi.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GitHub issues](https://img.shields.io/github/issues/leandrosardi/my-dropbox-api) ![GitHub](https://img.shields.io/github/license/leandrosardi/my-dropbox-api) ![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/leandrosardi/my-dropbox-api) ![GitHub last commit](https://img.shields.io/github/last-commit/leandrosardi/my-dropbox-api)\n\n\n#### Why Not Amazon S3?\n\n**Cost Considerations:** Even if S3 is more suitable for programming, keep in mind that increased operations may lead to higher costs. Amazon charges per API request, and high volumes of upload operations will raise your expenses.\n\nDropbox doesn't charges per API call, but manages rate-limit for API calls. \n\nThe `my-dropbox-api` handles the files uploading asyncroniously to meet with such a rate-limit, and keep your costs low at the same time!\n\n**THIS LIBRARY IS UNDER CONSTRUCTION**\n\n# my-dropbox-api\n\nThe **my-dropbox-api** is a Ruby gem for managing DropBox uploading, downloading and sharing DropBox files and folders.\n\nThe main goals of building this gem are:\n\n1. Simulate a **permanent access token**, since [Dropbox is moving to \"short-term live access codes\"](https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Permanent-access-token/td-p/592644);\n\n2. Manage DropBox as an elastic-storage providers for [our SaaS projects](https://github.com/leandrosardi/mysaas), allowing us to upload, download and share download links to files;\n\n3. Backup and restore secret files of our projects that cannot be commited into the source code repository (E.g.: database passwords, SSL certificates, private keys).\n\n## 1. Getting DropBox Refresh Token\n\n1. Open a new browser, and login to your DropBox account.\n\n2. In the same browser, go to this link:\nhttps://www.dropbox.com/oauth2/authorize?client_id=lnystcoayzse5at\u0026token_access_type=offline\u0026response_type=code\n\n3. Follow the steps, and copy the \"Access Code\" to your clipboard.\n![image](https://user-images.githubusercontent.com/55877846/215112803-4f4b08b3-5fa5-45f9-ac27-b1d1aba5ba2e.png)\n\n4. Since Dropbox's \"Access Codes\" are short-term lived, you need to generate a \"Refresh Token\".\nWe have published a helper page where you can get such a Refresh Token:\nhttps://connectionsphere.com/developers/dss\n\nNote that you have to signup to ConnectionSphere to access this screen.\n\n![image](https://user-images.githubusercontent.com/55877846/215155561-ed1c915f-e585-49bd-957d-4e9cc60d3f02.png)\n\n\nAfter you have performed these steps, you can find a new `/Apps/mysaas-backups`, as is shown in the picture below.\n\n![Image](https://user-images.githubusercontent.com/55877846/227719530-1d0ce570-0844-49cb-a33f-f91538b97e84.png)\n\nAll the files and folders managed by **my-dropbox-api** will be scoped to that folder.\n\n## 2. Getting ConnectionSphere API Key\n\n1. Signup to ConnectionSphere [here](https://connectionsphere.com/signup).\n\n2. Get your API-KEY [here](https://connectionsphere.com/settings/apikey).\n\n## 3. Getting Started\n\nInstall **my-dropbox-api** gem.\n\n```bash\ngem install my-dropbox-api\n```\n\nSetup **my-dropbox-api** to access DropBox account.\n\n```ruby\nrequires 'my-dropbox-api'\n\nBlackStack::DropBox.set({\n    :vymeco_api_key =\u003e '118f3c32-c920-******',\n    :dropbox_refresh_token =\u003e 'dh4UcV4dFVs******',\n})\n```\n\n## 4. Creating Folders\n\n```ruby\n# Create a folder\nputs BlackStack::DropBox.dropbox_create_folder('/my-first-folder')\n# =\u003e {\"metadata\": {\"name\": \"my-first-folder\", \"path_lower\": \"/my-first-folder\", \"path_display\": \"/my-first-folder\", \"id\": \"id:Vtyvsunm9sMAAAAAAAAACA\"}}\n\n# Create a sub-folder\nputs BlackStack::DropBox.dropbox_create_folder('/my-first-folder/my-first-sub-folder')\n# =\u003e {\"metadata\": {\"name\": \"my-first-sub-folder\", \"path_lower\": \"/my-first-folder/my-first-sub-folder\", \"path_display\": \"/my-first-folder/my-first-sub-folder\", \"id\": \"id:Vtyvsunm9sMAAAAAAAAACQ\"}}\n```\n\n## 5. Uploading Files\n\n```ruby\n# Create a local folder\n\n# Create a local file\nFile.open('/tmp/my-first-file.txt', 'w') { |file| file.write('Hello World!') }\n\n# Upload file\nputs BlackStack::DropBox.dropbox_upload_file('/tmp/my-first-file.txt', '/my-first-folder/my-first-file.txt')\n# =\u003e {\"name\": \"my-first-file.txt\", \"path_lower\": \"/my-first-folder/my-first-file.txt\", \"path_display\": \"/my-first-folder/my-first-file.txt\", \"id\": \"id:Vtyvsunm9sMAAAAAAAAACw\", \"client_modified\": \"2023-03-25T14:20:36Z\", \"server_modified\": \"2023-03-25T14:20:37Z\", \"rev\": \"5f7ba36b1776ce01d7d61\", \"size\": 12, \"is_downloadable\": true, \"content_hash\": \"61f417374f4400b47dcae1a8f402d4f4dacf455a0442a06aa455a447b0d4e170\"}\n```\n\n## 6. Uploading Folder Structures\n\nUse `BlackStack::DropBox.upload` if you want to upload a folder, with all its sub-folders and files, recusivelly.\n\nThis method returns an array with a hash descritor of each operation performed.\n\n```ruby\n# Create a local folder\nDir.mkdir('/tmp/my-second-folder')\n\n# Ceate a local sub-folder\nDir.mkdir('/tmp/my-second-folder/my-second-sub-folder')\n\n# Create a local file into the sub-folder\nFile.open('/tmp/my-second-folder/my-second-sub-folder/my-second-file.txt', 'w') { |file| file.write('Hello World!') }\n\n# Upload file\nret = BlackStack::DropBox.upload('/tmp/my-second-folder', '/')\nputs ret.join(\"\\n\")\n# =\u003e {:file=\u003e\"my-second-folder\", :type=\u003e\"folder\", :result=\u003e\"{\\\"metadata\\\": {\\\"name\\\": \\\"my-second-folder\\\", \\\"path_lower\\\": \\\"/my-second-folder\\\", \\\"path_display\\\": \\\"/my-second-folder\\\", \\\"id\\\": \\\"id:Vtyvsunm9sMAAAAAAAAAEQ\\\"}}\"}\n# =\u003e {:file=\u003e\"my-second-sub-folder\", :type=\u003e\"folder\", :result=\u003e\"{\\\"metadata\\\": {\\\"name\\\": \\\"my-second-sub-folder\\\", \\\"path_lower\\\": \\\"/my-second-folder/my-second-sub-folder\\\", \\\"path_display\\\": \\\"/my-second-folder/my-second-sub-folder\\\", \\\"id\\\": \\\"id:Vtyvsunm9sMAAAAAAAAAEg\\\"}}\"}\n# =\u003e {:file=\u003e\"my-second-file.txt\", :type=\u003e\"file\", :result=\u003e\"{\\\"name\\\": \\\"my-second-file.txt\\\", \\\"path_lower\\\": \\\"/my-second-folder/my-second-sub-folder/my-second-file.txt\\\", \\\"path_display\\\": \\\"/my-second-folder/my-second-sub-folder/my-second-file.txt\\\", \\\"id\\\": \\\"id:Vtyvsunm9sMAAAAAAAAAEw\\\", \\\"client_modified\\\": \\\"2023-03-25T15:17:28Z\\\", \\\"server_modified\\\": \\\"2023-03-25T15:17:28Z\\\", \\\"rev\\\": \\\"5f7bb020690c7e01d7d61\\\", \\\"size\\\": 12, \\\"is_downloadable\\\": true, \\\"content_hash\\\": \\\"61f417374f4400b47dcae1a8f402d4f4dacf455a0442a06aa455a447b0d4e170\\\"}\"}\n```\n\n## 7. Getting Download Link of a File\n\n```ruby\n# Get download link for a file\nputs BlackStack::DropBox.get_file_url('/.pages/383ff473-b649-4cf0-9090-a41022c8d6c4.html')\n# =\u003e https://dl.dropboxusercontent.com/s/9bgveh24fm89v4i/my-first-file.txt?dl=1\n```\n\n## 8. Advanced: Managing Secret Files of Your Project\n\n_(**WARNING:** This section is pending of documentation)_\n\n## 9. Advanced: Creating Your Own DropbBox App.\n\n_(**WARNING:** This section has not been tested yet)_\n\nIf you want to register your own DropBox APP, instead to use **ConnectionSphere**, follow the steps below:\n\n1. Signup to DropBox [here](https://www.dropbox.com/register) or login to an existing account [here](https://www.dropbox.com/login).\n\n2. Go to your DropBox's account home [here](https://www.dropbox.com/home), and double-check you are logged into.\n\n3. Go to [DropBox Developers Center](https://www.dropbox.com/developers/apps/).\n\n4. Click on the \"Create app\" button.\n\n5. In the step 1 (Choose an API), choose \"Scoped access\".\n\n6. In the step 2 (Choose the type of access you need), choose \"App folder\".\n\n7. In the step 3 (Name your app), write \"mysaas-backup\".\n\n8. Agree with the \"Dropbox API Terms and Conditions\", and click on \"Create app\".\n\nYou will be redirected to your new app's configuration page.\nIf you didn't, just go to [https://www.dropbox.com/developers/apps](https://www.dropbox.com/developers/apps) in your browser.\n\nNow, you have to setup your app's permissions.\n\n9. Click on the \"Permissions\" tab.\n\n10. Check the \"files.metadata.write\", \"files.content.write\" and \"files.content.read\" options.\n\n11. Scroll down and click on \"Submit\".\n\nFinally, you have to grab your API key.\n\n12. In the same screen, go to the \"Settings\".\n\n13. Scroll down click on \"Generate access token\". \n\n14. Grab the `DropBox App Key` and `DropBox App Secret` and add them to your configuration.\n\n```ruby\nBlackStack::DropBox.set({\n    :dropbox_refresh_token =\u003e '\u003cpast your access token here\u003e',\n    # if you are using your own DropBox App\n    :dropbox_app_key =\u003e '....',\n    :dropbox_app_secret =\u003e '....'\n})\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleandrosardi%2Fmy-dropbox-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleandrosardi%2Fmy-dropbox-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleandrosardi%2Fmy-dropbox-api/lists"}