執行環境POST
刷新執行狀態
同步帳號最新的渠道執行狀態。runtime_status 取值統一為以下平台標準集合之一:unknown、starting、running、stopping、stopped、reconnecting、disconnected、error。provider 私有的狀態名稱會先被規範化到此集合再回傳。
https://api.unifyport.ai/v1/accounts/{account_id}/runtime/refresh請求標頭
X-Api-Keystring必填
工作區 API Key,工作區會由此標頭解析得到。
Content-Typestring必填
傳送 JSON 請求內容時請使用 application/json。
路徑參數
account_idstring必填
用於該 runtime 路由的識別字。
請求內容
此介面接收空 JSON 物件;請依請求範例傳送 {}。
回應內容
account_idstring
本回應所對應的渠道帳號。
providerstring
處理此執行階段操作的渠道。
enum: telegram, whatsapp, line, twitter, zalo, tiktok, whatsapp_protocol
actionstring
本次要求的執行階段操作。
enum: refresh_status, start, stop, reconnect
operation_statusstring
執行階段操作已受理或完成的狀態。
runtime_statusstring
標準化的執行階段狀態,為 unknown、starting、running、stopping、stopped、reconnecting、disconnected 或 error 其中之一。
enum: unknown, starting, running, stopping, stopped, reconnecting, disconnected, error
runtime_errorstring
操作未完成時的渠道執行階段錯誤。
回應
200200 OK
請求成功,回應內容範例如上。
400請求錯誤
請求內容、路徑或參數無效。
401未授權
X-Api-Key 請求標頭缺少或無效。
409衝突
目前操作與既有的渠道帳號或資源衝突。
500伺服器錯誤
服務遇到了未預期的錯誤。
502上游閘道錯誤
渠道轉接器或上游渠道未能完成此操作。
請求
curl -X POST https://api.unifyport.ai/v1/accounts/{account_id}/runtime/refresh \
-H "X-Api-Key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{}'回應
{
"data": {
"account_id": "acc_example",
"runtime_status": "running"
}
}