AI agents can use the SimplePost documentation index at /llms.txt to find related guides.
發文模型
每個 SimplePost 介面最終都會建立相同類型的貼文:內容、目標帳號或平台、選用的媒體,以及選用的供應商專屬設定。
SDK 結構
{
content: {
text: "Launch day",
media: [{ type: "image", url: "https://cdn.example.com/image.jpg" }],
},
platforms: ["x", "instagram", "linkedin"],
options: {
common: { logLevel: "info" },
x: { replyToId: "1234567890" },
},
}
當您直接呼叫 @simple-post/sdk,或為 CLI 提供 --post-json 以進行本機帳號發文時,請使用此結構。
Scheduler 與 API 結構
Scheduler 與自行代管 REST 伺服器以具體的帳號 ID 為目標:
{
"message": "Launch day",
"accountIds": ["x-main", "linkedin-main"],
"media": [
{
"type": "image",
"url": "https://cdn.example.com/image.jpg"
}
],
"postingMode": "schedule",
"scheduledFor": "2030-05-01T14:30:00Z"
}
自行代管 REST 伺服器僅支援 postingMode: "now"。Scheduler 支援 now、schedule 與 draft。
欄位
| 欄位 | 意義 |
|---|---|
content.text / message | 貼文根內容文字或說明文字。 |
content.media / media | 在支援的情況下使用本機路徑的圖片或影片、已上傳的媒體參照,或公開網址。 |
platforms | SDK 平台鍵值,例如 x、telegram 或 youtube。 |
accountIds | Scheduler 或 REST 伺服器的帳號 ID。 |
options | SDK 平台選項與憑證。 |
accountOptions | 每個帳號的 API 選項,通常會與已儲存的帳號預設值合併。 |
accountOverrides | 用於 API 發文的每個帳號訊息或媒體覆寫。 |
postingMode | Scheduler 中的 now、schedule 或 draft。自行代管 REST 伺服器僅接受 now。 |
thread | 依序排列的後續區段;須遵守平台與介面的限制。 |
quotePostId | 要引用的現有 SimplePost 來源紀錄。 |
repost | 在支援時覆寫自動轉發設定。 |
idempotencyKey | 唯一的建立操作金鑰;在回應不確定後,請以相同內容重複使用。 |
scheduledFor | 未來的 ISO 8601 日期時間,須含時區偏移或 Z;排程時為必填。 |
結果
SimplePost 會依平台或帳號回傳結果。多平台發文可能部分失敗。
Scheduler 與 REST 伺服器的回應包含:
post:SimplePost 貼文紀錄或回應物件。postingResults:每個帳號一筆結果。summary:成功數、失敗數與整體是否成功。
Scheduler 貼文紀錄可以是 draft、scheduled、pending、published 或 failed。草稿儲存時不會被平台驗證阻擋;但在發佈或排程之前仍會執行驗證。
只要貼文的目標超過一個帳號,請務必檢查每個帳號的結果。