> ## 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("List All Representations for File"), href: "/guides/representations/list-all-representations", badge: "GUIDE" }
]}
/>

特定のレプリゼンテーションを選択するには、必要なレプリゼンテーション形式を定義する<Link href="/reference/get-files-id#param-x-rep-hints">`x-rep-hints`</Link>ヘッダーを使用して<Link href="/reference/get-files-id">`GET /files/:id`</Link>エンドポイントを呼び出します。

```sh theme={null}
curl https://api.box.com/2.0/files/123?fields=representations \
    -H "x-rep-hints: [pdf]" \
    -H "authorization: Bearer ACCESS_TOKEN"
```

ステータスが`pending`から`success`に変わると、レプリゼンテーションはダウンロード可能になります。このステータスはレプリゼンテーションが利用可能かどうかを示します。利用可能なオプションは`success`、`viewable`、`pending`、`none`です。`Success`はレプリゼンテーションを即座にダウンロードできることを意味するのに対し、`none`はレプリゼンテーションが生成可能であることを示します。

## 複数のサイズ

形式によっては、特定のサイズを選択するために、`dimensions`を渡すことが必要になる場合があります。そのためには、ヘッダーに`dimensions`を追加します。

```sh theme={null}
curl https://api.box.com/2.0/files/123?fields=representations \
    -H "x-rep-hints: [jpg?dimensions=94x94]" \
    -H "authorization: Bearer ACCESS_TOKEN"
```

## 複数のレプリゼンテーション

`x-rep-hints`ヘッダーでさまざまなタイプを続けて指定することで、複数のレプリゼンテーションを取得できます。

```sh theme={null}
curl https://api.box.com/2.0/files/123?fields=representations \
    -H "x-rep-hints: [pdf][jpg?dimensions=94x94]" \
    -H "authorization: Bearer ACCESS_TOKEN"
```

## APIレスポンス

このAPIコールの結果、`{+asset_path}`値を含む`url_template`値を使用して1つ以上のレプリゼンテーションが返されます。

```json theme={null}
{
  "etag": "1",
  "id": "123",
  "representations": {
    "entries": [
      {
        "content": {
          "url_template": "https://dl.boxcloud.com/api/2.0/internal_files/123/versions/345/representations/pdf/content/{+asset_path}"
        },
        "info": {
          "url": "https://api.box.com/2.0/internal_files/123/versions/345/representations/pdf"
        },
        "properties": {},
        "representation": "pdf",
        "status": {
          "state": "success"
        }
      }
    ]
  },
  "type": "file"
}
```

<Note>
  このレスポンスの`url_template`は、**不明瞭な**URLです。このURL形式は、時間が経つと変わる可能性があるため、`{+asset_path}`変数の有無を除き、この形式についてさまざまな憶測を立てないようにしてください。
</Note>

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

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