{"id":16494674,"url":"https://github.com/rambalac/amazonclouddriveapi","last_synced_at":"2025-03-23T12:34:54.675Z","repository":{"id":144199943,"uuid":"49174890","full_name":"Rambalac/AmazonCloudDriveApi","owner":"Rambalac","description":"Amazon Cloud Drive Api for .NET","archived":false,"fork":false,"pushed_at":"2017-03-27T09:00:56.000Z","size":222,"stargazers_count":24,"open_issues_count":2,"forks_count":13,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-18T20:45:56.925Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","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/Rambalac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","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}},"created_at":"2016-01-07T02:13:38.000Z","updated_at":"2023-03-26T09:40:00.000Z","dependencies_parsed_at":"2023-06-03T01:45:44.274Z","dependency_job_id":null,"html_url":"https://github.com/Rambalac/AmazonCloudDriveApi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rambalac%2FAmazonCloudDriveApi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rambalac%2FAmazonCloudDriveApi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rambalac%2FAmazonCloudDriveApi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rambalac%2FAmazonCloudDriveApi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rambalac","download_url":"https://codeload.github.com/Rambalac/AmazonCloudDriveApi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245104461,"owners_count":20561377,"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":[],"created_at":"2024-10-11T14:14:57.475Z","updated_at":"2025-03-23T12:34:54.302Z","avatar_url":"https://github.com/Rambalac.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Amazon Cloud Drive Api for .NET\n===============================\nGeneral implementation of REST API for Amazon Cloud Drive. Not all functions are implemented, but it can download/upload files and organize files/folders.\n\n[![Build status](https://ci.appveyor.com/api/projects/status/wigge25onobhd31j/branch/master?svg=true)](https://ci.appveyor.com/project/Rambalac/amazonclouddriveapi/branch/master) \n[![Nuget badge](https://buildstats.info/nuget/AmazonCloudDriveApi)](https://www.nuget.org/packages/AmazonCloudDriveApi)\n\nNuget\n-----\nYou can find nuget package with name ```AmazonCloudDriveApi```\n\nExample\n-------\n\n### Desktop authentication\nFirst you need to create security profile in Amazon Dev console and whitelist it. Since August 2016 it became complicated.\nThere you get your app ClientId and ClientSecret.\n\nThen you create root API object. \n```C#\nthis.amazon = new AmazonDrive(ClientId, ClientSecret);\n```\n\nTo authenticate new connection.\n\n```C#\nvar success = await this.amazon.AuthenticationByExternalBrowser(CloudDriveScopes.ReadAll | CloudDriveScopes.Write | CloudDriveScopes.Profile, TimeSpan.FromMinutes(10));\n```\n\nTo be able to reauthenticate without confirmation each time on Amazon web site you need to reuse Access and Refresh tokens. After some time tokens get updated by API they have to be stored somewhere by application. For that you need to assign implementation of ```ITokenUpdateListener``` which will store tokens. Reference to the implementation is weak, so do not use any local object, object with your implementation should live while API is used.\n\n#### Implementation example\n```C#\npublic abstract class AmazonTokenListener : ITokenUpdateListener\n{\npublic void OnTokenUpdated(string access_token, string refresh_token, DateTime expires_in)\n  {\n      var settings = Properties.Settings.Default;\n\n      settings.AuthToken = access_token;\n      settings.AuthRenewToken = refresh_token;\n      settings.AuthTokenExpiration = expires_in;\n      settings.Save();\n  }\n}\n```\nAssign object to ```OnTokenUpdate``` property before any login attempt\n```C#\nthis.tokenSaver = new AmazonTokenListener();\nthis.amazon.OnTokenUpdate\n```\n\nNext time when you restart your application and want to relogin into Amazon cloud Drive use\n```C#\nvar success = amazon.AuthenticationByTokens(settings.AuthToken, settings.AuthRenewToken, settings.AuthTokenExpiration)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frambalac%2Famazonclouddriveapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frambalac%2Famazonclouddriveapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frambalac%2Famazonclouddriveapi/lists"}