Add the power of the Box AI API to your custom apps at Content Cloud Summit on May 15

Learn more and register!

Find Item from Shared Link

Guides Shared Links Find Item from Shared Link
Edit this page

Find Item from Shared Link

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.

curl -i -X GET "" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -H "boxapi: shared_link="
String sharedLink = "";
String password = "foo";
BoxItem.Info itemInfo = BoxItem.getSharedItem(api, sharedLink, password);
file = client.get_shared_item('', password='letmein')
    {fields: 'type,id,parent,extension,shared_link'},
    sharedLinkURL: ""
) { (result: Result<SharedItem, BoxSDKError>) in
    guard case let .success(item) = result else {
        print("Error resolving shared item")

    print("The shared link resolves to item:")
    switch item {
    case let .file(file):
        print("- File \( (ID: \(")
    case let .folder(folder):
        print("- Folder \( (ID: \(")
    case let .webLink(webLink):
        print("- Web Link \( (ID: \(")
TypeScript (Beta)
await userClient.sharedLinksFiles.findFileForSharedLink(
  {} satisfies FindFileForSharedLinkQueryParams,
  new FindFileForSharedLinkHeaders({
    boxapi: ''.concat(
    ) as string,
Python (Beta)
user_client.shared_links_files.find_file_for_shared_link(''.join(['shared_link=', file_from_api.shared_link.url, '&shared_link_password=incorrectPassword']))
.NET (Beta)
await userClient.SharedLinksFiles.FindFileForSharedLinkAsync(queryParams: new FindFileForSharedLinkQueryParams(), headers: new FindFileForSharedLinkHeaders(boxapi: string.Concat("shared_link=", NullableUtils.Unwrap(fileFromApi.SharedLink).Url, "&shared_link_password=incorrectPassword")));

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.

To further traverse the items in the folder, use the same BoxApi header to get a nested folder's information, list the items in those folders, get a nested file's information, or download a file