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

# Pinterest API

> Pinterest API を使用した投稿のオプション

## Pinterest に画像 Pin を投稿する

Pinterest API では投稿に画像を含める必要があります。その他のパラメーターはオプションです。
詳細については [Pinterest Media Guidelines](/media-guidelines/pinterest) と [Pinterest Authorization](/dashboard/connect-social-accounts/pinterest) を参照してください。

```json Pinterest Post theme={"system"}
{
  "post": "The best Pinterest API ever!", // Maximum 500 characters or empty string
  "platforms": ["pinterest"],
  "mediaUrls": ["https://images.ayrshare.com/imgs/GhostBusters.jpg"]
}
```

## Pinterest オプション

`pinterestOptions` パラメーターを使用して、投稿に追加のオプションを設定できます。

```json Pinterest Post theme={"system"}
{
  "post": "The best Pinterest API ever!", // Maximum 500 characters or empty string
  "platforms": ["pinterest"],
  "mediaUrls": ["https://images.ayrshare.com/imgs/GhostBusters.jpg"],
  "pinterestOptions": {
    "altText": ["This is my best pic", "😃 here is the next one"], // maximum 500 characters
    "boardId": "93383204522",
    "carouselOptions": [
      {
        "title": "Image 1",
        "link": "https://www.cnn.com",
        "description": "Super Image 1"
      },
      {
        "title": "Image 2",
        "link": "https://www.google.com",
        "description": "Super Image 2"
      }
    ],
    "link": "https://www.ayrshare.com", // maximum 2048 characters
    "note": "Private note", // maximum 1000 characters
    "thumbNail": "https://images.ayrshare.com/imgs/GhostBusters.jpg",
    "title": "A Pinterest Board for You" // maximum 100 characters
  }
}
```

Pinterest オプションは、投稿を制御するために使用できるオプションフィールドです。

<ParamField body="altText" type="array of strings">
  アクセシビリティとスクリーンリーダー用の画像と動画の代替テキスト。最大 500 文字。

  詳細については [Pinterest Alternative Text](/apis/post/social-networks/pinterest#alternative-text) を参照してください。
</ParamField>

<ParamField body="boardId" type="string">
  /user/details エンドポイントから ID を指定することで、ユーザーの別の Pinterest ボードに投稿します。

  指定されていない場合、デフォルトで連携されているボードに投稿します。

  詳細については [Pinterest Board ID](/apis/post/social-networks/pinterest#board-id) を参照してください。
</ParamField>

<ParamField body="carouselOptions" type="array of objects">
  オプションのタイトル、リンク、説明とともに最大 5 個の画像を Pinterest カルーセルとして追加します。

  各オブジェクトには `title`、`link`、`description` を含めることができます。

  詳細については [Pinterest Image Carousel](/apis/post/social-networks/pinterest#pinterest-image-carousel) を参照してください。
</ParamField>

<ParamField body="link" type="string">
  ユーザーが Pin 画像をクリックしたときに誘導される宛先 URL。最大 2048 文字。

  Pin にクリック可能なリンクを付与します。

  詳細については [Pin Link](/apis/post/social-networks/pinterest#pin-link) を参照してください。
</ParamField>

<ParamField body="note" type="string">
  自分とボードコラボレーターだけが見ることができるプライベートなノートを個別の Pin に追加します。最大 1000 文字。

  詳細については [Pin Note](/apis/post/social-networks/pinterest#pin-note) を参照してください。
</ParamField>

<ParamField body="thumbNail" type="string">
  動画 Pin のサムネイルを設定します。PNG または JPG、動画と同じ寸法、10MB 未満である必要があります。

  動画 Pin では必須です。

  詳細については [Video Pin (Thumbnail)](/apis/post/social-networks/pinterest#video-pin-thumbnail) を参照してください。
</ParamField>

<ParamField body="title" type="string">
  "Add your title" セクションに表示する Pin のタイトル。最大 100 文字。

  詳細については [Pin Title](/apis/post/social-networks/pinterest#pin-title) を参照してください。
</ParamField>

<sup>\*</sup>`post` フィールドのリンクはクリックできません。Pin にクリック可能なリンクを追加するには、`link` フィールドを使用してください。

詳細については [Pinterest Media Guidelines](/media-guidelines/pinterest) を参照してください。

## 代替テキスト

Pinterest の画像または動画に代替テキスト(alt text とも呼ばれる)を追加します。Pinterest の alt text は、追加のユーザー情報とスクリーンリーダーに使用されるアクセシビリティ機能です。

`pinterestOptions` オブジェクトの `altText` を使用します。

```json Pinterest Alt Text theme={"system"}
{
  "pinterestOptions": {
    "altText": ["This is my best pic", "😃 here is the next one"]
  }
}
```

alt text は 500 文字に制限されています。

## Board ID

[/user/details](/apis/user/pinterest-board) エンドポイントから取得した ID を指定することで、ユーザーの別の Pinterest ボードに投稿します。それ以外の場合、デフォルトで連携されているボードに投稿します。

`pinterestOptions` オブジェクトの `boardId` を使用します。

```json Pinterest Board ID theme={"system"}
{
  "pinterestOptions": {
    "boardId": "93383204522"
  }
}
```

## 文字数制限

詳細については [Pinterest Character Limits](/help-center/technical-support/character_limits#pinterest-character-limits) を参照してください。

## Pin リンク

ユーザーがピン画像をクリックしたときに誘導される宛先 URL。Pin にクリック可能なリンクを付与します。最大長は 2048 文字です。

`pinterestOptions` オブジェクトの `link` を使用します。

```json Pin Link theme={"system"}
{
  "pinterestOptions": {
    "link": "https://www.ayrshare.com"
  }
}
```

## Pin ノート

ボード上の個別の Pin にプライベートなノートを追加できます。自分とボードコラボレーターだけが見ることができます。

`pinterestOptions` オブジェクトの `note` を使用します。

```json Pin Note theme={"system"}
{
  "pinterestOptions": {
    "note": "Private note for collaborators"
  }
}
```

## Pinterest 画像カルーセル

最大 5 個の画像を Pinterest カルーセルとして投稿します。複数のメディア URL を追加することで、自動的にカルーセルが作成されます。オプションのカルーセルパラメーターも追加できます。詳細は下記を参照してください。

```json Pinterest Carousel Post theme={"system"}
{
  "post": "Carousel Time",
  "platforms": ["pinterest"],
  "mediaUrls": [
    "https://img.ayrshare.com/random/photo-1.jpg",
    "https://img.ayrshare.com/random/photo-2.jpg"
  ],
  "pinterestOptions": {
    "carouselOptions": [
      // optional
      {
        "title": "Image 1",
        "link": "https://www.cnn.com",
        "description": "Super Image 1"
      },
      {
        "title": "Image 2",
        "link": "https://www.google.com",
        "description": "Super Image 2"
      }
    ]
  }
}
```

オプションの `carouselOptions` フィールドは、オブジェクトの配列を受け取ります。各カルーセルオブジェクトは、対応するメディア URL 文字列に対応します。たとえば、最初のカルーセルオブジェクトは最初の `mediaUrl` 文字列を参照します。

<ul class="custom-bullets">
  <li>`title`: 画像のタイトル。</li>
  <li>`link`: 画像の外部宛先リンク。</li>
  <li>`description`: 画像の説明。</li>
</ul>

## Pinterest メンション

Pinterest 投稿に @handle を追加できますが、Pinterest は投稿テキスト内のメンション解決をサポートしていません。
@handle はプレーンテキストのままになります。

## Pin タイトル

表示する Pin のタイトル。新しい Pin の "Add your title" セクションに表示されます。最大 100 文字。

`pinterestOptions` オブジェクトの `title` を使用します。

```json Pin Title theme={"system"}
{
  "pinterestOptions": {
    "title": "A Pinterest Board for You"
  }
}
```

## 動画 Pin(サムネイル)

動画は [/post エンドポイント](/apis/post/post) の標準の `mediaUrls` フィールドを使用して Pin として投稿できます。加えて、`image/jpeg` などの有効なメディア Content-Type を持つサムネイル画像 URL **を必ず含める必要があります**。
[要件](/media-guidelines/pinterest) を参照してください。

```json Video Pin with Thumbnail theme={"system"}
{
  "pinterestOptions": {
    // required
    "thumbNail": "https://images.unsplash.com/photo-1513093496871-0a81425386e5?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxNjQ1ODN8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mzg0ODAzNDA&ixlib=rb-1.2.1&q=80&w=400"
  }
}
```

[API を使用した Pin の投稿](https://www.ayrshare.com/blog/pinterest-api-integration-on-ayrshare/) についての追加情報。

動画が mp4 などの既知の動画拡張子で終わらない場合は、`isVideo` パラメーターを使用してください。詳細は [/post エンドポイント](/apis/post/post) を参照してください。
