{"id":15880531,"url":"https://github.com/gpenverne/putio-drive-sdk","last_synced_at":"2025-07-12T14:37:34.866Z","repository":{"id":62512064,"uuid":"78010323","full_name":"gpenverne/putio-drive-sdk","owner":"gpenverne","description":"Handle Oauth flow for put.io on Symfony2","archived":false,"fork":false,"pushed_at":"2017-07-29T15:09:03.000Z","size":55,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T20:51:09.379Z","etag":null,"topics":["api","cloud","letmestream","putio"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/gpenverne.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}},"created_at":"2017-01-04T11:36:40.000Z","updated_at":"2019-07-06T18:32:35.000Z","dependencies_parsed_at":"2022-11-02T13:16:43.080Z","dependency_job_id":null,"html_url":"https://github.com/gpenverne/putio-drive-sdk","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpenverne%2Fputio-drive-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpenverne%2Fputio-drive-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpenverne%2Fputio-drive-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpenverne%2Fputio-drive-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gpenverne","download_url":"https://codeload.github.com/gpenverne/putio-drive-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246759851,"owners_count":20829172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["api","cloud","letmestream","putio"],"created_at":"2024-10-06T03:09:31.448Z","updated_at":"2025-04-02T05:23:13.118Z","avatar_url":"https://github.com/gpenverne.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# putio-drive-sdk\n\n## Installation\nInstall the bundle:\n```bash\n$ composer require gpenverne/putio-drive-sdk\n```\n\nLoad bunle in AppKernel:\n```php\n    new Gpenverne\\PutioDriveBundle\\PutioDriveBundle(),\n```\n\n### Configuration\n```\nparameters:\n    putio:\n        client_id: your-client-id\n        client_secret: your-client-secret\n        callback_route: callback_route\n```\nWith your custom route in callback_route (for example, to display a success message)\n\nAdd your endpoints to your routing.yml or use our controllers endpoints:\n```\nputio.callback:\n    path:     /putio/callback\n    defaults: { _controller: putio.drive.controller:callbackAction }\n\nputio.redirect:\n    path:     /putio/redirect\n    defaults: { _controller: putio.drive.controller:redirectAction }\n```\n\n\n\n### obtain the user token\nCall the previous created route (putio.redirect) .\nAfter access granted, user will be redirected to previous configured \"callback_route\" parameter\n\n### retrieving the token\nOnce token obtained, \"events.putio.token\" event is dispatched.  \nThis event is handled by putio drive service, and you can retrieve it using putio.drive service:\n```php\n// In a controller:\n$token = $this-\u003econtainer-\u003eget('putio.drive')-\u003egetToken();\n```\n\n### using the putio php sdk\nYou can use our builtin file/folder finder:\n```php\n$putioDrive = $this-\u003econtainer-\u003eget('putio.drive');\n$putioDrive-\u003esetToken($token);\n\n// Retrieving a folder\n$folder = $putioDrive-\u003efindByPath('/MyMovies');\n\n// Retrieving files in the folder\n// Will return FileInterface and FolderInterface\n// cf. (psr-cloud-files)[https://packagist.org/packages/gpenverne/psr-cloud-files]\n$files = $folder-\u003egetFiles();\n\n// Or retrieve a full path file\n// Will return FileInterface\n// cf. (psr-cloud-files)[https://packagist.org/packages/gpenverne/psr-cloud-files]\n$file = $putioDrive-\u003efindByPath('/MyMovies/MyMovie.mp4');\n\n// Retrieving the download url:\n$file = $putioDrive-\u003efindByPath('/MyMovies/MyMovie.mp4');\n$downloadUrl = $file-\u003egetLink();\n```\n\nThanks to [https://github.com/nicoSWD/put.io-api-v2](https://github.com/nicoSWD/put.io-api-v2), you can easily make api calls:\n```php\n// In a controller, using the previous catched token:\n$putioApiClient = $this-\u003econtainer-\u003eget('putio.drive')-\u003egetApiClient();\n\n// In a controller, using a custom token:\n$putioApiClient = $this-\u003econtainer-\u003eget('putio.drive')-\u003egetApiClient('custom token');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpenverne%2Fputio-drive-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgpenverne%2Fputio-drive-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpenverne%2Fputio-drive-sdk/lists"}