設定 Harness
Landing Page Task API
非同步生成落地頁並查詢任務歷史。
POST
/v2/landing_page認證
Bearer API key
Content type
application/json or multipart/form-data
限流說明
可能適用 endpoint 專屬限制。
Landing Page Task API 用於非同步生成落地頁。先建立任務,然後複用 task polling APIs 查詢進度、歷史結果和生成出的 ai_page_html。
認證
Authorization: Bearer YOUR_API_KEY建立落地頁任務
POST https://openapi.felo.ai/v2/landing_page請求 Body
| 引數 | 型別 | 必填 | 說明 |
|---|---|---|---|
query | string | 是 | 落地頁生成需求 prompt |
stream_protocol | string | 否 | 串流協議,預設 message_center_v1 |
livedoc_short_id | string | 否 | 用作上下文的現有 LiveDoc short ID |
resource_ids | array of strings | 否 | 用作上下文的 LiveDoc 資源 ID |
範例
curl -X POST 'https://openapi.felo.ai/v2/landing_page' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"query":"Generate a landing page for Felo Search"}'Create With File
使用 multipart/form-data 上傳一個檔案。檔案會先作為 LiveDoc resource 上傳,再把 resource ID 傳給 Landing Page task。
curl -X POST 'https://openapi.felo.ai/v2/landing_page' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'query=Generate a landing page from this product brief' \
-F '[email protected]'成功後返回 task_id,用於後續輪詢。
Poll Task Status
GET https://openapi.felo.ai/v2/tasks/{task_id}/statuscurl -X GET 'https://openapi.felo.ai/v2/tasks/019cad6d-e874-55ef-d577-686344b5a7e9/status' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY'Query Task Historical Info
GET https://openapi.felo.ai/v2/tasks/{task_id}/historical完成後歷史結果會包含 task_status、ppt_biz_id、ppt_url 和 ai_page_html。狀態語義與 PPT Task API 共用。
錯誤碼
| Code | HTTP Status | 說明 |
|---|---|---|
INVALID_API_KEY | 401 | API Key 無效或已撤銷 |
LANDING_PAGE_TASK_CREATE_FAILED | 502 | 落地頁任務建立失敗 |
INSUFFICIENT_CREDITS | 402 | Credits 不足 |