{"id":37014079,"url":"https://github.com/hamidsamak/dropbox-api","last_synced_at":"2026-01-14T01:23:54.017Z","repository":{"id":54562552,"uuid":"522010934","full_name":"hamidsamak/dropbox-api","owner":"hamidsamak","description":"A minimal implementation of Dropbox API v2 with syncing","archived":false,"fork":true,"pushed_at":"2022-08-08T09:52:38.000Z","size":217,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-17T02:21:42.133Z","etag":null,"topics":["dropbox","dropbox-api","dropbox-apis","php","sync"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"spatie/dropbox-api","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hamidsamak.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"spatie","custom":"https://spatie.be/open-source/support-us"}},"created_at":"2022-08-06T17:26:29.000Z","updated_at":"2022-08-07T04:14:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hamidsamak/dropbox-api","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hamidsamak/dropbox-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamidsamak%2Fdropbox-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamidsamak%2Fdropbox-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamidsamak%2Fdropbox-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamidsamak%2Fdropbox-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hamidsamak","download_url":"https://codeload.github.com/hamidsamak/dropbox-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamidsamak%2Fdropbox-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28407696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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-apis","php","sync"],"created_at":"2026-01-14T01:23:53.136Z","updated_at":"2026-01-14T01:23:54.005Z","avatar_url":"https://github.com/hamidsamak.png","language":"PHP","readme":"\n[\u003cimg src=\"https://github-ads.s3.eu-central-1.amazonaws.com/support-ukraine.svg?t=1\" /\u003e](https://supportukrainenow.org)\n\n# A minimal implementation of Dropbox API v2\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/dropbox-api.svg?style=flat-square)](https://packagist.org/packages/spatie/dropbox-api)\n[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/spatie/dropbox-api/run-tests?label=tests)](https://github.com/spatie/dropbox-api/actions?query=workflow%3ATests+branch%3Amaster)\n[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/spatie/dropbox-api/Check%20\u0026%20fix%20styling?label=code%20style)](https://github.com/spatie/dropbox-api/actions?query=workflow%3A\"Check+%26+fix+styling\"+branch%3Amaster)\n[![Total Downloads](https://img.shields.io/packagist/dt/spatie/dropbox-api.svg?style=flat-square)](https://packagist.org/packages/spatie/dropbox-api)\n\n\nThis is a minimal PHP implementation of the [Dropbox API v2](https://www.dropbox.com/developers/documentation/http/overview). It contains only the methods needed for [our flysystem-dropbox adapter](https://github.com/spatie/flysystem-dropbox). We are open however to PRs that add extra methods to the client. \n\nHere are a few examples on how you can use the package:\n\n```php\n$client = new Spatie\\Dropbox\\Client($authorizationToken);\n\n//create a folder\n$client-\u003ecreateFolder($path);\n\n//list a folder\n$client-\u003elistFolder($path);\n\n//get a temporary link\n$client-\u003egetTemporaryLink($path);\n```\n\n## Support us\n\n[\u003cimg src=\"https://github-ads.s3.eu-central-1.amazonaws.com/dropbox-api.jpg?t=1\" width=\"419px\" /\u003e](https://spatie.be/github-ad-click/dropbox-api)\n\nWe invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).\n\nWe highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).\n\n## Installation\n\nYou can install the package via composer:\n\n``` bash\ncomposer require spatie/dropbox-api\n```\n\n## Usage\n\nThe first thing you need to do is get an authorization token at Dropbox. Unlike [other companies](https://google.com) Dropbox has made this very easy. You can just generate a token in the [App Console](https://www.dropbox.com/developers/apps) for any Dropbox API app. You'll find more info at [the Dropbox Developer Blog](https://blogs.dropbox.com/developers/2014/05/generate-an-access-token-for-your-own-account/).\n\nWith an authorization token you can instantiate a `Spatie\\Dropbox\\Client`.\n\n```php\n$client = new Spatie\\Dropbox\\Client($authorizationToken);\n```\n\nor alternatively you can implement `Spatie\\Dropbox\\TokenProvider` \nwhich will provide the access-token from its \n`TokenProvider-\u003egetToken(): string` method.\n\nIf you use oauth2 to authenticate and to acquire refresh-tokens and access-tokens,\n(like [thephpleague/oauth2-client](https://github.com/thephpleague/oauth2-client)),\nyou can create an adapter that internally takes care of token-expiration and refreshing tokens, \nand at runtime will supply the access-token via the `TokenProvider-\u003egetToken(): string` method.\n\n*(Dropbox announced they will be moving to short-lived access_tokens mid 2021).*\n\n\n```php\n// implements Spatie\\Dropbox\\TokenProvider\n$tokenProvider = new AutoRefreshingDropBoxTokenService($refreshToken);\n$client = new Spatie\\Dropbox\\Client($tokenProvider);\n```\n\n\n\nor alternatively you can authenticate as an App using your App Key \u0026 Secret.\n\n```php\n$client = new Spatie\\Dropbox\\Client([$appKey, $appSecret]);\n```\n\nIf you only need to access the public endpoints you can instantiate `Spatie\\Dropbox\\Client` without any arguments.\n\n```php\n$client = new Spatie\\Dropbox\\Client();\n```\n\n## Dropbox Endpoints\n\nLook in [the source code of `Spatie\\Dropbox\\Client`](https://github.com/spatie/dropbox-api/blob/master/src/Client.php) to discover the methods you can use.\n\nHere's an example:\n\n```php\n$content = 'hello, world';\n$client-\u003eupload('/dropboxpath/filename.txt', $content, $mode='add');\n\n$from = '/dropboxpath/somefile.txt';\n$to = '/dropboxpath/archive/somefile.txt';\n$client-\u003emove($from, $to);\n```\n\nIf the destination filename already exists, dropbox will throw an Exception with 'to/conflict/file/..'\n\nThe ``upload()`` and ``move()`` methods have an optional extra 'autorename' argument \nto try and let dropbox automatically rename the file if there is such a conflict.\n\nHere's an example:\n\n```php\n$from = '/dropboxpath/somefile.txt';\n$to = '/dropboxpath/archive/somefile.txt';\n$client-\u003emove($from, $to, $autorename=true);\n// with autorename results in 'somefile (1).txt'\n```\n\n\nIf you do not find your favorite method, you can directly use the `contentEndpointRequest` and `rpcEndpointRequest` functions.\n\n```php\npublic function contentEndpointRequest(string $endpoint, array $arguments, $body): ResponseInterface\n\npublic function rpcEndpointRequest(string $endpoint, array $parameters): array\n```\n\nHere's an example:\n\n```php\n$client-\u003erpcEndpointRequest('search', ['path' =\u003e '', 'query' =\u003e 'bat cave']);\n```\n\nIf you need to change the subdomain of the endpoint URL used in the API request, you can prefix the endpoint path with `subdomain::`.\n\nHere's an example:\n\n```php\n$client-\u003erpcEndpointRequest('content::files/get_thumbnail_batch', $parameters);\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Testing\n\n``` bash\ncomposer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.\n\n## Security\n\nIf you've found a bug regarding security please mail [security@spatie.be](mailto:security@spatie.be) instead of using the issue tracker.\n\n## Postcardware\n\nYou're free to use this package (it's [MIT-licensed](LICENSE.md)), but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.\n\nOur address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.\n\nWe publish all received postcards [on our company website](https://spatie.be/en/opensource/postcards).\n\n## Credits\n\n- [Alex Vanderbist](https://github.com/AlexVanderbist)\n- [Freek Van der Herten](https://github.com/freekmurze)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","funding_links":["https://github.com/sponsors/spatie","https://spatie.be/open-source/support-us"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamidsamak%2Fdropbox-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamidsamak%2Fdropbox-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamidsamak%2Fdropbox-api/lists"}