IPWorks Cloud 2020 Node.js Edition

Questions / Feedback?

ListSharedLinks Method

Lists shared links created by the current user.

Syntax

dropbox.listSharedLinks(resource, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This method lists shared links created by the current user. If Resource is empty string, all of the user's shared links will be returned. If Resource is non-empty, the results will be limited to just shared links that provide access to the resource in question (direct links and links to any parent folders).

Resource must be a path, an Id-based relative path, a resource Id, or empty string.

Calling this method will fire the SharedLinkList event once for each shared link, and will also populate the SharedLink* properties.

If there are still more shared links available to list when this method returns, the SharedLinkMarker property will be populated. Continue to call this method until SharedLinkMarker is empty to accumulate all pages of results in the SharedLink* properties.

// SharedLinkList event handler.
dropbox.OnSharedLinkList += (s, e) => {
  Console.WriteLine(e.Name + ", URL: " + e.URL);
};

// List all of the shared links created by the current user.
do {
  dropbox.ListSharedLinks("");

  for (int i = 0; i < dropbox.SharedLinks.Count; i++) {
    // Process shared links here.
  }
} while (!string.IsNullOrEmpty(dropbox.SharedLinkMarker));

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Node.js Edition - Version 20.0 [Build 8265]