> ## 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.

# Finding recent shared links

export const Link = ({href, children, className, ...props}) => {
  const [localizedHref, setLocalizedHref] = useState(href);
  const supportedLocales = useMemo(() => ['ja'], []);
  useEffect(() => {
    const getLocaleFromPath = path => {
      const match = path.match(/^\/([a-z]{2})(?:\/|$)/);
      if (match) {
        const potentialLocale = match[1];
        if (supportedLocales.includes(potentialLocale)) {
          return potentialLocale;
        }
      }
      return null;
    };
    const hasLocalePrefix = path => {
      const match = path.match(/^\/([a-z]{2})(?:\/|$)/);
      return match ? supportedLocales.includes(match[1]) : false;
    };
    const currentPath = window.location.pathname;
    const currentLocale = getLocaleFromPath(currentPath);
    if (href && href.startsWith('/') && !hasLocalePrefix(href)) {
      if (currentLocale) {
        setLocalizedHref(`/${currentLocale}${href}`);
      } else {
        setLocalizedHref(href);
      }
    } else {
      setLocalizedHref(href);
    }
  }, [href, supportedLocales]);
  return <a href={localizedHref} className={className} {...props}>
      {children}
    </a>;
};

By default, the search API only returns items that are either owned by the user
or items that the user has been explicitly collaborated on. These search results
do not include any items that a user might have accessed recently through a
shared link.

To enable shared links in the API, the `include_recent_shared_links` query
parameter can be set to `true`.

<CodeGroup>
  ```sh cURL theme={null}
  curl -i -X GET "https://api.box.com/2.0/search?query=sales&include_recent_shared_links=true" \
      -H "Authorization: Bearer <ACCESS_TOKEN>"
  ```

  ```python Python theme={null}
  client.search().query("sales", metadata_filters=metadata_search_filters, include_recent_shared_links=True)
  ```

  ```js Node theme={null}
  client.search.query(
      'sales',
      {
          include_recent_shared_links: true
      })
      .then(results => {
          // ...
      });
  ```
</CodeGroup>

<Warning>
  Please be aware that this parameter is relatively new and therefore support for
  it in our Java and Windows SDKs is still a work in progress.
</Warning>

<Danger>
  Please be very aware that when this parameter has been set to true, the format
  of the response of this API changes to return a list of
  <Link href="/reference/resources/search-results-with-shared-links">Search Results with Shared Links</Link>
</Danger>
