The find item for shared link API is designed to
accept a shared link as an input using a BoxApi header and return the file or
folder object that the shared link is set for.
To get the file or folder object associated with a shared link, supply
the full shared link URL in the request.
await userClient.SharedLinksFiles.FindFileForSharedLinkAsync(queryParams: new FindFileForSharedLinkQueryParams(), headers: new FindFileForSharedLinkHeaders(boxapi: string.Concat("shared_link=", NullableUtils.Unwrap(fileFromApi.SharedLink).Url, "&shared_link_password=incorrectPassword")));
client.sharedItems.get(
sharedLinkURL: "https://app.box.com/s/qqwertyuiopasdfghjklzxcvbnm123456"
) { (result: Result<SharedItem, BoxSDKError>) in
guard case let .success(item) = result else {
print("Error resolving shared item")
return
}
print("The shared link resolves to item:")
switch item {
case let .file(file):
print("- File \(file.name) (ID: \(file.id))")
case let .folder(folder):
print("- Folder \(file.name) (ID: \(file.id))")
case let .webLink(webLink):
print("- Web Link \(file.name) (ID: \(file.id))")
}
}
Please note that when the shared link is for a folder, the response of this
API does not include the list of nested items within that folder.