Podcast — Post site chính (primary)#

Worker site chính đăng N episode lên platform podcast (vd studio.firstory.me), complete xong trả link_rss để site phụ pull tiếp import feed.

Base URL: https://manager.likepion.com/api/v1/podcast

Filter param: tất cả endpoint GET /podcast/links ở mục này dùng ?type=primary để chỉ trả task site chính.


1. Lấy danh sách task site chính #

curl -X GET 'https://manager.likepion.com/api/v1/podcast/links?type=primary&limit=5' \
  -H 'X-API-Key: <api_key>'
ParamMặc địnhMô tả
type(không)primary để chỉ trả task site chính. Bỏ trống → trả cả 2 (legacy)
limit5Số task (max 1000)

Response#

Site chính = task thật trong bảng podcast_post_link, có field data_content (mảng N episode worker đăng tuần tự).

{
  "success": true,
  "data": [
    {
      "id": "uuid-task",
      "request_id": "uuid-post",
      "type_request": "post",
      "status": "queued",
      "account_id": "uuid",
      "group_id": "uuid",
      "target": 100,
      "accounts_remaining": 8,
      "domain": "studio.firstory.me",
      "website": "https://likepion.com",
      "email": "pod.real@anchor.fm",
      "username": "realpoduser",
      "password": "realPwd!",
      "pass_mail": "xxxx xxxx xxxx xxxx",
      "twofa": "JBSWY3DPEHPK3PXP",
      "app_password": "xxxx xxxx xxxx xxxx",
      "data_content": [
        {
          "id": "uuid-episode-1",
          "title": "Episode 1: SEO On-page cơ bản",
          "about": "<article><p>Nội dung tập 1...</p></article>",
          "image_url": "https://s3.likepion.com/data/xxx.png"
        },
        {
          "id": "uuid-episode-2",
          "title": "Episode 2: ...",
          "about": "<article><p>...</p></article>",
          "image_url": "https://s3.likepion.com/data/yyy.png"
        }
      ],
      "cookie": "session=abc123"
    }
  ]
}

Fields#

FieldMô tả
idTask ID (= podcast_post_link.id)
request_idUUID podcast_post.id
type_requestLuôn "post"
statusStatus task: queued / running / completed / failed / cancel
account_idID account đăng ký primary site
group_idUUID group
targetSố tập muốn đăng (= podcast_post.target)
accounts_remainingSố account site phụ trong group chưa có task post (worker biết workload site phụ còn lại)
email / username / passwordCredentials login
pass_mailMật khẩu Gmail
twofaBase32 TOTP secret
app_passwordApp password Gmail
data_contentMảng N episode [{id, title, about, image_url}, ...]. Mỗi episode có id UUID duy nhất để worker theo dõi từng tập
cookieSession cookie (cuối cùng)

2. Lấy chi tiết 1 task #

curl -X GET 'https://manager.likepion.com/api/v1/podcast/links/TASK_ID' \
  -H 'X-API-Key: <api_key>'

Trả 1 object (schema giống mục 1). 404 nếu task không tồn tại.


3. Báo đang xử lý #

Sau khi pull, bắt buộc gọi để chuyển task sang running. Idempotent.

curl -X POST 'https://manager.likepion.com/api/v1/podcast/links/<task_id>/start' \
  -H 'X-API-Key: <api_key>'

Response: { "success": true }


4. Báo hoàn thành — /complete #

Task chuyển runningcompleted. CHỈ cập nhật task (link_post + status).

Cập nhật link_rss / credentials → endpoint riêng POST /podcast/links/:id/account (xem mục 5).

curl -X POST 'https://manager.likepion.com/api/v1/podcast/links/<task_id>/complete' \
  -H 'X-API-Key: <api_key>' \
  -H 'Content-Type: application/json' \
  -d '{ "link_post": "https://studio.firstory.me/realpoduser/episodes/ep-1-..." }'
FieldBắt buộcMô tảGhi vào
link_postURL episode đã đăngpodcast_post_link.link_post
notetuỳ chọnGhi chúpodcast_post_link.note

Field credentials/link_rss gửi vào endpoint này sẽ bị bỏ qua — dùng /account để cập nhật.

Response: { "success": true }


5. Cập nhật account — /podcast/links/:id/account #

Cập nhật credentials + link_rss của podcast_account. BE tự lookup account_id từ task ID.

Site chính bắt buộc gọi sau /complete để báo link_rss (RSS feed) → site phụ có thể import feed.

curl -X POST 'https://manager.likepion.com/api/v1/podcast/links/<task_id>/account' \
  -H 'X-API-Key: <api_key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "link_rss": "https://anchor.fm/s/xxxxx/podcast/rss",
    "cookie": "session=abc123; csrf=xyz",
    "email": "newemail@anchor.fm",
    "password": "newPwd!@#"
  }'
FieldMô tảGhi vào
link_rssURL RSS feed (BẮT BUỘC khi xong primary)podcast_account.link_rss
cookieCookie sessionpodcast_account.cookie
email / password / pass_mail / twofa / app_passwordCredentials thay đổipodcast_account.<field>

username KHÔNG override — đồng bộ với podcast_register.username.

Response: { "success": true, "account_id": "uuid", "updated_fields": 3 }


6. Báo thất bại #

curl -X POST 'https://manager.likepion.com/api/v1/podcast/links/<task_id>/fail' \
  -H 'X-API-Key: <api_key>' \
  -H 'Content-Type: application/json' \
  -d '{"error_message": "audio upload failed: file too large"}'

Response: { "success": true }