Hello,
I first get the token from:
https://api.dropbox.com/1/oauth2/authorize?response_type=code&client_id=xxxxxxxxxxx&redirect_uri=htt...
following https://www.dropbox.com/developers/documentation/dotnet#tutorial
I use the following method: https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_UploadA...
using (var dbx = new DropboxClient(token))
I call the following method:
async Task Upload(DropboxClient dbx, string folder, string file, string content)
{
using (var mem = new MemoryStream(Encoding.UTF8.GetBytes(content)))
{
var updated = await dbx.Files.UploadAsync(
"/" + file,
WriteMode.Overwrite.Instance,
body: mem);
}
}
I get the following error when trying to upload (dbx.Files.UploadAsync) : Dropbox.Api.AuthException: invalid_access_token
I use the token right after accessing the oauth2 page with credentials and it returns a token.
Could you please advise as what is the problem with the invalid token error?
Thank you