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>'| Param | Mặc định | Mô tả |
|---|---|---|
type | (không) | primary để chỉ trả task site chính. Bỏ trống → trả cả 2 (legacy) |
limit | 5 | Số 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#
| Field | Mô tả |
|---|---|
id | Task ID (= podcast_post_link.id) |
request_id | UUID podcast_post.id |
type_request | Luôn "post" |
status | Status task: queued / running / completed / failed / cancel |
account_id | ID account đăng ký primary site |
group_id | UUID group |
target | Số tập muốn đăng (= podcast_post.target) |
accounts_remaining | Số account site phụ trong group chưa có task post (worker biết workload site phụ còn lại) |
email / username / password | Credentials login |
pass_mail | Mật khẩu Gmail |
twofa | Base32 TOTP secret |
app_password | App password Gmail |
data_content | Mả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 |
cookie | Session 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 running → completed. 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-..." }'| Field | Bắt buộc | Mô tả | Ghi vào |
|---|---|---|---|
link_post | ✔ | URL episode đã đăng | podcast_post_link.link_post |
note | tuỳ chọn | Ghi chú | podcast_post_link.note |
Field credentials/
link_rssgử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!@#"
}'| Field | Mô tả | Ghi vào |
|---|---|---|
link_rss | URL RSS feed (BẮT BUỘC khi xong primary) | podcast_account.link_rss |
cookie | Cookie session | podcast_account.cookie |
email / password / pass_mail / twofa / app_password | Credentials thay đổi | podcast_account.<field> |
usernameKHÔNG override — đồng bộ vớipodcast_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 }