POST 新建位置保修码
参数位置:body:customerId、fields、labelTemplateId、faultCategoryId。 POST 为客户新建位置保修码(同一客户相同位置字段不能重复)。body 为 JSON 对象:必填 customerId(客户ID)、fields(位置字段数组,至少1个完整字段、最多20个,每项必填 label 字段名如 车间/产线/设备位,最多80字,同一码内不能重复;value 字段值,最多256字)。位置路径由各字段值按「 / 」拼接生成。
| 接口编码 | 所需范围 | 后端接口 |
|---|---|---|
sales.service-repair-code.location-create | sales:write | POST /v1/repair-codes/location/create(comap-sales) |
必填字段
| 字段 | 依据 |
|---|---|
customerId | 参数说明 |
fields | 参数说明 |
fields[].label | 参数说明 |
条件必填(如「某状态时必填」)不在此表,以上方参数说明为准。 判定规则见必填字段的判定。
请求体字段(body)
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
customerId | integer(int64) | — | — |
fields3 | LocationField[] | — | — |
labelTemplateId | integer(int64) | — | — |
faultCategoryId | integer(int64) | — | — |
「必填」仅反映接口规格声明的部分。服务内还有未体现在规格里的校验, 标「—」不等于可以不传;租户在主站配置的字段必填不约束本接口。 详见必填字段的判定与字段清单与自定义字段。
请求示例
curl -X POST https://open.risemap.cn/v1/api/invoke \
-H "Authorization: Bearer <访问令牌>" \
-H "Content-Type: application/json" \
-d '{
"apiCode": "sales.service-repair-code.location-create",
"body": {}
}'
响应 data 字段
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | integer(int64) | — | — |
kind | string | — | — |
token | string | — | — |
publicPath | string | — | — |
codeVersion | integer(int32) | — | — |
enabled | integer(int32) | — | — |
customerId | integer(int64) | — | — |
customerName | string | — | — |
customerCode | string | — | — |
customerCategory | string | — | — |
customerEnabled | integer(int32) | — | — |
locationFields3 | LocationFieldVO[] | — | — |
locationPath | string | — | — |
faultCategoryId | integer(int64) | — | — |
faultCategoryIds | integer(int64)[] | — | — |
labelTemplateId | integer(int64) | — | — |
labelPrintedAt | string(date-time) | — | — |
labelPrintedTemplateId | integer(int64) | — | — |
updateTime | string(date-time) | — | — |
version | integer(int32) | — | — |
错误处理
响应统一信封 { code, message, data },code == 200 为成功。以下是本接口可能返回的开放平台层错误:
| 错误码 | 说明 | 可重试 |
|---|---|---|
| 92101 | 访问凭证无效 | 否 |
| 92201 | 接口未登记或已停用 | 否 |
| 92202 | 超出凭证授权范围——本接口需 sales:write | 否 |
| 92204 | 绑定员工无此接口的功能权限 | 否 |
| 92203 | 上游服务调用失败 | 先查询处理结果,禁止盲目重试 |
| 92301 | 请求过于频繁 | 是 |
| 92205 | 写操作处理超时,结果未知(下游可能仍在执行) | 否,先查询确认结果 |
| 92302 | 有参数相同的写请求正在处理中 | 等待并确认前一次结果,勿重复提交 |
除此之外,comap-sales 自身的业务校验失败会原样透传其业务码与提示
(如字段校验、状态不允许、数据不存在),这类码不在开放平台的号段内,
以响应里的 message 为准。完整的平台层错误码见错误码说明。