Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I am creating a .NET app and all is working well so far with v2.1. I can share a link, but if try to add an expiry date for the link it fails at the "CreateSharedLinkWithSettingsAsync" method, with a "settings_error/not_authorized/.." error!
I have read the .NET documentation, and searched the forums, but cannot get this working.
This is my code:
Dropbox.Api.Sharing.CreateSharedLinkWithSettingsArg shArgs = null;
//set the expiry date
Dropbox.Api.Sharing.SharedLinkSettings shSett = new Dropbox.Api.Sharing.SharedLinkSettings(null, null, DateTime.Today.AddDays(1));
var file = (FileMetadata)listView1.SelectedItems[0].Tag;
//The code work if I replace the 'shSett' variable with 'null' in this line of code
shArgs = new Dropbox.Api.Sharing.CreateSharedLinkWithSettingsArg(file.PathDisplay, shSett);
//this is the line where the error occurs
var result = await client.Sharing.CreateSharedLinkWithSettingsAsync(shArgs);
Any help appreciated. Hopefully I have provided enough information.
Paul
Hi Paul, you can find more information on this error in the documentation here:
In this case, it looks like the issue is that you're trying to set an expiration on a link using an account that doesn't have access to that feature.
Hi Gregory,
Many thanks for your response and advice, and you were indeed correct, so I have now upgraded from the free account to Pro.
However, I now have a new problem, which is "Error in call to API function \"sharing/create_shared_link_with_settings\": request body: settings.expires: time data '2016-04-24T00:00:00' does not match format '%Y-%m-%dT%H:%M:%SZ'"}.
As far as I can see, the problem is arising in the Dropbox.Api.SharedLinkSettingsEncoder class, which has a DateTime value passed in, and where the "expires" value is:
{{"path":"/Chrysanthemum.jpg","settings":{"expires":"2016-04-24T00:00:00"}
Using the API Explorer and reading the error message, it appears that there should be a "Z" appended to the time in the settings, but I'm not sure how to achieve this.
Not sure if it has anything to do with being a UK time format.
Paul
I believe that should be fixed in version 3.0.6. Please update to that and let me know if it doesn't help.
Fantastic Gregory. I have updated the Dropbox.Api and it now works perfectly.
Many thanks for your quick response and helpful advice.
Paul
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
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!