Skip to content

查询导出模板详情

(type, id) 查询单个导出模板的完整内容(同步返回)。

通常用法是先调用 查询导出模板列表 拿到 templates[].id,再用本接口取详情;如果你已经把 id 存了下来,也可以直接调用本接口。

请求地址

GET {BASE_URL}/api/open/v1/export-templates/get

鉴权 Header

创建翻译任务 完全一样。GET 无 body 参与签名,签名算式退化为 MD5(timestamp + "" + appSecret)

请求参数(Query)

参数类型必填说明
typestring模板类型,可选 project_strings / task_strings,详见 列表接口
idstring模板 ID(来自列表接口的 templates[].id

响应

json
{
  "success": true,
  "code": 0,
  "msg": "ok",
  "trace_id": "...",
  "data": {
    "type": "project_strings",
    "template": {
      "id": "tpl-9d3f1a2c",
      "name": "默认 INI 导出",
      "is_default": true,
      "format": "ini",
      "mode": "single",
      "languages": ["en", "ja", "ko"],
      "field_order": [
        { "type": "language", "value": "en" },
        { "type": "language", "value": "ja" },
        { "type": "language", "value": "ko" }
      ],
      "created_at": 1715520000000,
      "updated_at": 1715520000000
    }
  }
}

字段含义与 列表接口 完全一致;列表里的每个 templates[] 元素就是这里 template 的对象结构。

错误码

code说明
400type 缺失或非法 / id 缺失
401签名校验失败 / 时间戳过期
403App Secret 未配置
404找不到指定 id 的模板(注意:type 选错也会 404,因为不同 typeid 不串用)
500系统错误

示例

bash
APP_KEY="5685414646a54423c891d87194d87f3f"
APP_SECRET="<你的 App Secret>"
BASE_URL="https://api.loxily.com"

TIMESTAMP=$(date +%s)
SIGN=$(printf '%s' "${TIMESTAMP}${APP_SECRET}" | md5)

curl -s -G "${BASE_URL}/api/open/v1/export-templates/get" \
  --data-urlencode "type=project_strings" \
  --data-urlencode "id=tpl-9d3f1a2c" \
  -H "X-Loxily-AppKey: ${APP_KEY}" \
  -H "X-Loxily-Timestamp: ${TIMESTAMP}" \
  -H "X-Loxily-Sign: ${SIGN}"