Click or drag to resize

DropboxClient Methods

The DropboxClient type exposes the following members.

Methods
  NameDescription
Public methodRefreshAccessToken
Refreshes access token regardless of if existing token is expired
Public methodWithPathRoot
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);
    }
}
Top
See Also