Tài liệu API

Gọi Auto Sub qua API

Tự động tạo job reup từ link bằng curl, script hay n8n. Mọi request xác thực bằng API token cá nhân.

1. Xác thực

Lấy token ở Cài Đặt → API Token. Gắn vào header mọi request:

Authorization: Bearer <API_TOKEN>

Base URL: https://auto-sub.io.vn

2. Tạo job reup

POST/api/jobs
TrườngBắt buộcMô tả
urlLink video TikTok / Douyin cần reup.
target_languageNgôn ngữ đích, vd "Vietnamese".
auto_processing_enabledkhôngtrue = chạy tự động toàn bộ (không dừng xác nhận). Khuyên dùng cho n8n.
voicekhôngMã giọng đọc (bỏ trống = mặc định theo cài đặt).
voice_providerkhông"vbee" (cao cấp) hoặc "edge-tts" (tiêu chuẩn).
speed_adjustmentkhôngĐiều chỉnh tốc độ giọng (-20..20).
fb_page_idkhôngpage_id Facebook để tự đăng (nếu đã cấu hình).
curl -X POST https://auto-sub.io.vn/api/jobs \
  -H "Authorization: Bearer <API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://www.tiktok.com/@user/video/123",
    "target_language": "Vietnamese",
    "auto_processing_enabled": true,
    "voice_provider": "vbee"
  }'

Trả về id của job để theo dõi.

3. Kiểm tra trạng thái

GET/api/jobs/:id
curl https://auto-sub.io.vn/api/jobs/123 \
  -H "Authorization: Bearer <API_TOKEN>"

status: pending → processing → completed / failed. Khi xong, final_video_url là link tải video.

4. Dùng trong n8n

  1. Node HTTP Request: Method POST, URL https://auto-sub.io.vn/api/jobs.
  2. Header Authorization: Bearer <API_TOKEN>, Body JSON như trên (đặt auto_processing_enabled: true).
  3. Lấy id từ response → node tiếp theo gọi GET /api/jobs/{id} để poll tới khi completed.
  4. Dùng final_video_url để tải / đăng tiếp.

Workflow n8n mẫu (miễn phí)

Tải workflow mẫu, import vào n8n và thay API token của bạn là chạy được ngay.

⬇️ Tải workflow n8n mẫu