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

# Postman

> 使用 Postman 測試你的 REST API 呼叫

Postman 是測試 HTTP API 端點呼叫的絕佳工具。我們建議先使用 Postman，這樣更容易診斷問題。

點選「Run in Postman」按鈕以在 Postman for the web 中 ***fork 一個版本***：

[![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/7602335-776bf0f9-c710-43cf-b3a2-7987801887f3?action=collection%2Ffork\&collection-url=entityId%3D7602335-776bf0f9-c710-43cf-b3a2-7987801887f3%26entityType%3Dcollection%26workspaceId%3Dcf2bf012-ff59-48a6-ba37-cf4864d2e43c)

fork 之後，我們建議 [下載 Postman](https://www.postman.com/downloads/) 免費使用桌面版。
桌面版更穩定，也具有更多功能。

<Info>
  請務必在請求標頭中設定 `Authorization: Bearer API_Key` 的值或 Profile Key。

  同時將環境變數 \{API\_Key} 設為你的 API\_KEY。
</Info>

<Tip>
  **Postman 小訣竅**

  <ul class="custom-bullets">
    <li>你可以加入變數值（例如像 API\_KEY 這樣的全域變數）以便更方便地在 Postman 中進行 API 呼叫。[如何操作的更多細節](https://learning.postman.com/docs/sending-requests/variables/variables/)請見 Postman 網站。</li>
    <li>在 Postman 的請求主體設定為 x-www-form-urlencoded 時，你可以透過將鍵設為 \[0] 值的方式傳送陣列。例如，要送出貼文，你可以將 platforms\[0] 設為第一個值，platforms\[1] 設為第二個值。</li>
  </ul>
</Tip>

## 使用隨機文字與圖片測試

我們也建議你使用 [隨機文字與圖片](/quickstart#publish-test-posts) 進行測試，以免你的帳號被社群網路鎖定。

## 使用 Postman 自動產生 API 程式碼

你甚至可以直接從 Postman 為大多數程式設計語言自動產生程式碼——Node.js、PHP、Python、C# 等等。請觀看下方影片了解如何使用 Postman 並產生程式碼。

<div class="video-container">
  <iframe width="560" height="330" src="https://www.youtube.com/embed/T-ui_z2oyAU" title="Postman Auto Generate API Code" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />
</div>
