跳到主要内容
开发者文档API 参考模板

查询模板

单个模板。

GEThttps://runner.cargoduo.com/v1/templates/{id}

免费,不扣积分。

认证

Bearer API 密钥 · 所需权限范围resources:read了解更多

路径参数

名称类型必填说明
idstring必填
string
是

模板 ID(tpl_…)。

请求示例

curl -X GET "https://runner.cargoduo.com/v1/templates/tpl_42" \
  -H "Authorization: Bearer $CARGODUO_API_KEY"

响应示例

200 OK · Template
{
  "id": "tpl_42",
  "object": "template",
  "label": "Euro pallet",
  "shape": "box",
  "length": 120,
  "width": 80,
  "height": 140,
  "radius": 0,
  "weight": 450,
  "stackable": false,
  "max_stack_weight": 0,
  "rotation": "all",
  "hazardous": false,
  "priority": 0,
  "color": "#3b82f6",
  "nesting_height": 0,
  "created_by": {
    "id": "usr_7",
    "name": "Elif Kaya"
  },
  "updated_by": {
    "id": "usr_7",
    "name": "Elif Kaya"
  },
  "created_at": "2026-09-28T14:05:52Z",
  "updated_at": "2026-09-28T14:05:52Z"
}

响应

  • 200OK该模板。
    名称类型必填说明
    idstring
    string
    否

    模板 ID(tpl_…)。

    objectstring
    string
    否
    template
    labelstring
    string
    否

    显示标签。

    shapestring
    string
    否

    物品形状。cylinder 和 drum 使用 radius + height,而非 length + width;pallet 和 drum 始终保持直立。

    boxcylinderpalletbagdrum
    lengthnumber · cm
    number · cm
    否

    长度。除非 shape 为 cylinder 或 drum,否则必填。

    widthnumber · cm
    number · cm
    否

    宽度。除非 shape 为 cylinder 或 drum,否则必填。

    heightnumber · cm
    number · cm
    否

    高度(物品按定义摆放时的竖直边)。

    radiusnumber · cm
    number · cm
    否

    半径。shape 为 cylinder 或 drum 时必填。

    weightnumber · kg
    number · kg
    否

    单件物品的重量。

    stackableboolean
    boolean
    否

    允许在其上方放置其他物品。

    max_stack_weightnumber · kg
    number · kg
    否

    单件物品上方可承受的最大重量。0 = 不限。

    rotationstring
    string
    否

    all = 六种朝向均可;upright = 只能绕竖直轴旋转(此面朝上);fixed = 不旋转。

    alluprightfixed
    hazardousboolean
    boolean
    否

    危险品:放在低处,并与其他危险品隔开。

    priorityinteger
    integer
    否

    装载优先级。值越高越先装载,空间不足时优先保留。0 = 无。

    colorstring
    string
    否

    显示颜色,格式为 #rrggbb(仅用于查看器和 PDF)。

    nesting_heightnumber · cm
    number · cm
    否

    相同物品堆叠时相互嵌套的重叠高度(如可嵌套的周转箱、桶)。

    created_byUserRef | null
    UserRef | null
    否

    创建者(通过 API 调用时为创建该密钥的成员)。未知时为 null。

    updated_byUserRef | null
    UserRef | null
    否

    最后修改它的成员。

    created_atstring
    string
    否

    RFC 3339 格式。

    updated_atstring
    string
    否

    RFC 3339 格式。

  • 401Unauthorizedunauthorizedkey_revokedkey_expired
    • unauthorizedAPI 密钥缺失、格式错误或无法识别。
    • key_revoked密钥已被撤销。
    • key_expired密钥已过期。
    名称类型必填说明
    errorErrorBody必填
    ErrorBody
    是
    全部错误码
  • 403Forbiddenip_not_allowedsubscription_inactiveaccount_inactivescope_missing
    • ip_not_allowed调用方 IP 不在该密钥的 IP 白名单中。
    • subscription_inactive组织没有包含 API 的有效订阅。
    • account_inactive组织已被暂停使用,或其所有者的账户均未处于有效状态。
    • scope_missing密钥缺少此接口所需的权限范围。
    名称类型必填说明
    errorErrorBody必填
    ErrorBody
    是
    全部错误码
  • 404Not foundtemplate_not_found
    • template_not_found您的组织中没有此 ID 的模板。
    名称类型必填说明
    errorErrorBody必填
    ErrorBody
    是
    全部错误码
  • 429Too many requestsrate_limited
    • rate_limited当前分钟、小时或天内的请求过多(按密钥或按组织计),或您的 IP 地址每分钟认证失败超过 60 次。
    名称类型必填说明
    errorErrorBody必填
    ErrorBody
    是
    全部错误码
  • 500Internal server errorinternal_error
    • internal_error服务端发生内部错误。
    名称类型必填说明
    errorErrorBody必填
    ErrorBody
    是
    全部错误码
  • 503Service unavailableapi_disabled
    • api_disabledAPI 暂时停用(维护中),或已对该组织关闭。
    名称类型必填说明
    errorErrorBody必填
    ErrorBody
    是
    全部错误码