343 lines
9.0 KiB
TypeScript
343 lines
9.0 KiB
TypeScript
/**
|
|
* 企业微信客户联系 API 类型定义
|
|
*/
|
|
/**
|
|
* 外部联系人详情
|
|
*/
|
|
export interface ExternalContact {
|
|
/** 外部联系人userid */
|
|
external_userid: string;
|
|
/** 名称(微信用户返回昵称,企业微信用户返回对外展示名称) */
|
|
name: string;
|
|
/** 头像URL(部分应用不可获取) */
|
|
avatar?: string;
|
|
/** 1-微信用户,2-企业微信用户 */
|
|
type: 1 | 2;
|
|
/** 0-未知,1-男性,2-女性 */
|
|
gender: 0 | 1 | 2;
|
|
/** 微信unionid(需绑定微信开发者ID) */
|
|
unionid?: string;
|
|
/** 职位(仅企业微信用户) */
|
|
position?: string;
|
|
/** 企业简称(仅企业微信用户) */
|
|
corp_name?: string;
|
|
/** 企业主体名称(仅企业微信用户) */
|
|
corp_full_name?: string;
|
|
/** 自定义展示信息(仅企业微信用户) */
|
|
external_profile?: ExternalProfile;
|
|
}
|
|
/**
|
|
* 外部联系人自定义展示信息
|
|
*/
|
|
export interface ExternalProfile {
|
|
/** 自定义展示字段列表 */
|
|
external_attr: ExternalAttr[];
|
|
}
|
|
/**
|
|
* 自定义展示字段
|
|
*/
|
|
export interface ExternalAttr {
|
|
/** 0-文本,1-网页,2-小程序 */
|
|
type: number;
|
|
/** 属性名称 */
|
|
name: string;
|
|
/** 文本内容(type=0时) */
|
|
text?: {
|
|
value: string;
|
|
};
|
|
/** 网页内容(type=1时) */
|
|
web?: {
|
|
url: string;
|
|
title: string;
|
|
};
|
|
/** 小程序内容(type=2时) */
|
|
miniprogram?: {
|
|
appid: string;
|
|
pagepath: string;
|
|
title: string;
|
|
};
|
|
}
|
|
/**
|
|
* 标签信息
|
|
*/
|
|
export interface Tag {
|
|
/** 标签分组名称 */
|
|
group_name: string;
|
|
/** 标签名称 */
|
|
tag_name: string;
|
|
/** 企业标签ID(用户自定义标签不返回) */
|
|
tag_id?: string;
|
|
/** 1-企业设置,2-用户自定义,3-规则组标签 */
|
|
type: 1 | 2 | 3;
|
|
}
|
|
/**
|
|
* 视频号信息
|
|
*/
|
|
export interface WechatChannels {
|
|
/** 视频号名称 */
|
|
nickname: string;
|
|
/** 0-未知,1-主页,2-直播间,3-留资服务 */
|
|
source: 0 | 1 | 2 | 3;
|
|
}
|
|
/**
|
|
* 跟进用户信息
|
|
*/
|
|
export interface FollowUser {
|
|
/** 成员userid */
|
|
userid: string;
|
|
/** 该成员对客户的备注 */
|
|
remark: string;
|
|
/** 该成员对客户的描述 */
|
|
description: string;
|
|
/** 添加时间(Unix时间戳) */
|
|
createtime: number;
|
|
/** 标签列表 */
|
|
tags: Tag[];
|
|
/** 备注的企业名称 */
|
|
remark_corp_name: string;
|
|
/** 备注的手机号(部分应用不可获取) */
|
|
remark_mobiles?: string[];
|
|
/** 添加来源 */
|
|
add_way: number;
|
|
/** 视频号信息(add_way=10时有此字段) */
|
|
wechat_channels?: WechatChannels;
|
|
/** 发起添加的userid */
|
|
oper_userid: string;
|
|
/** 自定义state参数(联系我/获客链接) */
|
|
state?: string;
|
|
}
|
|
/**
|
|
* 获取客户详情API响应
|
|
*/
|
|
export interface GetExternalContactResponse {
|
|
/** 返回码 */
|
|
errcode: number;
|
|
/** 返回信息 */
|
|
errmsg: string;
|
|
/** 外部联系人详情 */
|
|
external_contact: ExternalContact;
|
|
/** 添加了此外部联系人的企业成员列表 */
|
|
follow_user: FollowUser[];
|
|
/** 分页cursor(跟进人>500时返回) */
|
|
next_cursor?: string;
|
|
}
|
|
/**
|
|
* 获取access_token API响应
|
|
*/
|
|
export interface AccessTokenResponse {
|
|
/** 返回码 */
|
|
errcode: number;
|
|
/** 返回信息 */
|
|
errmsg: string;
|
|
/** 获取到的凭证 */
|
|
access_token?: string;
|
|
/** 凭证有效期(秒) */
|
|
expires_in?: number;
|
|
}
|
|
/**
|
|
* 获取配置了客户联系功能的成员列表API响应
|
|
*/
|
|
export interface GetFollowUserListResponse {
|
|
/** 返回码 */
|
|
errcode: number;
|
|
/** 返回信息 */
|
|
errmsg: string;
|
|
/** 配置了客户联系功能的成员userid列表 */
|
|
follow_user?: string[];
|
|
}
|
|
/**
|
|
* 获取客户列表API响应
|
|
*/
|
|
export interface GetExternalContactListResponse {
|
|
/** 返回码 */
|
|
errcode: number;
|
|
/** 返回信息 */
|
|
errmsg: string;
|
|
/** 外部联系人的userid列表 */
|
|
external_userid?: string[];
|
|
}
|
|
/**
|
|
* 批量获取客户详情API响应
|
|
*/
|
|
export interface BatchGetExternalContactResponse {
|
|
/** 返回码 */
|
|
errcode: number;
|
|
/** 返回信息 */
|
|
errmsg: string;
|
|
/** 外部联系人详情列表 */
|
|
external_contact_list?: ExternalContact[];
|
|
/** 下一次分页的起始位置 */
|
|
next_cursor?: string;
|
|
}
|
|
/**
|
|
* 结束语文本内容
|
|
*/
|
|
export interface ConclusionText {
|
|
/** 文本内容 */
|
|
content: string;
|
|
}
|
|
/**
|
|
* 结束语
|
|
*/
|
|
export interface Conclusion {
|
|
/** 文本结束语 */
|
|
text?: ConclusionText;
|
|
}
|
|
/**
|
|
* 添加「联系我」方式请求参数
|
|
*/
|
|
export interface AddContactWayRequest {
|
|
/** 联系方式类型,1-单人,2-多人 */
|
|
type: 1 | 2;
|
|
/** 场景,1-在小程序中联系,2-通过二维码联系 */
|
|
scene: 1 | 2;
|
|
/** 在小程序中联系时使用的控件样式 */
|
|
style?: number;
|
|
/** 联系方式的备注信息,用于助记,不超过30个字符 */
|
|
remark?: string;
|
|
/** 外部客户添加时是否无需验证,默认为true */
|
|
skip_verify?: boolean;
|
|
/** 企业自定义的state参数,用于区分不同的添加渠道 */
|
|
state?: string;
|
|
/** 使用该联系方式的用户userID列表,在type为1时为必填,且只能有一个 */
|
|
user?: string[];
|
|
/** 使用该联系方式的部门id列表,只在type为2时有效 */
|
|
party?: number[];
|
|
/** 是否临时会话模式 */
|
|
is_temp?: boolean;
|
|
/** 临时会话二维码有效期,以秒为单位 */
|
|
expires_in?: number;
|
|
/** 临时会话有效期,以秒为单位 */
|
|
chat_expires_in?: number;
|
|
/** 可进行临时会话的客户unionid */
|
|
unionid?: string;
|
|
/** 是否开启同一外部企业客户只能添加同一个员工 */
|
|
is_exclusive?: boolean;
|
|
/** 是否标记客户添加来源 */
|
|
mark_source?: boolean;
|
|
/** 结束语 */
|
|
conclusions?: Conclusion;
|
|
}
|
|
/**
|
|
* 添加「联系我」方式响应
|
|
*/
|
|
export interface AddContactWayResponse {
|
|
/** 返回码 */
|
|
errcode: number;
|
|
/** 返回信息 */
|
|
errmsg: string;
|
|
/** 联系方式的配置id */
|
|
config_id?: string;
|
|
/** 联系方式二维码的URL,开发者需要自行将此二维码转换为图片 */
|
|
qr_code?: string;
|
|
}
|
|
/**
|
|
* 获取「联系我」方式请求参数
|
|
*/
|
|
export interface GetContactWayRequest {
|
|
/** 联系方式的配置id */
|
|
config_id: string;
|
|
}
|
|
/**
|
|
* 获取「联系我」方式响应
|
|
*/
|
|
export interface GetContactWayResponse {
|
|
/** 返回码 */
|
|
errcode: number;
|
|
/** 返回信息 */
|
|
errmsg: string;
|
|
/** 联系方式配置信息 */
|
|
contact_way?: ContactWayInfo;
|
|
}
|
|
/**
|
|
* 联系方式配置信息
|
|
*/
|
|
export interface ContactWayInfo {
|
|
/** 联系方式配置id */
|
|
config_id: string;
|
|
/** 联系方式类型 */
|
|
type: 1 | 2;
|
|
/** 场景 */
|
|
scene: 1 | 2;
|
|
/** 在小程序中联系时使用的控件样式 */
|
|
style?: number;
|
|
/** 联系方式的备注信息 */
|
|
remark?: string;
|
|
/** 是否无需验证 */
|
|
skip_verify: boolean;
|
|
/** state参数 */
|
|
state?: string;
|
|
/** 使用该联系方式的用户userID列表 */
|
|
user?: string[];
|
|
/** 使用该联系方式的部门id列表 */
|
|
party?: number[];
|
|
/** 是否临时会话模式 */
|
|
is_temp: boolean;
|
|
/** 临时会话二维码有效期 */
|
|
expires_in?: number;
|
|
/** 临时会话有效期 */
|
|
chat_expires_in?: number;
|
|
/** 临时会话指定的客户unionid */
|
|
unionid?: string;
|
|
/** 是否开启同一外部企业客户只能添加同一个员工 */
|
|
is_exclusive: boolean;
|
|
/** 结束语 */
|
|
conclusions?: Conclusion;
|
|
/** 二维码的URL */
|
|
qr_code?: string;
|
|
}
|
|
/**
|
|
* 更新「联系我」方式请求参数
|
|
*/
|
|
export interface UpdateContactWayRequest {
|
|
/** 联系方式的配置id */
|
|
config_id: string;
|
|
/** 在小程序中联系时使用的控件样式 */
|
|
style?: number;
|
|
/** 联系方式的备注信息 */
|
|
remark?: string;
|
|
/** 是否无需验证 */
|
|
skip_verify?: boolean;
|
|
/** 使用该联系方式的用户userID列表 */
|
|
user?: string[];
|
|
/** 使用该联系方式的部门id列表 */
|
|
party?: number[];
|
|
/** 是否临时会话模式 */
|
|
is_temp?: boolean;
|
|
/** 临时会话二维码有效期 */
|
|
expires_in?: number;
|
|
/** 临时会话有效期 */
|
|
chat_expires_in?: number;
|
|
/** 临时会话指定的客户unionid */
|
|
unionid?: string;
|
|
/** 是否开启同一外部企业客户只能添加同一个员工 */
|
|
is_exclusive?: boolean;
|
|
/** 结束语 */
|
|
conclusions?: Conclusion;
|
|
}
|
|
/**
|
|
* 更新「联系我」方式响应
|
|
*/
|
|
export interface UpdateContactWayResponse {
|
|
/** 返回码 */
|
|
errcode: number;
|
|
/** 返回信息 */
|
|
errmsg: string;
|
|
}
|
|
/**
|
|
* 删除「联系我」方式请求参数
|
|
*/
|
|
export interface DeleteContactWayRequest {
|
|
/** 联系方式的配置id */
|
|
config_id: string;
|
|
}
|
|
/**
|
|
* 删除「联系我」方式响应
|
|
*/
|
|
export interface DeleteContactWayResponse {
|
|
/** 返回码 */
|
|
errcode: number;
|
|
/** 返回信息 */
|
|
errmsg: string;
|
|
}
|
|
//# sourceMappingURL=wechat.d.ts.map
|