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

# ファイルレプリゼンテーションのダウンロード

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

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

<RelatedLinks
  title="必須のガイド"
  items={[
{ label: translate("Request Desired Representation"), href: "/guides/representations/request-a-representation", badge: "GUIDE" }
]}
/>

レプリゼンテーションをダウンロードするには、<Link href="/guides/representations/request-a-representation">レプリゼンテーションを選択</Link>した際に受け取った`url_template`を使用します。`{+asset_path}`は、レプリゼンテーションの種類に応じて置き換えます。

## ページ割りされたレプリゼンテーション

PDFのようにページ割りされたレプリゼンテーションでは、`{+asset_path}`を目的のページ番号とファイル拡張子に置き換えます (例: `1.pdf`)。

```sh theme={null}
curl https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/pdf/content/3.pdf \
    -H "authorization: Bearer ACCESS_TOKEN"
```

## ページ割りされていないレプリゼンテーション

ページ割りされていないレプリゼンテーションでは、`{+asset_path}`を空の文字列に置き換えます。

```sh theme={null}
curl https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/jpg_32x32/content/ \
    -H "authorization: Bearer ACCESS_TOKEN"
```

## 省略可能なクエリパラメータ

レプリゼンテーションを取得する場合、以下の省略可能なヘッダーを使用できます。

| パラメータ                          | オプション                   | デフォルト  |
| ------------------------------ | ----------------------- | ------ |
| `set_content_disposition_type` | `inline` / `attachment` | `null` |

指定された値でAPIレスポンスの`content-disposition`ヘッダーを設定します。配置タイプを`attachment`に設定した場合、ほとんどのウェブブラウザではレスポンスをデバイスに保存するようユーザーに促します。一方、タイプを`inline`に設定した場合は、ブラウザでファイルが開かれます。

指定しなかった場合、レスポンスに`content-disposition`ヘッダーは含まれません。

| パラメータ                              | オプション       | デフォルト  |
| ---------------------------------- | ----------- | ------ |
| `set_content_disposition_filename` | 拡張子のないファイル名 | `null` |

アプリケーションでは、ダウンロードしたレプリゼンテーションのファイル名を定義できます。

定義しなかった場合、ファイル名は、Box内の元のファイル名から派生し、拡張子はレプリゼンテーションのファイルタイプに置き換えられます。

<RelatedLinks
  title="関連するAPI"
  items={[
{ label: translate("Get file information"), href: "/reference/get-files-id", badge: "GET" }
]}
/>

<RelatedLinks
  title="関連するガイド"
  items={[
{ label: translate("Get Thumbnail Representation"), href: "/guides/representations/thumbnail-representation", badge: "GUIDE" },
{ label: translate("Supported File Types"), href: "/guides/representations/supported-file-types", badge: "GUIDE" }
]}
/>
