Search code examples
c#uploaddropnet

DropNet Upload Error


I am trying to upload to Dropbox using DropNet in my Windows for application. My code is : -

_client = new DropNetClient(app_key, app_secret, token, secret);
_client.UseSandbox = false;
_client.UploadFile(dropbox_folder, "puzzle_01.png", File.ReadAllBytes(@"Resources\\config.dat"));

It was working fine until last week. However, when I tried to use the same app today, the app works fine but no file is uploaded to the Dropbox folder. I tried to check the values of the metadata using the code:-

var metadata = _client.GetMetaData();
foreach (var item in metadata.Contents)
{
    MessageBox.Show(item.ToString())
}

I got the error message as:-

$exception {"Received Response [BadRequest] : Expected to see [OK]. The HTTP response was [{\"error\": \"v1_retired\"}]."} DropNet.Exceptions.DropboxRestException

Can anyone let me know what this error means? All help will be appreciated.


Solution

  • The returned data (error: v1_retired) is an error message from DropBox indicating that their v1 API has been deprecated and can no longer be used. More information about the deprecation can be found on the official DropBox blog:

    It appears that DropNet has not been updated for the DropBox v2 API since an issue was opened on their GitHub page over a year ago, but yet there have been no updates.

    The API was deprecated on September 28, 2017, which is why it was working a week ago but not any longer.

    Your only solution right now is to find an updated library that works with the DropBox API v2.