cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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: 

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

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

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

Greg-DB
Dropboxer

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

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

Greg-DB
Dropboxer

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

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

user3378165
Explorer | Level 3

Thank you! Working perfectly!

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    user3378165 Explorer | Level 3
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?