> ## 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 文件

> 了解如何使用 Ayrshare API 取得所有已發佈與已排程的社群媒體貼文，包含每則貼文的歷史記錄、狀態與分析資料。

本指南說明如何透過不同方式取得帳戶下的所有貼文，無論來自 Ayrshare 或其他來源。

## 取得所有使用者設定檔的所有貼文（來源為 Ayrshare）

1. 取得與主要設定檔關聯的所有使用者設定檔:

   * 在標頭中使用你的 [Authorization Bearer](/apis/overview#authorization) token
   * 呼叫 [Get User Profiles](/apis/profiles/get-profiles) 端點

2. 取得設定檔 keys:

   * 從每個使用者設定檔中擷取 `refId`
   * 使用你的內部資料儲存建立相關使用者設定檔 key 的清單

3. 取得貼文:
   * 使用 [Posts History](/apis/history/get-history) 端點
   * 取得與每個使用者設定檔 key 相關的所有貼文

## 取得特定社群平台下所有使用者的貼文（Ayrshare 與非 Ayrshare 來源）

1. 取得與主要設定檔關聯的所有使用者設定檔:

   * 在標頭中使用你的 [Authorization Bearer](/apis/overview#authorization) token
   * 呼叫 [Get User Profiles](/apis/profiles/get-profiles) 端點

2. 取得設定檔 keys:

   * 從每個使用者設定檔中擷取 `refId`
   * 使用你的內部資料儲存建立相關使用者設定檔 key 的清單

3. 取得特定社群平台的貼文
   * 使用 [Posts History for a Platform](/apis/history/history-platform) 端點
   * 在 `platform` 路徑參數中放入平台名稱。可用值: `facebook`、`instagram`、`linkedin`、`pinterest`、`snapchat`、`threads`、`tiktok`、`twitter`、`youtube`
   * 取得與每個使用者設定檔 key 相關的所有平台貼文
