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

# API を使ってすべての投稿を取得する方法 | Ayrshare Docs

> Ayrshare API を使用して、公開済みおよびスケジュール済みのソーシャルメディア投稿すべて(履歴、ステータス、各投稿のアナリティクスを含む)を取得する方法を学びます。

このガイドでは、Ayrshare 由来か他のソースかを問わず、アカウントに関連するすべての投稿を、異なるアプローチで取得する方法を説明します。

## すべての User Profile のすべての投稿を取得する(Ayrshare 由来)

1. プライマリプロファイルに関連付けられたすべての user profile を取得します:

   * ヘッダーに [Authorization Bearer](/apis/overview#authorization) トークンを使用します
   * [Get User Profiles](/apis/profiles/get-profiles) エンドポイントを呼び出します

2. profile key を取得します:

   * 各 user profile から `refId` を抽出します
   * 内部ストアを使用して、関連する user profile key のリストを作成します

3. 投稿を取得します:
   * [Posts History](/apis/history/get-history) エンドポイントを使用します
   * 各 user profile key に関連付けられたすべての投稿を取得します

## 全ユーザー、特定のソーシャルネットワークの投稿を取得する(Ayrshare 由来と非 Ayrshare 由来)

1. プライマリプロファイルに関連付けられたすべての user profile を取得します:

   * ヘッダーに [Authorization Bearer](/apis/overview#authorization) トークンを使用します
   * [Get User Profiles](/apis/profiles/get-profiles) エンドポイントを呼び出します

2. profile key を取得します:

   * 各 user profile から `refId` を抽出します
   * 内部ストアを使用して、関連する user profile key のリストを作成します

3. 特定のソーシャルネットワークの投稿を取得します
   * [Posts History for a Platform](/apis/history/history-platform) エンドポイントを使用します
   * `platform` パスパラメータにプラットフォームを配置します。値: `facebook`、
     `instagram`、`linkedin`、`pinterest`、`snapchat`、`threads`、`tiktok`、`twitter`、`youtube`
   * 各 user profile key に関連付けられた特定のプラットフォームのすべての投稿を取得します
