cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dropbox .NET SDK - DropboxClient usage

Dropbox .NET SDK - DropboxClient usage

Probe9
Explorer | Level 3
Go to solution

Hi all,

 

I'm working with Dropbox .Net v2 api from nuget (6.22.0) in a Windows Desktop application (.net core 3.1).

 

I successfully integrate the OAuth2 flow as recommends in documentation:

A client-side Desktop app or mobile app that requires background access: Use the OAuth code flow with PKCE, with refresh tokens.

 

With given information I'm able to create the DropboxClient class:

 

Probe9_0-1639128267140.png

 

Documentations defines that the DropboxClient automatically refresh the access_token, but that happens on any type of API calls?

As example, when I perform a client.Files.DownloadAsync, before actually do it, is the access_token refreshed if expired?

 

What is the recommends usage of the client; create, perform a request then dispose, or; should it be a single instance and stay alive for the entire app life time?

 

Thanks in advance.
 
Ciao
1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

The client will automatically perform the refresh process for you whenever needed, on any such call, so you do not need to dispose of your existing client.

View solution in original post

1 Reply 1

Greg-DB
Dropbox Staff
Go to solution

The client will automatically perform the refresh process for you whenever needed, on any such call, so you do not need to dispose of your existing client.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?