> ## Documentation Index
> Fetch the complete documentation index at: https://developer.box.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Find Item from Shared Link

export const Link = ({href, children, className, ...props}) => {
  const localizedHref = localizeLink(href);
  return <a href={localizedHref} className={className} {...props}>
      {children}
    </a>;
};

export const MultiRelatedLinks = ({sections = []}) => {
  if (!sections || sections.length === 0) {
    return null;
  }
  return <div className="space-y-8">
      {sections.map((section, index) => <RelatedLinks key={index} title={section.title} items={section.items} />)}
    </div>;
};

export const RelatedLinks = ({title, items = []}) => {
  const getBadgeClass = badge => {
    if (!badge) return "badge-default";
    const badgeType = badge.toLowerCase().replace(/\s+/g, "-");
    return `badge-${badge === "ガイド" ? "guide" : badgeType}`;
  };
  if (!items || items.length === 0) {
    return null;
  }
  return <div className="my-8">
      {}
      <h3 className="text-sm font-bold uppercase tracking-wider mb-4">{title}</h3>

      {}
      <div className="flex flex-col gap-3">
        {items.map((item, index) => <a key={index} href={item.href} className="py-2 px-3 rounded related_link hover:bg-[#f2f2f2] dark:hover:bg-[#111827] flex items-center gap-3 group no-underline hover:no-underline border-b-0">
            {}
            <span className={`px-2 py-1 rounded-full text-xs font-semibold uppercase tracking-wide flex-shrink-0 ${getBadgeClass(item.badge)}`}>
              {item.badge}
            </span>

            {}
            <span className="text-base">{item.label}</span>
          </a>)}
      </div>
    </div>;
};

The <Link href="/reference/get-shared-items">find item for shared link</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.

<CodeGroup>
  ```sh cURL theme={null}
  curl -i -X GET "https://api.box.com/2.0/shared_items" \
       -H "authorization: Bearer <ACCESS_TOKEN>" \
       -H "boxapi: shared_link=https://app.box.com/s/gjasdasjhasd&shared_link_password=letmein"
  ```

  ```typescript Node/TypeScript v10 theme={null}
  await userClient.sharedLinksFiles.findFileForSharedLink(
    {} satisfies FindFileForSharedLinkQueryParams,
    {
      boxapi: ''.concat(
        'shared_link=',
        fileFromApi.sharedLink!.url,
        '&shared_link_password=Secret123@',
      ) as string,
    } satisfies FindFileForSharedLinkHeadersInput,
  );
  ```

  ```python Python v10 theme={null}
  user_client.shared_links_files.find_file_for_shared_link(
      "".join(
          [
              "shared_link=",
              file_from_api.shared_link.url,
              "&shared_link_password=Secret123@",
          ]
      )
  )
  ```

  ```cs .NET v10 theme={null}
  await userClient.SharedLinksFiles.FindFileForSharedLinkAsync(queryParams: new FindFileForSharedLinkQueryParams(), headers: new FindFileForSharedLinkHeaders(boxapi: string.Concat("shared_link=", NullableUtils.Unwrap(fileFromApi.SharedLink).Url, "&shared_link_password=Secret123@")));
  ```

  ```swift Swift v10 theme={null}
  try await userClient.sharedLinksFiles.findFileForSharedLink(queryParams: FindFileForSharedLinkQueryParams(), headers: FindFileForSharedLinkHeaders(boxapi: "\("shared_link=")\(fileFromApi.sharedLink!.url)\("&shared_link_password=Secret123@")"))
  ```

  ```java Java v10 theme={null}
  userClient.getSharedLinksFiles().findFileForSharedLink(new FindFileForSharedLinkQueryParams(), new FindFileForSharedLinkHeaders(String.join("", "shared_link=", fileFromApi.getSharedLink().getUrl(), "&shared_link_password=Secret123@")))
  ```

  ```java Java v5 theme={null}
  String sharedLink = "https://app.box.com/s/abcdefghijklmnopqrstuvwxyz123456";
  String password = "foo";
  BoxItem.Info itemInfo = BoxItem.getSharedItem(api, sharedLink, password);
  ```

  ```python Python v4 theme={null}
  file = client.get_shared_item('https://app.box.com/s/gjasdasjhasd', password='letmein')
  ```

  ```javascript Node v4 theme={null}
  client.sharedItems.get(
      'https://app.box.com/s/1a2b3c4d5e',
      null,
      {fields: 'type,id,parent,extension,shared_link'},
      callback
  );
  ```
</CodeGroup>

<Info>
  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
  <Link href="/reference/get-folders-id">get a nested folder's information</Link>, <Link href="/reference/get-folders-id-items">list the items in
  those folders</Link>, <Link href="/reference/get-files-id">get a nested file's
  information</Link>, or <Link href="/reference/get-files-id-content">download a file</Link>
</Info>

<RelatedLinks
  title="RELATED APIS"
  items={[
{ label: translate("Find file for shared link"), href: "/reference/get-shared-items", badge: "GET" }
]}
/>

<RelatedLinks
  title="RELATED GUIDES"
  items={[
{ label: translate("Remove Shared Link"), href: "/guides/shared-links/remove", badge: "GUIDE" },
{ label: translate("Create or Update Shared Link"), href: "/guides/shared-links/create-or-update", badge: "GUIDE" }
]}
/>
