跳到主要内容

GET 客户部门列表

参数位置:query:customerId。 GET 查询。query 参数:customerId(必填,客户ID)。返回该客户的部门扁平列表(按同级排序),每项含 id、parentId(0=一级部门)、name、fullName(上级/本级全称)、sortOrder、activeContactCount / inactiveContactCount(直属在职/非在职联系人数,不含下级部门)、remark,可按 parentId 自行组树。

接口编码所需范围后端接口
sales.customer.org-unit.listsales:readGET /v1/customer/org-unit/list(comap-sales)

请求参数(query)

字段类型必填说明
customerIdinteger(int64)是客户 ID

「必填」仅反映接口规格声明的部分。服务内还有未体现在规格里的校验, 标「—」不等于可以不传;租户在主站配置的字段必填不约束本接口。 详见必填字段的判定与字段清单与自定义字段。

请求示例

curl -X POST https://open.risemap.cn/v1/api/invoke \
-H "Authorization: Bearer <访问令牌>" \
-H "Content-Type: application/json" \
-d '{
"apiCode": "sales.customer.org-unit.list",
"query": {
"customerId": "1961000000000000001"
}
}'

响应 data 字段

字段类型必填说明
idinteger(int64)—部门ID
customerIdinteger(int64)—客户ID
parentIdinteger(int64)—上级部门ID,0 表示一级部门
namestring—部门名称
fullNamestring—部门全称(上级/本级)
sortOrderinteger(int32)—同级排序值
activeContactCountinteger(int32)—直属在职联系人数(不含下级部门)
inactiveContactCountinteger(int32)—直属非在职联系人数(不含下级部门)
remarkstring—备注

错误处理​

响应统一信封 { code, message, data },code == 200 为成功。以下是本接口可能返回的开放平台层错误:

错误码说明可重试
92101访问凭证无效否
92201接口未登记或已停用否
92202超出凭证授权范围——本接口需 sales:read否
92204绑定员工无此接口的功能权限否
92203上游服务调用失败是
92301请求过于频繁是

除此之外,comap-sales 自身的业务校验失败会原样透传其业务码与提示 (如字段校验、状态不允许、数据不存在),这类码不在开放平台的号段内, 以响应里的 message 为准。完整的平台层错误码见错误码说明。

← 返回客户组织架构