修改任务术语
修改任务术语扫描结果中的单条术语。典型用法:auto_apply_terms=false 的任务在确认前调整 AI 误判的 category / 译文 / judgment 等。
请求地址
POST {BASE_URL}/api/open/v1/tasks/terms/update鉴权 Header
和 创建翻译任务 完全一样。
请求参数(Body)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
task_id | string | 是 | 目标任务 ID |
id | string | 是 | 要修改的术语 ID(来自 /tasks/terms 响应的 items[].id) |
term | string | 否 | 新的术语文本 |
category | string | 否 | 新的分类(如 Character / Item / Attributes / ...) |
judgment | string | 否 | AI 判定理由(可替换为人工备注) |
glossary_score | number | 否 | 重要度评分 0–10 |
translations | object | 否 | 部分更新。Key 是语言代码(连字符格式如 en / zh-cn),value 是译文。仅写你需要覆盖的语言;传空字符串等于清空该语言译文 |
至少传任一可选字段,否则等于空更新。
响应
成功(HTTP 200)—— 返回更新后的完整行:
json
{
"success": true,
"code": 0,
"msg": "ok",
"trace_id": "...",
"data": {
"id": "6626f0a32e8e5d24b6c9f1a2",
"term": "战斗力",
"content": "总战斗力的构成...",
"source_language": "zh-cn",
"category": "Attributes",
"glossary_score": 5,
"judgment": "...",
"translation_source": "ai",
"translations": {
"en": "Combat Power",
"ja": "戦闘力"
},
"updated_at": "2026-04-22T11:30:00.000Z"
}
}错误码
| code | 说明 |
|---|---|
| 400 | 缺少 task_id / id;glossary_score 非数字;translations 非 object;语言代码不被支持 |
| 401 | 签名校验失败 |
| 403 | 任务不属于该 App Key |
| 404 | 术语不存在于该任务 |
| 409 | 任务没有 TB_SCAN 作业(可能创建时 scan_terms=false) |
| 500 | 系统错误 |
示例
bash
APP_KEY="5685414646a54423c891d87194d87f3f"
APP_SECRET="<你的 App Secret>"
BASE_URL="https://api.loxily.com"
TIMESTAMP=$(date +%s)
BODY='{"task_id":"68a12cb7e1f9a88b4ea23c77","id":"6626f0a32e8e5d24b6c9f1a2","category":"Attributes","translations":{"en":"Combat Power"}}'
SIGN=$(printf '%s' "${TIMESTAMP}${BODY}${APP_SECRET}" | md5)
curl -s -X POST "${BASE_URL}/api/open/v1/tasks/terms/update" \
-H "Content-Type: application/json" \
-H "X-Loxily-AppKey: ${APP_KEY}" \
-H "X-Loxily-Timestamp: ${TIMESTAMP}" \
-H "X-Loxily-Sign: ${SIGN}" \
--data "${BODY}"