We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Melisek
4 years agoExplorer | Level 3
Token refreshing C#
I'm building an app in .net and accessing the app's folder for resources. So far everything is going smoothly, but i have no idea how to refresh the token in my app. I tried using the example code fr...
Melisek
4 years agoExplorer | Level 3
I'm catching an HttpRequestException using this
catch(HttpRequestException ex)
{
Debug.WriteLine(ex.ToString());
}
trying to get acces using this
private async Task<List<string>> GetUpdateList(string dirPath)
{
List<string> list = new List<string>();
var files = await dbx.Files.ListFolderAsync(dirPath);
fileNames.Clear();
foreach (var item in files.Entries.Where(i => i.IsFile))
{
fileNames.Add(item.Name);
list.Add(item.Name[..^4]);
}
return list;
}
And it logs
System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Dropbox.Api.DropboxRequestHandler.RefreshAccessToken(String[] scopeList)
at Dropbox.Api.DropboxRequestHandler.CheckAndRefreshAccessToken()
at Dropbox.Api.DropboxRequestHandler.RequestJsonStringWithRetry(String host, String routeName, String auth, RouteStyle routeStyle, String requestArg, Stream body)
at Dropbox.Api.DropboxRequestHandler.Dropbox.Api.Stone.ITransport.SendRpcRequestAsync[TRequest,TResponse,TError](TRequest request, String host, String route, String auth, IEncoder`1 requestEncoder, IDecoder`1 responseDecoder, IDecoder`1 errorDecoder)
at MelisekGameManager.RWindow.GetUpdateList(String dirPath) in C:\Programming\C#\MelisekGameManager\MelisekGameManager\RWindow.cs:line 167
at MelisekGameManager.RWindow.gameSelect_SelectionChangeCommitted(Object sender, EventArgs e) in C:\Programming\C#\MelisekGameManager\MelisekGameManager\RWindow.cs:line 231
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!