sangtao.ai
API key

Đăng bài

Lấy một bài đăng

Một bài đăng và kết quả trên từng nền tảng.

GEThttps://api.sangtao.ai/v2/publishing/posts/{id}

Xác thực

  • X-Api-Keystring · headerbắt buộc

    API key của bạn, tạo ở trang API key trong tài khoản.

Tham số đường dẫn

  • idstringbắt buộc

    ID trong đường dẫn.

Hỏi lại mỗi 10–15 giây, dừng khi status là trạng thái cuối: Published, PartiallyPublished, Failed hoặc Cancelled. PartiallyPublished là bình thường khi đăng nhiều nền tảng — đọc platforms[].error để biết lý do, rồi đăng lại.

Response

  • idstring (guid)bắt buộc

    ID bài đăng

  • teamIdstring (guid)bắt buộc

    Nhóm đã dùng để đăng

  • teamNamestringbắt buộc

    Tên nhóm đó

  • webJobIdstring | null

    Job sangtao.ai đã đăng, khi đăng bằng jobId

  • titlestring | null

    Tiêu đề hiển thị: tiêu đề YouTube, không có thì caption của nền tảng đầu tiên

  • thumbnailUrlstring | null

    Ảnh bìa

  • statusstringbắt buộc

    Trạng thái chung của bài. Trạng thái cuối: Published, PartiallyPublished, Failed, Cancelled

    Giá trị có thể:PendingProcessingDraftUploadingScheduledPublishingPublishedPartiallyPublishedFailedCancelled

  • statusMessagestring | null

    Ghi chú ngắn về trạng thái

  • scheduledAtstring | null

    Thời điểm hẹn đăng (UTC), nếu có

  • createdAtstringbắt buộc

    Thời điểm tạo bài (ISO 8601, UTC)

  • platformsobject[]bắt buộc

    Mỗi nền tảng một phần tử

    Hiện thuộc tính con
    • idstringbắt buộc

      Mã mục của nền tảng này trong bài, pp_…. Chuỗi mờ, đừng so sánh hay tính toán

    • platformstringbắt buộc

      Nền tảng

      Giá trị có thể:TikTokYouTubeInstagramFacebookThreadsTwitter

    • postTypestring | null

      Loại bài bạn gửi; null khi dùng loại mặc định

      Giá trị có thể:POSTREELSTORYSHORTVIDEOIMAGE

    • statusstringbắt buộc

      Trạng thái trên nền tảng này

      Giá trị có thể:DraftUploadingScheduledPublishingPublishedFailedCancelledRetrying

    • captionstring | null

      Nội dung bài đã gửi

    • titlestring | null

      Tiêu đề đã gửi (YouTube)

    • descriptionstring | null

      Mô tả đã gửi (YouTube)

    • externalUrlstring | null

      Link tới bài trên nền tảng, khi đã đăng

    • errorstring | null

      Lý do thất bại, khi Failed

    • publishedAtstring | null

      Thời điểm bài lên (ISO 8601, UTC)

  • webhookobject

    Chỉ có khi request gửi webhookUrl: kết quả lần giao gần nhất. Không nằm trong data của webhook

    Hiện thuộc tính con
    • urlstringbắt buộc

      webhookUrl đã gửi

    • statusstringbắt buộc

      waiting: chưa xong, chưa gửi. pending: hỏng, sẽ thử lại

      Giá trị có thể:waitingpendingsucceededfailed

    • attemptCountnumberbắt buộc

      Số lần đã thử

    • lastHttpStatusnumber | null

      Mã URL trả lần gần nhất

    • lastErrorstring | null

      Lý do lần thử gần nhất hỏng

    • deliveryIdstring | null

      dlv_… — xem bằng GET /webhooks/deliveries/{deliveryId}

Mã lỗi

MãerrorCodeKhi nào
404POST_NOT_FOUNDKhông có bài nào của bạn với id này
GET/publishing/posts/{id}
curl "https://api.sangtao.ai/v2/publishing/posts/7c9e6679-7425-40de-944b-e07fc1f90ae7" \
  -H "X-Api-Key: YOUR_API_KEY"
{
  "success": true,
  "data": {
    "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "teamId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "teamName": "Main channels",
    "webJobId": null,
    "title": "How to make iced coffee at home",
    "thumbnailUrl": "https://cdn.example.com/cover.jpg",
    "status": "PartiallyPublished",
    "statusMessage": null,
    "scheduledAt": null,
    "createdAt": "2026-11-08T02:00:00Z",
    "platforms": [
      {
        "id": "pp_3kT9qPz0B",
        "platform": "TikTok",
        "postType": null,
        "status": "Published",
        "caption": "Iced coffee in 3 steps #coffee",
        "title": null,
        "description": null,
        "externalUrl": "https://www.tiktok.com/@yourchannel/video/1234567890",
        "error": null,
        "publishedAt": "2026-11-08T02:03:00Z"
      },
      {
        "id": "pp_9pW4nKt1H",
        "platform": "YouTube",
        "postType": "SHORT",
        "status": "Failed",
        "caption": null,
        "title": "How to make iced coffee at home",
        "description": "A three-step recipe.",
        "externalUrl": null,
        "error": "The video is too long for Shorts",
        "publishedAt": null
      }
    ],
    "webhook": {
      "url": "https://example.com/webhooks/sangtao",
      "status": "succeeded",
      "attemptCount": 1,
      "lastHttpStatus": 200,
      "lastError": null,
      "deliveryId": "dlv_7Fz2kWq4N"
    }
  }
}