I have an MVC website in which I am using the DropNet Api.
public ActionResult AuthorizeDropBox()
{
try
{
var _client = new DropNetClient("API KEY", "API SECRET");
if (_client == null)
throw new DropboxException();
var userLogin = _client.GetToken();
var url = _client.BuildAuthorizeUrl(userLogin, Url.Action("DropBoxCallBack", "Account", null, Request.Url.Scheme));
return Redirect(url);
}
catch (DropboxException dbe)
{
}
}
public ActionResult DropBoxCallBack()
{
//Not sure here how to access the Dropbox api
//var fileBytes = _client.GetFile("/Getting Started.pdf");
return View();
}
So I redirect the user to the Dropbox page that asks the user about allowing my website connect his data and then I DropBoxCallBack
is raised.
However I don't have the _client
here. But I even tried putting the _client
on Session
but I still get errors when trying to access Dropbox functionality.
Any help would be appreciated.
Thanks