cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: How do I create a shared link with expiry date from API (.Net SDK)?

How do I create a shared link with expiry date from API (.Net SDK)?

user3378165
Explorer | Level 3
Go to solution

Would you be able to give me an example how to add an expiration date to a shared link?

 

This is what I have so far:

 

Dropbox.Api.Sharing.SharedLinkSettings sls=new Dropbox.Api.Sharing.SharedLinkSettings();
????
var result = await  dbx.Sharing.CreateSharedLinkWithSettingsAsync(remotePath,sls);
1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

You can set an expiration for a new shared link using the .NET SDK like this:

 

var settings = new SharedLinkSettings (expires: new DateTime (2016, 12, 25));
SharedLinkMetadata sharedLinkMetadata = await this.client.Sharing.CreateSharedLinkWithSettingsAsync (path, settings);

Console.WriteLine (sharedLinkMetadata.Url);
Console.WriteLine (sharedLinkMetadata.Expires);

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

You can set an expiration for a new shared link using the .NET SDK like this:

 

var settings = new SharedLinkSettings (expires: new DateTime (2016, 12, 25));
SharedLinkMetadata sharedLinkMetadata = await this.client.Sharing.CreateSharedLinkWithSettingsAsync (path, settings);

Console.WriteLine (sharedLinkMetadata.Url);
Console.WriteLine (sharedLinkMetadata.Expires);

user3378165
Explorer | Level 3
Go to solution

Thank you! Working perfectly!

Need more support?