企微管理
查询群CRM信息
查询企微客户群的详细信息,包括群成员、自定义字段、群会话存档同意情况等。chatId 必填,对应企微客户群的外部群 ID。群不存在时返回 data=null。
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 |
|---|---|---|---|---|
| appKey | string | 是 | 应用 AppKey | |
| time | int64 | 是 | 请求时间戳(秒) | |
| checksum | string | 是 | 请求签名校验和 | |
| checksumAlgorithm | int32 | 否 | 签名算法:0 - 默认(SHA1),1 - SHA256 |
请求体
| 名称 | 类型 | 必填 | 描述 | 示例值 |
|---|---|---|---|---|
| chatId | string | 是 | 企微客户群的外部群 ID | wrOgQwDgAAcwMTB7YmzP5BJ3E0n6fF-g |
返回参数
| 名称 | 类型 | 描述 | 示例值 |
|---|---|---|---|
| code | int32 | 状态码,200 表示成功 | 200 |
| message | string | 提示信息 | success |
| data | object | 群详细信息,群不存在时为 null | {"chatId":"wrOgQwDgAAcwMTB7YmzP5BJ3E0n6fF-g","groupName":"VIP客户服务群","memberSize":150} |
| └chatId | string | 企微客户群的外部群 ID | wrOgQwDgAAcwMTB7YmzP5BJ3E0n6fF-g |
| └groupName | string | 群名称 | VIP客户服务群 |
| └groupIcon | string | 群头像 URL | https://example.com/group-icon.jpg |
| └groupNotice | string | 群公告 | 欢迎加入VIP客户服务群,有任何问题请随时联系我们。 |
| └memberSize | int32 | 群成员数 | 150 |
| └ownerName | string | 群主名称 | 张三 |
| └customerMemberSize | int64 | 客户成员数 | 120 |
| └staffMemberSize | int64 | 坐席成员数 | 30 |
| └members | object[] | 群成员列表 | [{"userId":556677,"userGroupName":"VIP客户-张三","userGroupRole":3}] |
| └userId | int64 | 群成员用户 ID | 556677 |
| └userGroupName | string | 群成员群昵称 | VIP客户-张三 |
| └userGroupIcon | string | 群成员头像 URL | https://example.com/user-avatar.jpg |
| └userGroupRole | int32 | 群成员角色:1-群主,2-管理员,3-普通成员 | 3 |
| └escrow | int32 | 是否托管 | 0 |
| └externalUserId | string | 企微外部联系人 userid | wmOgQwDgAAcwMTB7YmzP5BJ3E0n6fF-g |
| └externalUserName | string | 企微外部联系人名称 | 李四 |
| └friendFlag | boolean | 是否为好友 | true |
| └crmId | string | CRM ID | crm_78901 |
| └tags | object[] | 客户标签 | [{"tagId":1,"tagName":"VIP"}] |
| └tagCustomId | int64 | 标签 ID | 1 |
| └tagName | string | 标签名称 | VIP |
| └customFieldValues | object[] | 群自定义字段值列表 | [{"fieldId":81001,"name":"订单号","value":"SO202608090001"}] |
| └id | int64 | 字段值记录 ID | 91001 |
| └name | string | 字段名称 | 订单号 |
| └type | int32 | 字段类型:0-文本、1-下拉菜单、2-多选、3-日期 | 0 |
| └description | string | 字段说明 | 客户订单编号 |
| └value | string | 字段值 | SO202608090001 |
| └valueEditable | int32 | 字段值是否可编辑:0-否、1-是 | 1 |
| └assignType | int32 | 字段归属类型 | 1 |
| └status | int32 | 字段状态:0-可用、1-不可用 | 0 |
| └required | int32 | 是否必填:0-否、1-是 | 1 |
| └dataId | int64 | 关联数据 ID | 556677 |
| └fieldId | int64 | 字段定义 ID | 81001 |
| └sort | int32 | 字段排序序号 | 1 |
| └prefill | string | 预填值 | 默认值 |
| └hint | string | 输入提示 | 请输入订单号 |
| └customer | int32 | 是否允许访客填写:0-否、1-是 | 1 |
| └show | int32 | 字段展示区域标识 | 1 |
| └displayType | int32 | 转义后的展示类型:1-客户中心、2-在线、4-呼叫 | 2 |
| └system | int32 | 是否为系统预留字段:0-自定义、1-系统预留 | 0 |
| └customField | object | 群自定义字段键值对象 | {"field1":"value1"} |
| └wxCorpName | string | 企微主体名称 | 某科技有限公司 |
| └wxCorpId | string | 企微 corpId | ww1234567890abcdef |
| └platformType | int32 | 平台类型 | 1 |
| └createtime | int64 | 群创建时间(毫秒时间戳) | 1699536000000 |
| └tags | object[] | 群标签列表 | [{"tagId":1,"tagName":"VIP"}] |
| └tagCustomId | int64 | 标签 ID | 1 |
| └tagName | string | 标签名称 | VIP |
| └leaderId | int64 | 群负责人(坐席)ID | 10001 |
| └vipLevel | int32 | VIP 等级 | 3 |
| └leader | string | 群负责人名称,若未找到则返回空字符串 | 张三 |
| └archiveInfo | object | 群会话存档同意情况 | {"wxworkAgreeFlag":1,"members":[]} |
| └wxworkAgreeFlag | int32 | 企微会话存档同意标识:0-未同意/未开通云商,1-已同意 | 1 |
| └members | object[] | 未同意会话存档的成员列表 | [{"userId":556677,"userGroupName":"VIP客户-张三"}] |
| └userId | int64 | 群成员用户 ID | 556677 |
| └userGroupName | string | 群成员群昵称 | VIP客户-张三 |
| └userGroupIcon | string | 群成员头像 URL | https://example.com/user-avatar.jpg |
| └userGroupRole | int32 | 群成员角色:1-群主,2-管理员,3-普通成员 | 3 |
| └escrow | int32 | 是否托管 | 0 |
| └externalUserId | string | 企微外部联系人 userid | wmOgQwDgAAcwMTB7YmzP5BJ3E0n6fF-g |
| └externalUserName | string | 企微外部联系人名称 | 李四 |
| └friendFlag | boolean | 是否为好友 | true |
| └crmId | string | CRM ID | crm_78901 |
| └tags | object[] | 客户标签 | [{"tagId":1,"tagName":"VIP"}] |
| └tagCustomId | int64 | 标签 ID | 1 |
| └tagName | string | 标签名称 | VIP |
| └lastSessionTime | int64 | 群最近一次会话时间(毫秒时间戳) | 1699539000000 |
错误码
| 状态码 | 描述 |
|---|---|
| 14001 | AppKey 不存在 |
| 14002 | checksum 校验失败 |
| 14003 | 请求时间戳为空或与服务器时间误差超过 10 分钟 |
| 14004 | 请求体不是合法 JSON |
| 14500 | 服务内部异常 |
postEndpoint
/openapi/crm/group/queryGroupInfocurl -X POST "https://qiyukf.com/openapi/crm/group/queryGroupInfo?appKey=string&time=0&checksum=string" \ -H "Content-Type: application/json" \ -d '{ "chatId": "wrOgQwDgAAcwMTB7YmzP5BJ3E0n6fF-g" }'{
"code": 200,
"message": "success",
"data": {
"chatId": "wrOgQwDgAAcwMTB7YmzP5BJ3E0n6fF-g",
"groupName": "VIP客户服务群",
"memberSize": 150
}
}{
"code": 14001,
"message": "AppKey 不存在"
}{
"code": 14002,
"message": "checksum 校验失败"
}{
"code": 14003,
"message": "请求时间戳为空或与服务器时间误差超过 10 分钟"
}{
"code": 14004,
"message": "请求体不是合法 JSON"
}{
"code": 14500,
"message": "服务内部异常"
}这篇文档有帮助吗?