Dropbox api "USER TOKEN", "USER SECRET"

I am trying to manipulate files using Dropbox Api using DropNet Client (C # API version of Dropbox CLient API). Here is my code:

var client = new DropNetClient(APP_KEY,APP_SECRET); client.Delete("/Public/test.txt"); 

But it seems to me that I need USER TOKEN and USER SECRET. Where can I get these two? Updated: I just need to manipulate the files in my own folders and my shared folders. I already have APP_KEY and APP_SECRET from myApp page, where I can get "USER TOKEN" and "USER SECRET"

thanks

+4
source share
3 answers

When you create your application on the Dropbox website, you get APP_KEY (identifies your application) and APP_SECRET (e.g. password). You essentially register your application with the drop box to integrate with your service.

Here is a review: http://www.dropbox.com/developers/start/core

Click the " my apps " link on this page. You will need to create or log in to your account. After that you can create the application. Give it a name and description, select the access folder or the full contents, and click OK. They will give you the key and secret after registering your application.

EDIT:

As for the specific C # DropNetClient, you should replace "APP_KEY" and "APP_SECRET" with your appKey and appSecret lines from this site.

This link sets out the sequence quite clearly:

https://github.com/dkarzon/DropNet

 _client = new DropNetClient("API KEY", "API SECRET"); 

eg:

 // replace with given app key and secret from site _client = new DropNetClient("8oz68cz267t52fz", "mavm58321hrhejy"); 

After you have the client object, you need to set the browser and log in using the user account. which are described in step 2 of this link, getting the URL.

 var url = _client.BuildAuthorizeUrl(); 

Now that the user is logged in, you can get the user's access token using synchronous or asynchronous methods. the user token allows you to use the β€œremember me” function without re-authenticating the user, and especially from your application that stores their account / pass, which you should never do. This is a token that proves that they are authenticated using a packaging box. From step 3 of this link:

 // Sync var accessToken = _client.GetAccessToken(); //Store this token for "remember me" function // Async _client.GetAccessTokenAsync((accessToken) => { //Store this token for "remember me" function }, (error) => { //Handle error }); 

Note that var accessToken is indeed a DropNet.Models.UserLogin object. This object contains:

  public string Token { get; set; } public string Secret { get; set; } 
+6
source

A user token / secret is what you get when a user gives your application access to their Dropbox through a browser-based authorization page described here:

https://www.dropbox.com/developers/core/authentication

The Dropbox API is designed to communicate with every Dropbox user. It looks like you want it to communicate with your (developer-owned) Dropbox, which is not currently supported. The only option would be to get the token through the auth stream in your development environment, and then somehow embed this token in your application code. Keeping this token secret key will be a problem. In addition, the built-in fixed token will be tied to your Dropbox account, and you need to be very careful not to unlink your account (via https://www.dropbox.com/account#applications ), which will invalidate the token .

+1
source

There is a new way to get a token for your own account without going through all the OAuth stuff. On the application settings page, you will find the "Generated Access Token" button. This creates a token for your own account.

+1
source

Source: https://habr.com/ru/post/1385249/


All Articles