貼文編輯貼文

貼文

編輯貼文

任何網路開始傳送前,可替換 targets、設定 scheduledAt,或在 draft 與 scheduled 之間切換,其餘欄位不變。

PATCHhttps://api.sofia-post.com/api/v1/posts/{id}
PATCH/v1/posts/{id}

此請求將作用於你的真實帳號。

curl -X PATCH 'https://api.sofia-post.com/api/v1/posts/{id}' \
  -H "Authorization: Bearer $SOFIA_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"scheduledAt":"2026-11-02T10:00:00.000Z"}'

授權

  • Authorizationstring必填

    你的個人金鑰或 OAuth 存取權杖,以 Bearer <token> 傳送。

路徑參數

  • idstring必填

    貼文的識別碼。

請求本文

application/json

  • targetsobject[]

    全部目標,整體改寫(文案、媒體、格式、帳號);省略則保持不變

    顯示子屬性
    • platformstring必填

      目標網路

      允許的值: instagramfacebookxlinkedintiktok

    • textstring必填

      在此網路上發布的文案

    • mediaobject[]

      附加的媒體

      顯示子屬性
      • idstring

        門市媒體庫中某個媒體的識別碼(否則用 url 和 type)

      • urlstring

        媒體的公開位址(正式模式下為 https);不提供識別碼時使用

      • typestring

        按位址提供的媒體的類型

        允許的值: imagevideo

    • formatstring

      格式(post、reel、story、carousel 等);預設為該網路會採用的格式

    • accountIdstring

      正式模式:負責發布的已連結帳號,在門市於該網路有多個帳號時使用(GET /v1/establishments/:id/accounts)

  • scheduledAtstring<date-time>

    新的未來時間:貼文將在此時間排程發布

  • statusstring

    draft:退回草稿(保留內容,遺失時間);scheduled:按 scheduledAt 排程,或按原來的時間

    允許的值: draftscheduled

回應

200application/json

編輯後的貼文。

  • idstring必填

    貼文的識別碼

  • statusstring必填

    跨所有網路的狀態;partial:在一個網路發布成功,在另一個失敗

    允許的值: draftscheduledpublishingpublishedsent_to_inboxfailedpartial

  • establishmentIdstring必填

    貼文所屬的門市

  • createdAtstring<date-time>必填

    貼文的建立時間

  • targetsobject[]必填

    每個網路和帳號一條:同一網路上的兩個帳號對應兩條

    顯示子屬性
    • platformstring必填

      目標所在的網路

    • accountIdstring必填

      負責發布的帳號(GET /v1/establishments/:id/accounts)

    • statestring必填

      目標在其網路上的狀態

      允許的值: draftscheduledpublishingpublishedsent_to_inboxfailed

    • publishedAtstring<date-time>

      目標發布的時間

    • permalinkstring

      指向網路上已發布貼文的連結

    • errorstring

      網路拒絕的原因

  • scheduledAtstring<date-time>

    貼文預計發布的時間

402

subscription_required。

403

測試應用回傳 live_mode_required,或缺少 posts:write scope。

404

post_not_found:權杖無法存取該貼文。

409

post_not_editable:某個網路已傳送或正在傳送。

422application/json

post_refused:某個網路、門市或 Publishing 會拒絕編輯後的貼文。同一網路上有兩個目標時回傳 duplicate_platform。

4XXapplication/json

其他任何錯誤,以錯誤結構回傳。