Show / Hide Table of Contents

Class DropboxClient

The client which contains endpoints which perform user-level actions.

Inheritance
System.Object
DropboxClientBase
DropboxClient
Implements
System.IDisposable
Inherited Members
DropboxClientBase.Dispose()
DropboxClientBase.Dispose(Boolean)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Dropbox.Api
Assembly: Dropbox.Api.dll
Syntax
public sealed class DropboxClient : DropboxClientBase, IDisposable

Constructors

| Improve this Doc View Source

DropboxClient(String)

Initializes a new instance of the DropboxClient class.

Declaration
public DropboxClient(string oauth2Token)
Parameters
Type Name Description
System.String oauth2Token

The oauth2 access token for making client requests.

| Improve this Doc View Source

DropboxClient(String, DropboxClientConfig)

Initializes a new instance of the DropboxClient class.

Declaration
public DropboxClient(string oauth2AccessToken, DropboxClientConfig config)
Parameters
Type Name Description
System.String oauth2AccessToken

The oauth2 access token for making client requests.

DropboxClientConfig config

The DropboxClientConfig.

| Improve this Doc View Source

DropboxClient(String, DateTime)

Initializes a new instance of the DropboxClient class.

Declaration
public DropboxClient(string oauth2AccessToken, DateTime oauth2AccessTokenExpiresAt)
Parameters
Type Name Description
System.String oauth2AccessToken

The oauth2 access token for making client requests.

System.DateTime oauth2AccessTokenExpiresAt

The time when the current access token expires, can be null if using long-lived tokens.

| Improve this Doc View Source

DropboxClient(String, DateTime, DropboxClientConfig)

Initializes a new instance of the DropboxClient class.

Declaration
public DropboxClient(string oauth2AccessToken, DateTime oauth2AccessTokenExpiresAt, DropboxClientConfig config)
Parameters
Type Name Description
System.String oauth2AccessToken

The oauth2 access token for making client requests.

System.DateTime oauth2AccessTokenExpiresAt

The time when the current access token expires, can be null if using long-lived tokens.

DropboxClientConfig config

The DropboxClientConfig.

| Improve this Doc View Source

DropboxClient(String, String)

Initializes a new instance of the DropboxClient class.

Declaration
public DropboxClient(string oauth2RefreshToken, string appKey)
Parameters
Type Name Description
System.String oauth2RefreshToken

The oauth2 access token for making client requests.

System.String appKey

The app key to be used for refreshing tokens.

| Improve this Doc View Source

DropboxClient(String, String, DropboxClientConfig)

Initializes a new instance of the DropboxClient class.

Declaration
public DropboxClient(string oauth2RefreshToken, string appKey, DropboxClientConfig config)
Parameters
Type Name Description
System.String oauth2RefreshToken

The oauth2 access token for making client requests.

System.String appKey

The app key to be used for refreshing tokens.

DropboxClientConfig config

The DropboxClientConfig.

| Improve this Doc View Source

DropboxClient(String, String, DateTime, String)

Initializes a new instance of the DropboxClient class.

Declaration
public DropboxClient(string oauth2AccessToken, string oauth2RefreshToken, DateTime oauth2AccessTokenExpiresAt, string appKey)
Parameters
Type Name Description
System.String oauth2AccessToken

The oauth2 access token for making client requests.

System.String oauth2RefreshToken

The oauth2 refresh token for refreshing access tokens.

System.DateTime oauth2AccessTokenExpiresAt

The time when the current access token expires, can be null if using long-lived tokens.

System.String appKey

The app key to be used for refreshing tokens.

| Improve this Doc View Source

DropboxClient(String, String, DateTime, String, DropboxClientConfig)

Initializes a new instance of the DropboxClient class.

Declaration
public DropboxClient(string oauth2AccessToken, string oauth2RefreshToken, DateTime oauth2AccessTokenExpiresAt, string appKey, DropboxClientConfig config)
Parameters
Type Name Description
System.String oauth2AccessToken

The oauth2 access token for making client requests.

System.String oauth2RefreshToken

The oauth2 refresh token for refreshing access tokens.

System.DateTime oauth2AccessTokenExpiresAt

The time when the current access token expires, can be null if using long-lived tokens.

System.String appKey

The app key to be used for refreshing tokens.

DropboxClientConfig config

The DropboxClientConfig.

| Improve this Doc View Source

DropboxClient(String, String, DateTime, String, String)

Initializes a new instance of the DropboxClient class.

Declaration
public DropboxClient(string oauth2AccessToken, string oauth2RefreshToken, DateTime oauth2AccessTokenExpiresAt, string appKey, string appSecret)
Parameters
Type Name Description
System.String oauth2AccessToken

The oauth2 access token for making client requests.

System.String oauth2RefreshToken

The oauth2 refresh token for refreshing access tokens.

System.DateTime oauth2AccessTokenExpiresAt

The time when the current access token expires, can be null if using long-lived tokens.

System.String appKey

The app key to be used for refreshing tokens.

System.String appSecret

The app secret to be used for refreshing tokens.

| Improve this Doc View Source

DropboxClient(String, String, DateTime, String, String, DropboxClientConfig)

Initializes a new instance of the DropboxClient class.

Declaration
public DropboxClient(string oauth2AccessToken, string oauth2RefreshToken, DateTime oauth2AccessTokenExpiresAt, string appKey, string appSecret, DropboxClientConfig config)
Parameters
Type Name Description
System.String oauth2AccessToken

The oauth2 access token for making client requests.

System.String oauth2RefreshToken

The oauth2 refresh token for refreshing access tokens.

System.DateTime oauth2AccessTokenExpiresAt

The time when the current access token expires, can be null if using long-lived tokens.

System.String appKey

The app key to be used for refreshing tokens.

System.String appSecret

The app secret to be used for refreshing tokens.

DropboxClientConfig config

The DropboxClientConfig.

| Improve this Doc View Source

DropboxClient(String, String, String)

Initializes a new instance of the DropboxClient class.

Declaration
public DropboxClient(string oauth2RefreshToken, string appKey, string appSecret)
Parameters
Type Name Description
System.String oauth2RefreshToken

The oauth2 refresh token for refreshing access tokens.

System.String appKey

The app key to be used for refreshing tokens.

System.String appSecret

The app secret to be used for refreshing tokens.

| Improve this Doc View Source

DropboxClient(String, String, String, DropboxClientConfig)

Initializes a new instance of the DropboxClient class.

Declaration
public DropboxClient(string oauth2RefreshToken, string appKey, string appSecret, DropboxClientConfig config)
Parameters
Type Name Description
System.String oauth2RefreshToken

The oauth2 refresh token for refreshing access tokens.

System.String appKey

The app key to be used for refreshing tokens.

System.String appSecret

The app secret to be used for refreshing tokens.

DropboxClientConfig config

The DropboxClientConfig.

| Improve this Doc View Source

DropboxClient(String, String, String, String, DropboxClientConfig)

Initializes a new instance of the DropboxClient class.

Declaration
public DropboxClient(string oauth2AccessToken, string oauth2RefreshToken, string appKey, string appSecret, DropboxClientConfig config)
Parameters
Type Name Description
System.String oauth2AccessToken

The oauth2 access token for making client requests.

System.String oauth2RefreshToken

The oauth2 refresh token for refreshing access tokens.

System.String appKey

The app key to be used for refreshing tokens.

System.String appSecret

The app secret to be used for refreshing tokens.

DropboxClientConfig config

The DropboxClientConfig.

Properties

| Improve this Doc View Source

Account

Gets the Account routes.

Declaration
public AccountUserRoutes Account { get; }
Property Value
Type Description
AccountUserRoutes
| Improve this Doc View Source

Auth

Gets the Auth routes.

Declaration
public AuthUserRoutes Auth { get; }
Property Value
Type Description
AuthUserRoutes
| Improve this Doc View Source

Check

Gets the Check routes.

Declaration
public CheckUserRoutes Check { get; }
Property Value
Type Description
CheckUserRoutes
| Improve this Doc View Source

Contacts

Gets the Contacts routes.

Declaration
public ContactsUserRoutes Contacts { get; }
Property Value
Type Description
ContactsUserRoutes
| Improve this Doc View Source

FileProperties

Gets the FileProperties routes.

Declaration
public FilePropertiesUserRoutes FileProperties { get; }
Property Value
Type Description
FilePropertiesUserRoutes
| Improve this Doc View Source

FileRequests

Gets the FileRequests routes.

Declaration
public FileRequestsUserRoutes FileRequests { get; }
Property Value
Type Description
FileRequestsUserRoutes
| Improve this Doc View Source

Files

Gets the Files routes.

Declaration
public FilesUserRoutes Files { get; }
Property Value
Type Description
FilesUserRoutes
| Improve this Doc View Source

Paper

Gets the Paper routes.

Declaration
public PaperUserRoutes Paper { get; }
Property Value
Type Description
PaperUserRoutes
| Improve this Doc View Source

Sharing

Gets the Sharing routes.

Declaration
public SharingUserRoutes Sharing { get; }
Property Value
Type Description
SharingUserRoutes
| Improve this Doc View Source

Users

Gets the Users routes.

Declaration
public UsersUserRoutes Users { get; }
Property Value
Type Description
UsersUserRoutes

Methods

| Improve this Doc View Source

RefreshAccessToken(String[])

Refreshes access token regardless of if existing token is expired.

Declaration
public Task<bool> RefreshAccessToken(string[] scopeList)
Parameters
Type Name Description
System.String[] scopeList

subset of scopes to refresh token with, or null to refresh with all scopes.

Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>

true if token is successfully refreshed, false otherwise.

| Improve this Doc View Source

WithPathRoot(PathRoot)

Set the value for Dropbox-Api-Path-Root header. This allows accessing content outside of user's home namespace. Below is sample code of accessing content inside team space. See Namespace Guide for details about user space vs team space.

// Fetch root namespace info from user's account info.
var account = await client.Users.GetCurrentAccountAsync();

if (!account.RootInfo.IsTeam)
{
    Console.WriteLine("This user doesn't belong to a team with shared space.");
}
else
{
    try
    {
        // Point path root to namespace id of team space.
        client = client.WithPathRoot(new PathRoot.Root(account.RootInfo.RootNamespaceId));
        await client.Files.ListFolderAsync(path);
    }
    catch (PathRootException ex)
    {
        // Handle race condition when user switched team.
        Console.WriteLine(
            "The user's root namespace ID has changed to {0}",
            ex.ErrorResponse.AsInvalidRoot.Value);
    }
}
Declaration
public DropboxClient WithPathRoot(PathRoot pathRoot)
Parameters
Type Name Description
PathRoot pathRoot

The path root object.

Returns
Type Description
DropboxClient

A DropboxClient instance with Dropbox-Api-Path-Root header set.

Implements

System.IDisposable
  • Improve this Doc
  • View Source
In This Article
  • Constructors
    • DropboxClient(String)
    • DropboxClient(String, DropboxClientConfig)
    • DropboxClient(String, DateTime)
    • DropboxClient(String, DateTime, DropboxClientConfig)
    • DropboxClient(String, String)
    • DropboxClient(String, String, DropboxClientConfig)
    • DropboxClient(String, String, DateTime, String)
    • DropboxClient(String, String, DateTime, String, DropboxClientConfig)
    • DropboxClient(String, String, DateTime, String, String)
    • DropboxClient(String, String, DateTime, String, String, DropboxClientConfig)
    • DropboxClient(String, String, String)
    • DropboxClient(String, String, String, DropboxClientConfig)
    • DropboxClient(String, String, String, String, DropboxClientConfig)
  • Properties
    • Account
    • Auth
    • Check
    • Contacts
    • FileProperties
    • FileRequests
    • Files
    • Paper
    • Sharing
    • Users
  • Methods
    • RefreshAccessToken(String[])
    • WithPathRoot(PathRoot)
  • Implements
Back to top Generated by DocFX