Hi im new to developing with dropbox and im having a hard finding the following info. im using dropbox .net sdk to upload and download images from my own account i set up a little test using the generated access token from developer app portal, this token is short lived (starts with sl.) i've seen based on some question that dropbox no longer offers long lived tokens, so how can i implement a refresh token process without any interaction?
heres the test code for refrence
try
{
var filePath = "PATH";
var dbx = new DropboxClient("sl.TOKEN_HERE"); // Replace with your actual access token
var response = dbx.Files.DownloadAsync(filePath).Result;
if (response.Response.IsFile)
{
var fileContent = response.GetContentAsByteArrayAsync().Result;
string base64String = Convert.ToBase64String(fileContent);
return Ok(base64String);
}
else
{
// Handle the case where the response is not a file (e.g., it's a folder).
return BadRequest("Requested item is not a file.");
}
}
catch (Exception e)
{
throw new InternalServerException(e.Message);
}