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

# Get Text Representation

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

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

<RelatedLinks
  title="REQUIRED GUIDES"
  items={[
  { label: "List All Representations for File", href: "/guides/representations/list-all-representations", badge: "GUIDE" },
  { label: "Request Desired Representation", href: "/guides/representations/request-a-representation", badge: "GUIDE" },
  { label: "Download File Representation", href: "/guides/representations/download-a-representation", badge: "GUIDE" }
]}
/>

A text representation provides a way to extract plain text
from a document.

Text is generated for all document file types including plain text and
code files supported by Box. This does not include image files as these
do not have a text layer.

Text representations are generated upon upload of the file, similarly to PDFs
and thumbnails. They are not generated for files larger than 500
megabytes.

## The process

To get a text representation follow the following steps

* <Link href="/guides/representations/list-all-representations">List all representations</Link>
* <Link href="/guides/representations/request-a-representation">Request a text representation</Link> by passing the `x-rep-hints`-header with the value `[extracted_text]`.
* <Link href="/guides/representations/download-a-representation">Download the text</Link> by calling the `url_template`, replacing the `{+asset_path}` with an empty string.

<RelatedLinks
  title="RELATED APIS"
  items={[
  { label: "Get file information", href: "/reference/get-files-id", badge: "GET" }
]}
/>

<RelatedLinks
  title="RELATED GUIDES"
  items={[
  { label: "Supported File Types", href: "/guides/representations/supported-file-types", badge: "GUIDE" }
]}
/>
