ListSharedLinks Method

Lists shared links created by the current user.

Syntax

int ListSharedLinks(const QString& qsResource);

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));

Error Handling

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

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