structs

package
v1.8.101 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2024 License: Zlib Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ItCreateAuth         = "create_auth"
	ItChangeAuth         = "change_auth"
	ItCancelAuth         = "cancel_auth"
	ItChangeContact      = "change_contact"
	ItShareAgentChange   = "share_agent_change"
	ItResetPermanentCode = "reset_permanent_code"
)

InfoType

View Source
const (
	CtCreateUser = "create_user"
	CtUpdateUser = "update_user"
	CtDeleteUser = "delete_user"
)
View Source
const (
	CtCreateParty = "create_party"
	CTUpdateParty = "update_party"
	CTDeleteParty = "delete_party"
)
View Source
const (
	EtLICUnlicensed        = "unlicensed_notify" //接口许可失效通知
	EtLICPaySuccess        = "license_pay_success"
	EtLICRefund            = "license_refund"
	EtLICAutoActive        = "auto_activate"
	EtUploadMediaJobFinish = "upload_media_job_finish"
)

MsgType= event, Event字段

View Source
const (
	ItChangeExternalContact = "change_external_contact"
	ItCustomerAcquisition   = "customer_acquisition"

	CtAddExternalContact     = "add_external_contact"      //添加企业客户事件
	CtEditExternalContact    = "edit_external_contact"     //编辑企业客户事件(授权企业中配置了客户联系功能的成员编辑外部联系人的备注信息(不包括备注手机号码)或企业标签时,企业微信服务器会向应用的“指令回调URL”推送该事件,但仅修改外部联系人备注手机号时不会触发回调。)
	CtAddHalfExternalContact = "add_half_external_contact" //外部联系人免验证添加成员事件(外部联系人添加了配置了客户联系功能且开启了免验证的成员时(此时成员尚未确认添加对方为好友),企业微信服务器会向应用的“指令回调URL”推送该事件)
	CtDeleteExternalContact  = "del_external_contact"      //删除企业客户事件(授权企业中配置了客户联系功能的成员删除外部联系人时,企业微信服务器会向应用的“指令回调URL”推送该事件)
	CtDeleteFollowUser       = "del_follow_user"           //删除跟进成员事件(授权企业中配置了客户联系功能的成员被外部联系人删除时,企业微信服务器会向应用的“指令回调URL”推送该事件)
	CtTransferFail           = "transfer_fail"             //客户接替失败事件(企业将客户分配给新的成员接替后,当客户添加失败时,企业微信服务器会向应用的“指令回调URL”推送该事件)
	CtBalanceLow             = "balance_low"               //获客额度即将耗尽事件
	CtBalanceExhausted       = "balance_exhausted"         //获客额度已经耗尽事件
	CtDeleteLink             = "delete_link"               //删除获客链接事件
	CtQuotaExpireSoon        = "quota_expire_soon"         //获客额度即将过期事件
	CtCustomerStartChat      = "customer_start_chat"       //微信客户发起会话事件
	CtLinkUnavailable        = "link_unavailable"          //获客链接失效事件
)

客户事件通知

View Source
const (
	ItChangeExternalChat = "change_external_chat"

	CtCreate  = "create"
	CtUpdate  = "update"
	CtDismiss = "dismiss"
	CtDelete  = "delete"
	CtShuffle = "shuffle" //重排 for tag
)
View Source
const (
	CtUpdateTag = "update_tag"
)
View Source
const (
	ItChangeExternalTag = "change_external_tag"
)
View Source
const (
	KEBatchJobResult = "batch_job_result"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountList added in v1.8.40

type AccountList struct {
	ActiveCode         string `json:"ActiveCode" xml:"ActiveCode"`
	UserId             string `json:"UserId" xml:"UserId"`
	PreviousActiveCode string `json:"PreviousActiveCode" xml:"PreviousActiveCode"`
	ExpireTime         int64  `json:"ExpireTime" xml:"ExpireTime"`
	Type               int    `json:"Type" xml:"Type"`
	PreviousStatus     int    `json:"PreviousStatus" xml:"PreviousStatus"`
}

type ActiveNotify added in v1.8.40

type ActiveNotify struct {
	AuthCorpId    string        `json:"AuthCorpId" xml:"AuthCorpId"`
	ServiceCorpId string        `json:"ServiceCorpId" xml:"ServiceCorpId"`
	Scene         string        `json:"Scene" xml:"Scene"`
	AccountList   []AccountList `json:"AccountList" xml:"AccountList"`
}

ActiveNotify 自动激活回调通知 InfoType = auto_activate

type AddContactWay added in v1.8.31

type AddContactWay struct {
	Type          int         `json:"type"`            //联系方式类型,1-单人, 2-多人
	Scene         int         `json:"scene"`           //场景,1-在小程序中联系,2-通过二维码联系
	Style         int         `json:"style"`           //联系方式的备注信息,用于助记,不超过30个字符
	Remark        string      `json:"remark"`          //联系方式的备注信息,用于助记,不超过30个字符
	SkipVerify    bool        `json:"skip_verify"`     //外部客户添加时是否无需验证,默认为true
	State         string      `json:"state"`           //企业自定义的state参数,用于区分不同的添加渠道,在调用“获取外部联系人详情”时会返回该参数值,不超过30个字符
	User          []string    `json:"user"`            //使用该联系方式的用户userID列表,在type为1时为必填,且只能有一个
	Party         []int       `json:"party"`           //使用该联系方式的部门id列表,只在type为2时有效
	IsTemp        bool        `json:"is_temp"`         //是否临时会话模式,true表示使用临时会话模式,默认为false
	ExpiresIn     int64       `json:"expires_in"`      //临时会话二维码有效期,以秒为单位。该参数仅在is_temp为true时有效,默认7天,最多为14天
	ChatExpiresIn int64       `json:"chat_expires_in"` //临时会话有效期,以秒为单位。该参数仅在is_temp为true时有效,默认为添加好友后24小时,最多为14天
	UnionId       string      `json:"unionid"`         //可进行临时会话的客户unionid,该参数仅在is_temp为true时有效,如不指定则不进行限制
	IsExclusive   bool        `json:"is_exclusive"`    //是否开启同一外部企业客户只能添加同一个员工,默认为否,开启后,同一个企业的客户会优先添加到同一个跟进人
	Conclusions   Conclusions `json:"conclusions"`     //结束语,会话结束时自动发送给客户,可参考“结束语定义”,仅在is_temp为true时有效
}

type AddContactWayResult added in v1.8.31

type AddContactWayResult struct {
	ConfigId string `json:"config_id"`
	QrCode   string `json:"qr_code"`
}

type AddMomentTask added in v1.8.4

type AddMomentTask struct {
	Text         ExText       `json:"text"` //不能与Attachment同时为空
	Attachments  []Attachment `json:"attachments"`
	VisibleRange VisibleRange `json:"visible_range"`
}

type AdminInfo added in v1.8.40

type AdminInfo struct {
	Userid     string `json:"userid"`
	OpenUserid string `json:"open_userid,omitempty"`
	AuthType   int    `json:"auth_type"`
}

type AdminList added in v1.8.40

type AdminList struct {
	Admins []AdminInfo `json:"admin"`
}

type Agent added in v1.8.40

type Agent struct {
	AgentId          int32      `json:"agentid"`
	Appid            int64      `json:"appid,omitempty"` //旧的多应用套件中的对应应用id,新开发者请忽略
	AuthMode         int        `json:"auth_mode"`
	Name             string     `json:"name"`
	RoundLogoUrl     string     `json:"round_logo_url"`
	SquareLogoUrl    string     `json:"square_logo_url"`
	IsCustomizedApp  bool       `json:"is_customized_app"`
	AuthFromThirdApp bool       `json:"auth_from_thirdapp"`
	Privilege        Privilege  `json:"privilege"`
	SharedFrom       SharedFrom `json:"shared_from"`
}

type AgentDetail added in v1.8.36

type AgentDetail struct {
	AgentId                 int32          `json:"agentid"`
	Name                    string         `json:"name"`                      //企业应用名称
	SquareLogoUrl           string         `json:"square_logo_url"`           //企业应用方形头像
	Description             string         `json:"description"`               //企业应用详情
	RedirectDomain          string         `json:"redirect_domain"`           //企业应用可信域名
	HomeUrl                 string         `json:"home_url"`                  //应用主页url
	AllowUserInfos          AllowUserInfos `json:"allow_userinfos"`           //企业应用可见范围(人员),其中包括userid
	AllowParties            AllowParties   `json:"allow_partys"`              //企业应用可见范围(部门)
	AllowTags               AllowTags      `json:"allow_tags"`                //企业应用可见范围(标签)
	Close                   int            `json:"close"`                     //企业应用是否被停用。0:未被停用;1:被停用
	ReportLocationFlag      int            `json:"report_location_flag"`      //企业应用是否打开地理位置上报 0:不上报;1:进入会话上报;
	IsReportEnter           int            `json:"isreportenter"`             //是否上报用户进入应用事件。0:不接收;1:接收
	CustomizedPublishStatus int            `json:"customized_publish_status"` //代开发自建应用返回该字段,表示代开发发布状态。0:待开发(企业已授权,服务商未创建应用);1:开发中(服务商已创建应用,未上线);2:已上线(服务商已上线应用且不存在未上线版本);3:存在未上线版本(服务商已上线应用但存在未上线版本)
}

type AgentInfo added in v1.8.87

type AgentInfo struct {
	AgentId       int32  `json:"agentid"`
	Name          string `json:"name"`
	SquareLogoUrl string `json:"square_logo_url"`
}

type AgreeInfo added in v1.0.54

type AgreeInfo struct {
	StatusChangeTime int64  `json:"status_change_time"` //同意状态改变的具体时间,utc时间
	Userid           string `json:"userid"`
	ExternalOpenId   string `json:"externalopenid"`
	AgreeStatus      string `json:"agree_status"` //同意:"Agree",不同意:"Disagree"
}

type AgreeNotify added in v1.0.54

type AgreeNotify struct {
	ToUserName     string `json:"ToUserName" xml:"ToUserName"`
	FromUserName   string `json:"FromUserName" xml:"FromUserName"`
	UserID         string `json:"UserID" xml:"UserID"`
	ExternalUserID string `json:"ExternalUserID" xml:"ExternalUserID"`
	WelcomeCode    string `json:"WelcomeCode" xml:"WelcomeCode"`
}

AgreeNotify 客户同意进行聊天内容存档事件回调

type AllowParties added in v1.8.101

type AllowParties struct {
	PartyId []int `json:"partyid"`
}

type AllowTags added in v1.8.36

type AllowTags struct {
	TagId []int `json:"tagid"`
}

type AllowUser added in v1.8.36

type AllowUser struct {
	Userid string `json:"userid"`
}

type AllowUserInfos added in v1.8.36

type AllowUserInfos struct {
	User []AllowUser `json:"user"`
}

type ApplicableRange added in v1.8.68

type ApplicableRange struct {
	UserList       []string `json:"user_list"`
	DepartmentList []int32  `json:"department_list"`
}

type Articles

type Articles struct {
	Title  string `json:"title"`
	Desc   string `json:"description"`
	Url    string `json:"url"`
	Picurl string `json:"picurl"`
}

type Attachment added in v1.0.34

type Attachment struct {
	MsgType string     `json:"msgtype"`
	Image   *ExImage   `json:"image,omitempty"`
	Link    *ExLink    `json:"link,omitempty"`
	Program *ExProgram `json:"miniprogram,omitempty"`
	Video   *ExVideo   `json:"video,omitempty"`
	File    *ExFile    `json:"file,omitempty"`
}

type Attribute

type Attribute struct {
	Type        int                   `json:"type"`
	Name        string                `json:"name"`
	Text        *AttributeText        `json:"text,omitempty"`
	Web         *AttributeWeb         `json:"web,omitempty"`
	MiniProgram *AttributeMiniProgram `json:"miniprogram,omitempty"`
}

type AttributeMiniProgram

type AttributeMiniProgram struct {
	Appid    string `json:"appid"`
	PagePath string `json:"pagepath"`
	Title    string `json:"title"`
}

type AttributeText

type AttributeText struct {
	Value string `json:"value"`
}

type AttributeWeb

type AttributeWeb struct {
	Url   string `json:"url"`
	Title string `json:"title"`
}

type AuthCorpInfo added in v1.8.40

type AuthCorpInfo struct {
	CorpId            string `json:"corpid"`
	CorpName          string `json:"corp_name"`
	CorpType          string `json:"corp_type"`
	CorpSquareLogoUrl string `json:"corp_square_logo_url"`
	CorpUserMax       int    `json:"corp_user_max"`
	CorpFullName      string `json:"corp_full_name"`
	VerifiedEndTime   int64  `json:"verified_end_time"`
	SubjectType       int    `json:"subject_type"`
	CorpWxqrcode      string `json:"corp_wxqrcode"`
	CorpScale         string `json:"corp_scale"`
	CorpIndustry      string `json:"corp_industry"`
	CorpSubIndustry   string `json:"corp_sub_industry"`
}

type AuthInfo added in v1.8.40

type AuthInfo struct {
	Agent []Agent `json:"agent"`
}

type AuthNotify added in v1.8.40

type AuthNotify struct {
	SuiteId    string `json:"SuiteId" xml:"SuiteId"`
	AuthCorpId string `json:"AuthCorpId" xml:"AuthCorpId"`
	AuthCode   string `json:"AuthCode" xml:"AuthCode"`
	State      string `json:"State" xml:"State"`
}

AuthNotify 授权通知事件 InfoType = create_auth, change_auth, cancel_auth

type AuthUserInfo added in v1.8.40

type AuthUserInfo struct {
	Userid     string `json:"userid"`
	OpenUserid string `json:"open_userid"`
	Name       string `json:"name"`
	Avatar     string `json:"avatar"`
}

type BatchUserId

type BatchUserId struct {
	UseridList []string `json:"userid_list"`
	Cursor     string   `json:"cursor,omitempty"`
	Limit      int      `json:"limit"`
}

type BatchUserIdRes

type BatchUserIdRes struct {
	ExternalContactList []ExternalContactDetail `json:"external_contact_list"`
	NextCursor          string                  `json:"next_cursor"`
}

type BehaviorDataResult added in v1.8.23

type BehaviorDataResult struct {
	StatTime            int64   `json:"stat_time"`             //数据日期,为当日0点的时间戳
	ChatCnt             int32   `json:"chat_cnt"`              //聊天总数, 成员有主动发送过消息的单聊总数。
	MessageCnt          int32   `json:"message_cnt"`           //发送消息数,成员在单聊中发送的消息总数。
	ReplyPercentage     float64 `json:"reply_percentage"`      //已回复聊天占比,浮点型,
	AvgReplyTime        int32   `json:"avg_reply_time"`        //平均首次回复时长,单位为分钟
	NegativeFeedbackCnt int32   `json:"negative_feedback_cnt"` //删除/拉黑成员的客户数,即将成员删除或加入黑名单的客户数。
	NewApplyCnt         int32   `json:"new_apply_cnt"`         //发起申请数,成员通过
	NewContactCnt       int32   `json:"new_contact_cnt"`       //新增客户数,成员新添加的客户数量。
}

type ChatIdConvertItem added in v1.8.98

type ChatIdConvertItem struct {
	ChatId    string `json:"chat_id"`
	NewChatId string `json:"new_chat_id"`
}

type ChatIdConvertResult added in v1.8.98

type ChatIdConvertResult struct {
	Items             []ChatIdConvertItem `json:"items"`
	InvalidChatIdList []string            `json:"invalid_chat_id_list"`
}

type Conclusions added in v1.8.55

type Conclusions struct {
	Text        *ExText    `json:"text,omitempty"`
	Image       *ExImage   `json:"image,omitempty"`
	Link        *ExLink    `json:"link,omitempty"`
	MiniProgram *ExProgram `json:"miniprogram,omitempty"`
}

type ContactNotify added in v1.8.40

type ContactNotify struct {
	CtType         string         `json:"XCtType" xml:"XCtType"`
	SuiteId        string         `json:"SuiteId" xml:"SuiteId"`
	AuthCorpId     string         `json:"AuthCorpId" xml:"AuthCorpId"`
	UserID         string         `json:"UserID" xml:"UserID"`
	OpenUserID     string         `json:"OpenUserID" xml:"OpenUserID"`
	Name           string         `json:"Name" xml:"Name"`
	Mobile         string         `json:"Mobile" xml:"Mobile"`
	Position       string         `json:"Position" xml:"Position"`
	BizMail        string         `json:"BizMail" xml:"BizMail"`
	Email          string         `json:"Email" xml:"Email"`
	Avatar         string         `json:"Avatar" xml:"Avatar"`
	Alias          string         `json:"Alias" xml:"Alias"`
	Telephone      string         `json:"Telephone" xml:"Telephone"`
	Gender         int            `json:"Gender" xml:"Gender"`
	MainDepartment int64          `json:"MainDepartment" xml:"MainDepartment"`
	Department     []int64        `json:"Department" xml:"Department"`
	IsLeaderInDept []int          `json:"IsLeaderInDept" xml:"IsLeaderInDept"`
	DirectLeader   []string       `json:"DirectLeader" xml:"DirectLeader"`
	ExtAttribute   []ExtAttribute `json:"ExtAttr" xml:"ExtAttr"`
}

type ContactTagNotify added in v1.8.40

type ContactTagNotify struct {
	CtType        string   `json:"XCtType" xml:"XCtType"`
	SuiteId       string   `json:"SuiteId" xml:"SuiteId"`
	AuthCorpId    string   `json:"AuthCorpId" xml:"AuthCorpId"`
	TagId         int64    `json:"TagId" json:"TagId"`
	AddUserItems  []string `json:"AddUserItems" xml:"AddUserItems"`
	DelUserItems  []string `json:"DelUserItems" xml:"DelUserItems"`
	AddPartyItems []int64  `json:"AddPartyItems" xml:"AddPartyItems"`
	DelPartyItems []int64  `json:"DelPartyItems" xml:"DelPartyItems"`
}

type ContactWay added in v1.8.31

type ContactWay struct {
	ConfigId      string      `json:"config_id"`
	Type          int         `json:"type"`
	Scene         int         `json:"scene"`
	Style         int         `json:"style"`
	Remark        string      `json:"remark"`
	SkipVerify    bool        `json:"skip_verify"`
	State         string      `json:"state"`
	QrCode        string      `json:"qr_code"`
	User          []string    `json:"user"`
	Party         []int       `json:"party"`
	IsTemp        bool        `json:"is_temp"`
	ExpiresIn     int64       `json:"expires_in"`
	ChatExpiresIn int64       `json:"chat_expires_in"`
	UnionId       string      `json:"unionid"`
	Conclusions   Conclusions `json:"conclusions"`
}

type CreateUpdateDepMember added in v1.8.36

type CreateUpdateDepMember struct {
	Userid           string           `json:"userid"`
	Name             string           `json:"name"`
	Alias            string           `json:"alias"`
	Mobile           string           `json:"mobile"`
	Department       []string         `json:"department"`
	Order            []string         `json:"order"`
	Position         string           `json:"position"`
	Gender           string           `json:"gender"`
	Email            string           `json:"email"`
	BizMail          string           `json:"biz_mail"`
	IsLeaderInDept   []string         `json:"is_leader_in_dept,omitempty"`
	DirectLeader     []string         `json:"direct_leader,omitempty"`
	Enable           int              `json:"enable"`
	AvatarMediaId    string           `json:"avatar_mediaid,omitempty"`
	Telephone        string           `json:"telephone"`
	Address          string           `json:"address"`
	MainDepartment   string           `json:"main_department"`
	ExtAttr          *Attribute       `json:"extattr,omitempty"`
	ExternalProfile  *ExternalProfile `json:"external_profile,omitempty"`
	ToInvite         string           `json:"to_invite"`
	ExternalPosition string           `json:"external_position"`
}

CreateUpdateDepMember 成员创建与更新

type Cursor added in v1.8.68

type Cursor struct {
	Limit  int    `json:"limit"`
	Cursor string `json:"cursor,omitempty"`
}

type CursorSearchReq added in v1.8.31

type CursorSearchReq struct {
	StartTime int64  `json:"start_time,omitempty"`
	EndTime   int64  `json:"end_time,omitempty"`
	Cursor    string `json:"cursor,omitempty"`
	Limit     int32  `json:"limit,omitempty"`
}

type CustomerAcquisition added in v1.8.24

type CustomerAcquisition struct {
	LinkName   string                   `json:"link_name"`
	Range      CustomerAcquisitionRange `json:"range"`
	SkipVerify bool                     `json:"skip_verify"`
}

type CustomerAcquisitionCustomer added in v1.8.24

type CustomerAcquisitionCustomer struct {
	ExternalUserid string `json:"external_userid"`
	Userid         string `json:"userid"`
	ChatStatus     int32  `json:"chat_status"`
	State          string `json:"state"`
}

type CustomerAcquisitionCustomerList added in v1.8.24

type CustomerAcquisitionCustomerList struct {
	NextCursor   string                        `json:"next_cursor"`
	CustomerList []CustomerAcquisitionCustomer `json:"customer_list"`
}

type CustomerAcquisitionInfo added in v1.8.24

type CustomerAcquisitionInfo struct {
	Link       CustomerAcquisitionLink  `json:"link"`
	Range      CustomerAcquisitionRange `json:"range"`
	SkipVerify bool                     `json:"skip_verify"`
}
type CustomerAcquisitionLink struct {
	LinkId     string `json:"link_id"`
	LinkName   string `json:"link_name"`
	Url        string `json:"url"`
	CreateTime int64  `json:"create_time"`
}

type CustomerAcquisitionQuota added in v1.8.24

type CustomerAcquisitionQuota struct {
	ExpireDate int64 `json:"expire_date"`
	Balance    int64 `json:"balance"`
}

type CustomerAcquisitionQuotaList added in v1.8.24

type CustomerAcquisitionQuotaList struct {
	Total     int64                      `json:"total"`
	Balance   int64                      `json:"balance"`
	QuotaList []CustomerAcquisitionQuota `json:"quota_list"`
}

type CustomerAcquisitionRange added in v1.8.24

type CustomerAcquisitionRange struct {
	UserList       []string `json:"user_list"`
	DepartmentList []int64  `json:"department_list"`
}

type CustomerAcquisitionResult added in v1.8.24

type CustomerAcquisitionResult struct {
	LinkIdList []string `json:"link_id_list"`
	NextCursor string   `json:"next_cursor"`
}

type CustomerAcquisitionSearch added in v1.8.24

type CustomerAcquisitionSearch struct {
	LinkId string `json:"link_id,omitempty"`
	Limit  int32  `json:"limit"`
	Cursor string `json:"cursor,omitempty"`
}

type CustomerAcquisitionStatisticResult added in v1.8.24

type CustomerAcquisitionStatisticResult struct {
	ClickLinkCustomerCnt int32 `json:"click_link_customer_cnt"`
	NewCustomerCnt       int32 `json:"new_customer_cnt"`
}

type CustomerAcquisitionStatisticSearch added in v1.8.24

type CustomerAcquisitionStatisticSearch struct {
	LinkId    string `json:"link_id"`
	StartTime int64  `json:"start_time"`
	EndTime   int64  `json:"end_time"`
}

type CustomizedAuthUrl added in v1.8.40

type CustomizedAuthUrl struct {
	QrcodeUrl string `json:"qrcode_url"` //可用来生成二维码的授权url,需要开发者自行生成为二维码
	ExpiresIn int64  `json:"expires_in"` //有效期(秒)。10天过期。
}

type DealerCorpInfo added in v1.8.40

type DealerCorpInfo struct {
	CorpId   string `json:"corpid"`
	CorpName string `json:"corp_name"`
}

type DepMember added in v1.0.38

type DepMember struct {
	Userid           string           `json:"userid"`
	Name             string           `json:"name,omitempty"`
	Alias            string           `json:"alias,omitempty"`
	Mobile           string           `json:"mobile,omitempty"`
	Position         string           `json:"position,omitempty"`
	Gender           string           `json:"gender,omitempty"`
	Email            string           `json:"email,omitempty"`
	BizMail          string           `json:"biz_mail,omitempty"`
	AvatarMediaId    string           `json:"avatar_mediaid,omitempty"`
	OpenUserid       string           `json:"open_userid,omitempty"`
	Avatar           string           `json:"avatar,omitempty"`
	ThumbAvatar      string           `json:"thumb_avatar,omitempty"`
	Telephone        string           `json:"telephone,omitempty"`
	Address          string           `json:"address,omitempty"`
	QrCode           string           `json:"qr_code,omitempty"`
	ExternalPosition string           `json:"external_position"`
	ToInvite         bool             `json:"to_invite,omitempty"`
	Enable           int              `json:"enable"`
	Status           int              `json:"status,omitempty"`
	MainDepartment   int64            `json:"main_department"`
	Department       []int64          `json:"department,omitempty"`
	IsLeaderInDept   []int64          `json:"is_leader_in_dept,omitempty"`
	Order            []int            `json:"order,omitempty"`
	DirectLeader     []string         `json:"direct_leader,omitempty"`
	ExtAttr          *Attribute       `json:"extattr,omitempty"`
	ExternalProfile  *ExternalProfile `json:"external_profile,omitempty"`
}

type DepUser

type DepUser struct {
	OpenUserId string `json:"open_userid"`
	Department int64  `json:"department"`
}

type Department

type Department struct {
	Id       int64    `json:"id,omitempty"`       //部门id,32位整型,指定时必须大于1。若不填该参数,将自动生成id
	ParentId int64    `json:"parentid,omitempty"` //父部门id,32位整型
	Order    int      `json:"order,omitempty"`    //在父部门中的次序值。order值大的排序靠前。有效的值范围是[0, 2^32)
	Name     string   `json:"name,omitempty"`     //部门名称。同一个层级的部门名称不能重复,长度限制为1~64个UTF-8字符,字符不能包括\:*?"<>
	NameEn   string   `json:"name_en,omitempty"`  //英文名称。同一个层级的部门名称不能重复。需要在管理后台开启多语言支持才能生效。长度限制为1~64个字符,
	Leader   []string `json:"department_leader,omitempty"`
}

type DepartmentNotify added in v1.8.40

type DepartmentNotify struct {
	CtType     string `json:"XCtType" xml:"XCtType"`
	SuiteId    string `json:"SuiteId" xml:"SuiteId"`
	AuthCorpId string `json:"AuthCorpId" xml:"AuthCorpId"`
	Name       string `json:"Name" xml:"Name"`
	Id         int64  `json:"Id" xml:"Id"`
	ParentId   int64  `json:"ParentId" xml:"ParentId"`
	Order      int    `json:"Order" xml:"Order"`
}

DepartmentNotify 部门通知事件内容

type Edition added in v1.8.53

type Edition struct {
	EditionID        string `json:"edition_id"`
	EditionName      string `json:"edition_name"`
	AgentId          int32  `json:"agentid"`
	AppStatus        int    `json:"app_status"`
	UserLimit        uint32 `json:"user_limit"` //旧的多应用套件中的对应应用id,新开发者请忽略(max=4294967295)
	ExpiredTime      int64  `json:"expired_time"`
	IsVirtualVersion bool   `json:"is_virtual_version"`
}

type EditionInfo added in v1.8.53

type EditionInfo struct {
	Agent []Edition `json:"agent"`
}

type ExAttachment added in v1.8.39

type ExAttachment struct {
	MsgType     string     `json:"msgtype"`
	Image       *ExImage   `json:"image,omitempty"`
	Link        *ExLink    `json:"link,omitempty"`
	Video       *ExVideo   `json:"video,omitempty"`
	File        *ExFile    `json:"file,omitempty"`
	MiniProgram *ExProgram `json:"miniprogram,omitempty"`
}

type ExFile added in v1.0.34

type ExFile struct {
	MediaId string `json:"media_id"`
}

type ExGroupMsg added in v1.8.24

type ExGroupMsg struct {
	ExUseIds []string   `json:"external_userid"`
	Sender   string     `json:"sender"`
	Text     *ExText    `json:"text,omitempty"`
	Image    *ExImage   `json:"image,omitempty"`
	Link     *ExLink    `json:"link,omitempty"`
	Program  *ExProgram `json:"miniprogram,omitempty"`
}

type ExGroupMsgResult added in v1.8.24

type ExGroupMsgResult struct {
	FailList []string `json:"fail_list"`
	MsgId    string   `json:"msgid"`
}

type ExImage added in v1.0.34

type ExImage struct {
	MediaId string `json:"media_id"`
	PicUrl  string `json:"pic_url,omitempty"`
}
type ExLink struct {
	Title   string `json:"title"`
	Desc    string `json:"desc"`
	PicUrl  string `json:"picurl,omitempty"`
	Url     string `json:"url,omitempty"`
	MediaId string `json:"media_id,omitempty"`
}

type ExProgram

type ExProgram struct {
	Title   string `json:"title"`        //"title": "消息标题",
	MediaId string `json:"pic_media_id"` //"pic_media_id": "MEDIA_ID",
	AppId   string `json:"appid"`        //"appid": "wx8bd80126147df384",
	Page    string `json:"page"`         //"page": "/path/index"
}

type ExText added in v1.0.34

type ExText struct {
	Content string `json:"content"` //消息内容,最长不超过2048个字节,超过将截断(支持id转译)
}

type ExVideo added in v1.0.34

type ExVideo struct {
	MediaId string `json:"media_id"`
	Title   string `json:"title,omitempty"`
	Desc    string `json:"description,omitempty"`
}

type ExVoice added in v1.0.34

type ExVoice struct {
	MediaId string `json:"media_id"`
}

type ExWelcomeMsg

type ExWelcomeMsg struct {
	WelcomeCode string         `json:"welcome_code"`
	Text        ExText         `json:"text"`
	Attachments []ExAttachment `json:"attachments,omitempty"`
}

ExWelcomeMsg 客户欢迎语

func (*ExWelcomeMsg) GetType added in v1.8.88

func (h *ExWelcomeMsg) GetType() string

func (*ExWelcomeMsg) IsAgent

func (h *ExWelcomeMsg) IsAgent() bool

func (*ExWelcomeMsg) IsGroup

func (h *ExWelcomeMsg) IsGroup() bool

func (*ExWelcomeMsg) IsWelcome

func (h *ExWelcomeMsg) IsWelcome() bool

type Export added in v1.8.4

type Export struct {
	EncodingAesKey string `json:"encoding_aeskey"`
	BlockSize      int    `json:"block_size"`
}

type ExportItem added in v1.8.4

type ExportItem struct {
	Url  string      `json:"url"`
	Size interface{} `json:"size"`
	Md5  string      `json:"md5"`
}

type ExportNotify added in v1.8.4

type ExportNotify struct {
	JobId   string `json:"SuiteId" xml:"JobId"`
	JobType string `json:"AuthCorpId" xml:"JobType"` //操作类型,字符串,在异步导出的场景下分别有:export_user(导出成员详情)、 export_simple_user(导出成员)、export_department(导出部门)、export_tag(导出标签成员)
	ErrCode int32  `json:"ErrCode" xml:"ErrCode"`
	ErrMsg  string `json:"ErrMsg" xml:"ErrMsg"`
}

ExportNotify 导出任务完成通知

type ExportResult added in v1.8.4

type ExportResult struct {
	Status   int          `json:"status"`
	DataList []ExportItem `json:"data_list"`
}

type ExtAttribute added in v1.8.40

type ExtAttribute struct {
	Name string `json:"Name" xml:"Name"`
	Type int    `json:"Type" xml:"Type"`
}

type ExtToPendingId added in v1.8.36

type ExtToPendingId struct {
	ChatId         string   `json:"chat_id"`
	ExternalUserid []string `json:"external_userid"`
}

type ExtToPendingIdResult added in v1.8.36

type ExtToPendingIdResult struct {
	PendingId      string `json:"pending_id"`
	ExternalUserid string `json:"external_userid"`
}

type ExternalChatNotify added in v1.8.40

type ExternalChatNotify struct {
	CtType       string `json:"XCtType" xml:"XCtType"`
	SuiteId      string `json:"SuiteId" xml:"SuiteId"`
	AuthCorpId   string `json:"AuthCorpId" xml:"AuthCorpId"`
	ChatId       string `json:"ChatId" xml:"ChatId"`
	UpdateDetail string `json:"UpdateDetail" xml:"UpdateDetail"`
	JoinScene    string `json:"JoinScene" xml:"JoinScene"`
	QuitScene    string `json:"QuitScene" xml:"QuitScene"`
	MemChangeCnt string `json:"MemChangeCnt" xml:"MemChangeCnt"`
}

type ExternalContact

type ExternalContact struct {
	ExternalUserid  string           `json:"external_userid"`
	Name            string           `json:"name"`
	Position        string           `json:"position"`
	Avatar          string           `json:"avatar"`
	CorpName        string           `json:"corp_name"`
	CorpFullName    string           `json:"corp_full_name"`
	UnionId         string           `json:"unionid"`
	Type            int              `json:"type"`
	Gender          int              `json:"gender"`
	ExternalProfile *ExternalProfile `json:"external_profile,omitempty"`
}

type ExternalContactAddStrategyTagReq added in v1.8.36

type ExternalContactAddStrategyTagReq struct {
	ExternalContactAddTagReq
	StrategyId int `json:"strategy_id"`
}

type ExternalContactAddTagReq added in v1.8.36

type ExternalContactAddTagReq struct {
	GroupId   string                   `json:"group_id,omitempty"`
	GroupName string                   `json:"group_name,omitempty"`
	Order     int                      `json:"order,omitempty"`
	AgentId   int32                    `json:"agentid,omitempty"` //授权方安装的应用agentid。仅旧的第三方多应用套件需要填此参数
	Tag       []ExternalContactTagInfo `json:"tag"`
}

type ExternalContactDetail

type ExternalContactDetail struct {
	ExternalContact ExternalContact `json:"external_contact"`
	FollowInfo      *FollowUser     `json:"follow_info,omitempty"` //for batch
	FollowUser      []FollowUser    `json:"follow_user,omitempty"` // for detail
}

type ExternalContactEditTagReq added in v1.8.36

type ExternalContactEditTagReq struct {
	Id      string `json:"id"`
	Name    string `json:"name"`
	Order   int    `json:"order"`
	AgentId int32  `json:"agentid,omitempty"` //授权方安装的应用agentid。仅旧的第三方多应用套件需要填此参数
}

type ExternalContactMarkTagReq added in v1.8.36

type ExternalContactMarkTagReq struct {
	Userid         string   `json:"userid"`
	ExternalUserid string   `json:"external_userid"`
	AddTag         []string `json:"add_tag,omitempty"`
	RemoveTag      []string `json:"remove_tag,omitempty"`
}

type ExternalContactNotify added in v1.8.40

type ExternalContactNotify struct {
	CtType         string `json:"XCtType" xml:"XCtType"`
	SuiteId        string `json:"SuiteId" xml:"SuiteId"`               //第三方应用ID
	AuthCorpId     string `json:"AuthCorpId" xml:"AuthCorpId"`         //授权企业的CorpID
	UserID         string `json:"UserID" xml:"UserID"`                 //企业服务人员的UserID
	ExternalUserID string `json:"ExternalUserID" xml:"ExternalUserID"` //外部联系人的userid,注意不是企业成员的账号(第三方应用可以根据ExternalUserID调用“获取客户详情”读取详情。)
	State          string `json:"State" xml:"State"`                   //添加此用户的「联系我」方式配置的state参数,可用于识别添加此用户的渠道
	WelcomeCode    string `json:"WelcomeCode" xml:"WelcomeCode"`
	FailReason     string `json:"FailReason" xml:"FailReason"` //transfer_fail
}

type ExternalContactTagGroup added in v1.8.36

type ExternalContactTagGroup struct {
	GroupId    string                        `json:"group_id"`
	GroupName  string                        `json:"group_name"`
	CreateTime int64                         `json:"create_time"`
	Order      int                           `json:"order"`
	StrategyId int                           `json:"strategy_id,omitempty"`
	Deleted    bool                          `json:"deleted"`
	Tag        []ExternalContactTagGroupItem `json:"tag"`
}

type ExternalContactTagGroupItem added in v1.8.36

type ExternalContactTagGroupItem struct {
	Id         string `json:"id"`
	Name       string `json:"name"`
	CreateTime int64  `json:"create_time"`
	Order      int    `json:"order"`
	Deleted    bool   `json:"deleted"`
}

type ExternalContactTagId added in v1.8.36

type ExternalContactTagId struct {
	TagId   []string `json:"tag_id,omitempty"`
	GroupId []string `json:"group_id,omitempty"`
}

type ExternalContactTagInfo added in v1.8.36

type ExternalContactTagInfo struct {
	Name  string `json:"name"`
	Order int    `json:"order,omitempty"`
}

type ExternalGroupListReq added in v1.0.34

type ExternalGroupListReq struct {
	OwnerFilter  *OwnerFilter `json:"owner_filter,omitempty"`
	Cursor       string       `json:"cursor,omitempty"`
	Limit        int          `json:"limit"`
	StatusFilter int          `json:"status_filter"`
}

type ExternalProfile

type ExternalProfile struct {
	ExternalAttr     []Attribute    `json:"external_attr,omitempty"`
	WechatChannels   WechatChannels `json:"wechat_channels,omitempty"`
	ExternalCorpName string         `json:"external_corp_name,omitempty"`
}

type ExternalRemark

type ExternalRemark struct {
	Userid           string      `json:"userid"`
	ExternalUserid   string      `json:"external_userid"`
	Remark           string      `json:"remark"`
	Description      string      `json:"description"`
	RemarkCompany    string      `json:"remark_company"`
	RemarkPicMediaId string      `json:"remark_pic_mediaid"`
	RemarkMobiles    interface{} `json:"remark_mobiles"` //正常是一个 []string, 如果要清除所有备注手机号,请在remark_mobiles填写一个空字符串("")
}

ExternalRemark remark_company只在此外部联系人为微信用户时有效。 remark,description,remark_company,remark_mobiles和remark_pic_mediaid不可同时为空。 如果填写了remark_mobiles,将会覆盖旧的备注手机号。 如果要清除所有备注手机号,请在remark_mobiles填写一个空字符串("")。 remark_pic_mediaid可以通过素材管理接口获得。

type ExternalTagIDResult added in v1.8.36

type ExternalTagIDResult struct {
	Items []struct {
		TmpExternalUserid string `json:"external_tagid"`
		ExternalUserid    string `json:"open_external_tagid"`
	} `json:"items"`
	InvalidTagIdList []string `json:"invalid_external_tagid_list"`
}

type ExternalTagNotify added in v1.8.40

type ExternalTagNotify struct {
	CtType     string `json:"XCtType" xml:"XCtType"`
	SuiteId    string `json:"SuiteId" xml:"SuiteId"`
	AuthCorpId string `json:"AuthCorpId" xml:"AuthCorpId"`
	Id         string `json:"Id" xml:"Id"`
	TagType    string `json:"TagType" xml:"TagType"`
}

type ExternalUserIdInfo added in v1.8.4

type ExternalUserIdInfo struct {
	CorpId         string `json:"corpid"`
	ExternalUserid string `json:"external_userid"`
}

type ExternalUserIdItem

type ExternalUserIdItem struct {
	ExternalUserid    string `json:"external_userid"`
	NewExternalUserid string `json:"new_external_userid"`
}

type ExternalUserIds

type ExternalUserIds struct {
	Items []ExternalUserIdItem `json:"items"`
}

type FollowUser added in v1.0.34

type FollowUser struct {
	Userid         string          `json:"userid"` //添加了此外部联系人的企业成员userid
	Remark         string          `json:"remark"` //该成员对此外部联系人的备注
	Description    string          `json:"description"`
	RemarkCorpName string          `json:"remark_corp_name,omitempty"` //该成员对此微信客户备注的企业名称(仅微信客户有该字段)
	OperUserid     string          `json:"oper_userid"`                //发起添加的userid,如果成员主动添加,为成员的userid;如果是客户主动添加,则为客户的外部联系人userid;如果是内部成员共享/管理员分配,则为对应的成员/管理员userid
	State          string          `json:"state,omitempty"`
	Tags           []FollowUserTag `json:"tags,omitempty"`
	TagIds         []string        `json:"tag_id,omitempty"`
	RemarkMobiles  []string        `json:"remark_mobiles,omitempty"` //该成员对此客户备注的手机号码,代开发自建应用需要管理员授权才可以获取,第三方不可获取,上游企业不可获取下游企业客户该字段
	CreateTime     int64           `json:"createtime"`
	AddWay         int             `json:"add_way"` //该成员添加此客户的来源
	WechatChannels *WechatChannels `json:"wechat_channels,omitempty"`
}

type FollowUserTag added in v1.8.22

type FollowUserTag struct {
	TagId      string `json:"tag_id"`
	TagName    string `json:"tag_name"`
	GroupId    string `json:"group_id"`
	GroupName  string `json:"group_name"`
	Type       int    `json:"type"`
	Order      int    `json:"order"`       // 内部参数
	CreateTime int64  `json:"create_time"` // 内部参数
	Deleted    bool   `json:"deleted"`     // 内部参数
}

type FollowUserTagGroup added in v1.8.75

type FollowUserTagGroup struct {
	GroupId    string `json:"group_id"`
	GroupName  string `json:"group_name"`
	Order      int    `json:"order"`
	CreateTime int64  `json:"create_time"`
	Deleted    bool   `json:"deleted"`
}

type Group

type Group struct {
	Id    string   `json:"chatid"`
	Name  string   `json:"name"`
	Owner string   `json:"owner"`
	Users []string `json:"userlist"`
}

Group 群组

type GroupAdmin added in v1.0.34

type GroupAdmin struct {
	Userid string `json:"userid"`
}

type GroupChat added in v1.0.34

type GroupChat struct {
	ChatId string `json:"chat_id"`
	Status int    `json:"status"`
}

type GroupChatDayStatisticItem added in v1.8.99

type GroupChatDayStatisticItem struct {
	StatTime int64                  `json:"stat_time"`
	Data     GroupChatStatisticData `json:"data"`
}

type GroupChatDayStatisticReq added in v1.8.99

type GroupChatDayStatisticReq struct {
	DayBeginTime int64       `json:"day_begin_time"`
	DayEndTime   int64       `json:"day_end_time"`
	OwnerFilter  OwnerFilter `json:"owner_filter"` //群主ID列表。最多100个,群主过滤。 如果不填,表示获取应用可见范围内全部群主的数据(但是不建议这么用,如果可见范围人数超过1000人,为了防止数据包过大,会报错 81017)
}

type GroupChatDayStatisticResult added in v1.8.99

type GroupChatDayStatisticResult struct {
	Items []GroupChatDayStatisticItem `json:"items"`
}

type GroupChatDetail added in v1.0.34

type GroupChatDetail struct {
	ChatId     string        `json:"chat_id"`
	Name       string        `json:"name"`
	Owner      string        `json:"owner"`
	Notice     string        `json:"notice"`
	CreateTime int64         `json:"create_time"`
	MemberList []GroupMember `json:"member_list"`
	AdminList  []GroupAdmin  `json:"admin_list"`
}

type GroupChatStatisticData added in v1.8.23

type GroupChatStatisticData struct {
	NewChatCnt            int32 `json:"new_chat_cnt"`
	ChatTotal             int32 `json:"chat_total"`
	ChatHasMsg            int32 `json:"chat_has_msg"`
	NewMemberCnt          int32 `json:"new_member_cnt"`
	MemberTotal           int32 `json:"member_total"`
	MemberHasMsg          int32 `json:"member_has_msg"`
	MsgTotal              int32 `json:"msg_total"`
	MigrateTraineeChatCnt int32 `json:"migrate_trainee_chat_cnt"`
}

type GroupChatStatisticItem added in v1.8.23

type GroupChatStatisticItem struct {
	Owner string                 `json:"owner"`
	Data  GroupChatStatisticData `json:"data"`
}

type GroupChatStatisticReq added in v1.8.23

type GroupChatStatisticReq struct {
	DayBeginTime int64       `json:"day_begin_time"`
	DayEndTime   int64       `json:"day_end_time"`
	OwnerFilter  OwnerFilter `json:"owner_filter"`
	OrderBy      int32       `json:"order_by"`  //排序方式,默认为1 1 - 新增群的数量 2 - 群总数 3 - 新增群人数 4 - 群总人数
	OrderAsc     int32       `json:"order_asc"` //是否升序。0-否;1-是。默认降序
	Offset       int32       `json:"offset"`    //分页,偏移量, 默认为0
	Limit        int32       `json:"limit"`     //分页,预期请求的数据量,默认为500,取值范围 1 ~ 1000
}

type GroupChatStatisticResult added in v1.8.23

type GroupChatStatisticResult struct {
	Total      int32                    `json:"total"`
	NextOffset int32                    `json:"next_offset"` //当前分页的下一个offset。当next_offset和total相等时,说明已经取完所有
	Items      []GroupChatStatisticItem `json:"items"`
}

type GroupMember added in v1.0.34

type GroupMember struct {
	Userid        string  `json:"userid"`
	Type          int     `json:"type"`
	JoinScene     int     `json:"join_scene"`
	JoinTime      int64   `json:"join_time"`
	Invitor       Invitor `json:"invitor,omitempty"`
	GroupNickname string  `json:"group_nickname"`
	Name          string  `json:"name"`
	UnionId       string  `json:"unionid,omitempty"`
}

type GroupMsg added in v1.0.34

type GroupMsg struct {
	MsgId       string       `json:"msgid"`
	Creator     string       `json:"creator"`
	CreateTime  string       `json:"create_time"`
	CreateType  int          `json:"create_type"`
	Text        *ExText      `json:"text,omitempty"`
	Attachments []Attachment `json:"attachments"`
}

type GroupMsgReq added in v1.0.34

type GroupMsgReq struct {
	ChatType   string `json:"chat_type"` //群发任务的类型,默认为single,表示发送给客户,group表示发送给客户群
	Creator    string `json:"creator"`
	Cursor     string `json:"cursor,omitempty"`
	StartTime  int64  `json:"start_time"`
	EndTime    int64  `json:"end_time"`
	FilterType int    `json:"filter_type"`
	Limit      int    `json:"limit"`
}

type GroupMsgSearch added in v1.8.24

type GroupMsgSearch struct {
	MsgId  string `json:"msgid"`
	Userid string `json:"userid,omitempty"`
	Limit  int    `json:"limit"`
	Cursor string `json:"cursor,omitempty"`
}

type GroupMsgSendResult added in v1.8.24

type GroupMsgSendResult struct {
	ExternalUserid string `json:"external_userid"`
	ChatId         string `json:"chat_id"`
	Userid         string `json:"userid"`
	Status         int    `json:"status"`
	SendTime       int64  `json:"send_time"`
}

type GroupMsgTask added in v1.8.24

type GroupMsgTask struct {
	Userid   string `json:"userid"`
	Status   int    `json:"status"`
	SendTime int64  `json:"send_time"`
}

type GroupTransfer added in v1.8.24

type GroupTransfer struct {
	ChatIdList []string `json:"chat_id_list"`
	NewOwner   string   `json:"new_owner"`
}

type GroupTransferResult added in v1.8.24

type GroupTransferResult struct {
	ChatId  string `json:"chat_id"`
	Errcode int32  `json:"errcode"`
	Errmsg  string `json:"errmsg"`
}
type Head struct {
	ChatId                 string `json:"chatid,omitempty"`
	ToUser                 string `json:"touser,omitempty"`  //企业号中的用户帐号 指定接收消息的成员,成员ID列表(多个接收者用‘|’分隔,最多支持1000个)。 特殊情况:指定为"@all",则向该企业应用的全部成员发送
	ToParty                string `json:"toparty,omitempty"` //企业号中的部门id,群发时使用。指定接收消息的部门,部门ID列表,多个接收者用‘|’分隔,最多支持100个。 当touser为"@all"时忽略本参数
	ToTag                  string `json:"totag,omitempty"`   //企业号中的标签id,群发使用(推荐),指定接收消息的标签,标签ID列表,多个接收者用‘|’分隔,最多支持100个。 当touser为"@all"时忽略本参数
	Type                   string `json:"msgtype"`
	AgentId                int32  `json:"agentid,omitempty"`        //应用id
	Safe                   int    `json:"safe"`                     //表示是否是保密消息;0表示可对外分享,1表示不能分享且内容显示水印,默认为0
	EnableIdTrans          int    `json:"enable_id_trans"`          //表示是否开启id转译,0表示否,1表示是,默认0。仅第三方应用需要用到,企业自建应用可以忽略。
	EnableDuplicateCheck   int    `json:"enable_duplicate_check"`   //表示是否开启重复消息检查,0表示否,1表示是,默认0
	DuplicateCheckInterval int    `json:"duplicate_check_interval"` //表示是否重复消息检查的时间间隔,默认1800s,最大不超过4小时
}

{ "chatid": "", "touser": "UserID1|UserID2|UserID3", "toparty": " PartyID1 | PartyID2 ", "totag": " TagID1 | TagID2 ", "agentid": 1, "msgtype": "text", "text": { "content": "Holiday Service For Pony(http://xxxxx)" }, "safe":0 }

func (*Head) GetType added in v1.8.87

func (h *Head) GetType() string

func (*Head) IsAgent

func (h *Head) IsAgent() bool

func (*Head) IsGroup

func (h *Head) IsGroup() bool

func (*Head) IsWelcome

func (h *Head) IsWelcome() bool

type ImageMsg

type ImageMsg struct {
	Head
	Image ExImage `json:"image"`
}

ImageMsg 图片消息

type ImportReq added in v1.8.4

type ImportReq struct {
	MediaId  string `json:"media_id"`
	ToInvite bool   `json:"to_invite"`
	Callback struct {
		Url            string `json:"url"`
		Token          string `json:"token"`
		EncodingAesKey string `json:"encodingaeskey"`
	} `json:"callback"`
}

type ImportResult added in v1.8.4

type ImportResult struct {
	Status     int           `json:"status"`
	Type       string        `json:"type"`
	Total      int           `json:"total"`
	Percentage int           `json:"percentage"`
	Result     []interface{} `json:"result"`
}

type Invitor added in v1.0.34

type Invitor struct {
	Userid string `json:"userid"`
}

type KFIDResult added in v1.8.36

type KFIDResult struct {
	Items []struct {
		TmpExternalUserid string `json:"open_kfid"`
		ExternalUserid    string `json:"new_open_kfid"`
	} `json:"items"`
	InvalidKfIdList []string `json:"invalid_open_kfid_list"`
}

type LoginAgent added in v1.8.40

type LoginAgent struct {
	AgentId  int32 `json:"agentid"`
	AuthType int   `json:"auth_type"`
}

type LoginAuthInfo added in v1.8.40

type LoginAuthInfo struct {
	Department []LoginDepartment `json:"department"`
}

type LoginDepartment added in v1.8.40

type LoginDepartment struct {
	Id       int64 `json:"id"`
	Writable bool  `json:"writable"`
}

type LoginInfo added in v1.8.40

type LoginInfo struct {
	Usertype int           `json:"usertype"`
	UserInfo AuthUserInfo  `json:"user_info"`
	CorpInfo AuthCorpInfo  `json:"corp_info"`
	Agent    []LoginAgent  `json:"agent"`
	AuthInfo LoginAuthInfo `json:"auth_info"`
}

type MarkdownMsg

type MarkdownMsg struct {
	Head
	Markdown ExText `json:"markdown"`
}

type MemberAuthResult added in v1.8.4

type MemberAuthResult struct {
	NextCursor     string `json:"next_cursor"`
	MemberAuthList []struct {
		OpenUserid string `json:"open_userid"`
	} `json:"member_auth_list"`
}

type Message

type Message interface {
	IsGroup() bool
	IsAgent() bool
	IsWelcome() bool
	GetType() string
}

type MessageResponse added in v1.8.76

type MessageResponse struct {
	ErrCode        int32  `json:"errcode"`
	ErrMsg         string `json:"errmsg"`
	InvalidUser    string `json:"invaliduser"`
	InvalidParty   string `json:"invalidparty"`
	InvalidTag     string `json:"invalidtag"`
	UnlicensedUser string `json:"unlicenseduser"`
	MsgId          string `json:"msgid"`
	ResponseCode   string `json:"response_code"`
}

type MomentInfo added in v1.8.4

type MomentInfo struct {
	MomentId    string `json:"moment_id"`
	Creator     string `json:"creator"`
	CreateTime  int64  `json:"create_time"`
	CreateType  int    `json:"create_type"`
	VisibleType int    `json:"visible_type"`
	Text        struct {
		Content string `json:"content"`
	} `json:"text"`
	Image []struct {
		MediaId string `json:"media_id"`
	} `json:"image"`
	Video struct {
		MediaId      string `json:"media_id"`
		ThumbMediaId string `json:"thumb_media_id"`
	} `json:"video"`
	Link struct {
		Title string `json:"title"`
		Url   string `json:"url"`
	} `json:"link"`
	Location struct {
		Latitude  string `json:"latitude"`
		Longitude string `json:"longitude"`
		Name      string `json:"name"`
	} `json:"location"`
}

type MomentListReq added in v1.8.4

type MomentListReq struct {
	StartTime  int64  `json:"start_time"`
	EndTime    int64  `json:"end_time"`
	Creator    string `json:"creator"`
	FilterType int    `json:"filter_type"`
	Cursor     string `json:"cursor,omitempty"`
	Limit      int32  `json:"limit"`
}

type MomentListResp added in v1.8.4

type MomentListResp struct {
	NextCursor string       `json:"next_cursor"`
	MomentList []MomentInfo `json:"moment_list"`
}

type MomentTaskResult added in v1.8.4

type MomentTaskResult struct {
	Status int    `json:"status"`
	Type   string `json:"type"`
	Result struct {
		ErrCode           int32  `json:"errcode"`
		ErrMsg            string `json:"errmsg"`
		MomentId          string `json:"moment_id"`
		InvalidSenderList struct {
			UserList       []string `json:"user_list"`
			DepartmentList []int32  `json:"department_list"`
		} `json:"invalid_sender_list"`
		InvalidExternalContactList struct {
			TagList []string `json:"tag_list"`
		} `json:"invalid_external_contact_list"`
	} `json:"result"`
}

type NewExternalUserid added in v1.0.49

type NewExternalUserid struct {
	ExternalUserid    string `json:"external_userid"`
	NewExternalUserid string `json:"new_external_userid"`
}

type News

type News struct {
	Articles []Articles `json:"articles"`
}

News "news" : { "articles" : [ { "title" : "中秋节礼品领取", "description" : "今年中秋节公司有豪礼相送", "url" : "URL", "picurl" : "http://res.mail.qq.com/node/ww/wwopenmng/images/independent/doc/test_pic_msg1.png" }

type NewsMsg

type NewsMsg struct {
	Head
	News News `json:"news"`
}

NewsMsg 图文消息

type OpenUserId

type OpenUserId struct {
	OpenUseridList    []UserIdPair `json:"open_userid_list"`
	InvalidUseridList []string     `json:"invalid_userid_list"`
}

type OrderRefundNotify added in v1.8.40

type OrderRefundNotify struct {
	AuthCorpId    string `json:"AuthCorpId" xml:"AuthCorpId"`
	ServiceCorpId string `json:"ServiceCorpId" xml:"ServiceCorpId"`
	OrderId       string `json:"OrderId" xml:"OrderId"`
	OrderStatus   int    `json:"OrderStatus" xml:"OrderStatus"`
}

OrderRefundNotify 退款结果通知 InfoType = license_refund

type OrderSuccessNotify added in v1.8.40

type OrderSuccessNotify struct {
	AuthCorpId    string `json:"AuthCorpId" xml:"AuthCorpId"`
	ServiceCorpId string `json:"ServiceCorpId" xml:"ServiceCorpId"`
	OrderId       string `json:"OrderId" xml:"OrderId"`
	BuyerUserId   string `json:"BuyerUserId" xml:"BuyerUserId"`
}

OrderSuccessNotify 订单支付成功 InfoType = license_pay_success

type OwnerFilter added in v1.0.34

type OwnerFilter struct {
	UseridList []string `json:"userid_list,omitempty"`
}

type Permanent added in v1.8.40

type Permanent struct {
	access.PermanentAccessToken
	PermanentInfo
}

type PermanentInfo added in v1.8.40

type PermanentInfo struct {
	PermanentCode    string           `json:"permanent_code"`
	DealerCorpInfo   DealerCorpInfo   `json:"dealer_corp_info"`
	AuthCorpInfo     AuthCorpInfo     `json:"auth_corp_info"`
	AuthInfo         AuthInfo         `json:"auth_info"`
	AuthUserInfo     AuthUserInfo     `json:"auth_user_info"`
	RegisterCodeInfo RegisterCodeInfo `json:"register_code_info"`
	EditionInfo      EditionInfo      `json:"edition_info"`
	State            string           `json:"state"`
}

func (PermanentInfo) Agent added in v1.8.40

func (p PermanentInfo) Agent() Agent

func (PermanentInfo) AgentId added in v1.8.40

func (p PermanentInfo) AgentId() string

func (PermanentInfo) AgentName added in v1.8.40

func (p PermanentInfo) AgentName() string

func (PermanentInfo) IsCustomizedApp added in v1.8.40

func (p PermanentInfo) IsCustomizedApp() bool

IsCustomizedApp 是否为代开发自建应用,另外接口不返回access_token字段 授权的应用信息,注意是一个数组,但仅旧的多应用套件授权时会返回多个agent,对新的单应用授权,永远只返回一个agent

type PreAuthCode added in v1.8.40

type PreAuthCode struct {
	Code      string `json:"pre_auth_code"`
	ExpiresIn int64  `json:"expires_in"`
}

type Privilege added in v1.8.40

type Privilege struct {
	Level      int      `json:"level"`
	AllowParty []int64  `json:"allow_party"`
	AllowUser  []string `json:"allow_user"`
	AllowTag   []int64  `json:"allow_tag"`
	ExtraParty []int64  `json:"extra_party"`
	ExtraUser  []string `json:"extra_user"`
	ExtraTag   []int64  `json:"extra_tag"`
}

Privilege Level 1:通讯录基本信息只读 3:通讯录全部信息读写 4:单个基本信息只读

type QRCodeReq added in v1.8.40

type QRCodeReq struct {
	SuiteId    string `json:"suite_id"` //第三方应用id
	State      string `json:"state"`    //state值,用于区分不同的安装渠道,可以填写a-zA-Z0-9,长度不可超过32个字节,默认为空。扫应用带参二维码授权安装后,获取企业永久授权码接口会返回该state值
	Appid      int64  `json:"appid,omitempty"`
	Style      int    `json:"style"`       //二维码样式选项,默认为不带说明外框小尺寸。0:带说明外框的二维码,适合于实体物料,1:带说明外框的二维码,适合于屏幕类,2:不带说明外框(小尺寸),3:不带说明外框(中尺寸),4:不带说明外框(大尺寸)。具体样式与服务商管理端获取到的应用二维码样式一一对应,参见下文二维码样式说明
	ResultType int    `json:"result_type"` //结果返回方式,默认为返回二维码图片buffer。1:二维码图片buffer,2:二维码图片url
}

type RegisterCodeInfo added in v1.8.40

type RegisterCodeInfo struct {
	RegisterCode string `json:"register_code"`
	TemplateId   string `json:"template_id"`
	State        string `json:"state"`
}

type RoomInfo added in v1.0.54

type RoomInfo struct {
	Name       string       `json:"roomname"`
	Creator    string       `json:"creator"`
	Notice     string       `json:"notice"`
	CreateTime int64        `json:"room_create_time"`
	Members    []RoomMember `json:"members"`
}

type RoomMember added in v1.0.54

type RoomMember struct {
	MemberId string `json:"memberid"`
	JoinTime int64  `json:"jointime"`
}

type Rule added in v1.8.68

type Rule struct {
	RuleId          string          `json:"rule_id,omitempty"`
	RuleName        string          `json:"rule_name"`
	WordList        []string        `json:"word_list"`
	SemanticsList   []int32         `json:"semantics_list"`   //额外的拦截语义规则,1:手机号、2:邮箱地:、3:红包
	InterceptType   int32           `json:"intercept_type"`   //拦截方式,1:警告并拦截发送;2:仅发警告
	ApplicableRange ApplicableRange `json:"applicable_range"` //敏感词适用范围,userid与department不能同时为不填
}

type RuleChange added in v1.8.68

type RuleChange struct {
	RuleId                string          `json:"rule_id"`
	RuleName              string          `json:"rule_name"`
	WordList              []string        `json:"word_list"` //敏感词列表,敏感词长度1~32个utf8字符,列表大小不能超过300个;若为空忽略该字段
	ExtraRule             RuleExtra       `json:"extra_rule"`
	InterceptType         int32           `json:"intercept_type"`
	AddApplicableRange    ApplicableRange `json:"add_applicable_range"`
	RemoveApplicableRange ApplicableRange `json:"remove_applicable_range"`
}

type RuleExtra added in v1.8.78

type RuleExtra struct {
	SemanticsList []int32 `json:"semantics_list"`
}

type RuleInfo added in v1.8.68

type RuleInfo struct {
	RuleId     string `json:"rule_id"`
	RuleName   string `json:"rule_name"`
	CreateTime int64  `json:"create_time"`
}

type SelectedTicketResult added in v1.8.4

type SelectedTicketResult struct {
	OperatorOpenUserid   string   `json:"operator_open_userid"`
	OpenUseridList       []string `json:"open_userid_list"`
	UnAuthOpenUseridList []string `json:"unauth_open_userid_list"`
	Total                int32    `json:"total"`
}

type SessionInfo added in v1.8.40

type SessionInfo struct {
	AuthType int `json:"auth_type"`
}

type SharedFrom added in v1.8.40

type SharedFrom struct {
	CorpId    string `json:"corpid"`
	ShareType int    `json:"share_type"`
}

type SimpleUser added in v1.0.38

type SimpleUser struct {
	Userid     string  `json:"userid"`      //成员UserID
	Name       string  `json:"name"`        //成员名称,代开发自建应用需要管理员授权才返回;此字段从2019年12月30日起,对新创建第三方应用不再返回真实name,使用userid代替name,2020年6月30日起,对所有历史第三方应用不再返回真实name,使用userid代替name,后续第三方仅通讯录应用可获取,未返回名称的情况需要通过通讯录展示组件来展示名字
	OpenUserid string  `json:"open_userid"` //全局唯一。对于同一个服务商,不同应用获取到企业内同一个成员的open_userid是相同的,最多64个字节。仅第三方应用可获取
	Department []int64 `json:"department"`  //成员所属部门列表。列表项为部门ID,32位整型
}

type SingleAgree added in v1.0.54

type SingleAgree struct {
	Userid         string `json:"userid"`
	ExternalOpenId string `json:"externalopenid"`
}

type SuiteTicketNotify added in v1.8.40

type SuiteTicketNotify struct {
	SuiteId     string `json:"SuiteId" xml:"SuiteId"`
	AuthCorpId  string `json:"AuthCorpId" xml:"AuthCorpId"`
	SuiteTicket string `json:"SuiteTicketNotify" xml:"SuiteTicketNotify"`
}

SuiteTicketNotify 推送suite_ticket

type Tag added in v1.0.34

type Tag struct {
	TagId   int64  `json:"tagid,omitempty"`
	TagName string `json:"tagname,omitempty"`
}

type TextCard

type TextCard struct {
	Title  string `json:"title"`
	Desc   string `json:"description"`
	Url    string `json:"url"`
	BtnTxt string `json:"btntxt"`
}

TextCard "textcard" : { "title" : "领奖通知", "description" : "<div class=\"gray\">2016年9月26日</div> <div class=\"normal\">恭喜你抽中iPhone 7一台,领奖码:xxxx</div><div class=\"highlight\">请于2016年10月10日前联系行政同事领取</div>", "url" : "URL", "btntxt":"更多" }

type TextCardMsg

type TextCardMsg struct {
	Head
	TextCard TextCard `json:"textcard"`
}

TextCardMsg 文本卡片消息

type TextMsg

type TextMsg struct {
	Head
	Text ExText `json:"text"`
}

TextMsg 文本消息

type Ticket added in v1.8.56

type Ticket struct {
	Ticket   string `json:"ticket"`
	ExpireIn int64  `json:"expires_in"`
}

type TmpExternalUser added in v1.8.36

type TmpExternalUser struct {
	BusinessType          int      `json:"business_type"`
	UserType              int      `json:"user_type"`
	TmpExternalUseridList []string `json:"tmp_external_userid_list"`
}

type TmpExternalUserResult added in v1.8.36

type TmpExternalUserResult struct {
	Results []struct {
		TmpExternalUserid string `json:"tmp_external_userid"`
		ExternalUserid    string `json:"external_userid,omitempty"`
		CorpId            string `json:"corpid,omitempty"`
		UserId            string `json:"userid,omitempty"`
	} `json:"results"`
	InvalidTmpExternalUseridList []string `json:"invalid_tmp_external_userid_list"`
}

TmpExternalUserResult results[].tmp_external_userid string 输入的tmp_external_userid results[].external_userid string 转换后的userid,user_type为1时返回 results[].corpid string userid对应的corpid,user_type为2、3、4时返回 results[].userid string 转换后的userid,user_type为2、3、4时返回 invalid_tmp_external_userid_list string[] 无法转换的tmp_external_userid。可能非法或没有权限

type ToAgent

type ToAgent struct {
	AgentId int32  `json:"agentid,omitempty"` //应用id
	ToUser  string `json:"touser,omitempty"`  //企业号中的用户帐号
	ToTag   string `json:"totag,omitempty"`   //企业号中的标签id,群发使用(推荐)
	ToParty string `json:"toparty,omitempty"` //企业号中的部门id,群发时使用。
}

func (*ToAgent) IsAgent

func (to *ToAgent) IsAgent() (bool, *ToAgent)

func (*ToAgent) IsGroup

func (to *ToAgent) IsGroup() (bool, *ToGroup)

func (*ToAgent) IsRoot

func (to *ToAgent) IsRoot() (bool, *ToRoot)

type ToGroup

type ToGroup struct {
	ChatId string `json:"chatid,omitempty"`
}

func (*ToGroup) IsAgent

func (to *ToGroup) IsAgent() (bool, *ToAgent)

func (*ToGroup) IsGroup

func (to *ToGroup) IsGroup() (bool, *ToGroup)

type ToRoot

type ToRoot struct {
}

func (*ToRoot) IsAgent

func (to *ToRoot) IsAgent() (bool, *ToAgent)

func (*ToRoot) IsGroup

func (to *ToRoot) IsGroup() (bool, *ToGroup)

func (*ToRoot) IsRoot

func (to *ToRoot) IsRoot() (bool, *ToRoot)

type ToWho

type ToWho interface {
	IsGroup() (bool, *ToGroup)
	IsAgent() (bool, *ToAgent)
}

type TransferReq added in v1.8.83

type TransferReq struct {
	HandoverUserid     string   `json:"handover_userid"`                //原跟进成员的userid
	TakeoverUserid     string   `json:"takeover_userid"`                //接替成员的userid
	ExternalUserid     []string `json:"external_userid"`                //客户的external_userid列表,每次最多分配100个客户
	TransferSuccessMsg string   `json:"transfer_success_msg,omitempty"` //转移成功后发给客户的消息,最多200个字符
}

type TransferResult added in v1.8.83

type TransferResult struct {
	ExternalUserid string `json:"external_userid"` //客户的external_userid
	Errcode        int32  `json:"errcode"`         //对此客户进行分配的结果,0表示成功发起接替,待24小时后自动接替,并不代表最终接替成功
}

type TransferResultReq added in v1.8.86

type TransferResultReq struct {
	HandoverUserid string `json:"handover_userid"`
	TakeoverUserid string `json:"takeover_userid"`
	Cursor         string `json:"cursor,omitempty"`
}

type TransferResultResp added in v1.8.86

type TransferResultResp struct {
	ExternalUserid string `json:"external_userid"`
	Status         int    `json:"status"`
	TakeoverTime   int64  `json:"takeover_time"`
}

type UnAssignedInfo added in v1.8.68

type UnAssignedInfo struct {
	HandoverUserid string `json:"handover_userid"` //离职成员的userid
	ExternalUserid string `json:"external_userid"` //外部联系人userid
	DimissionTime  int64  `json:"dimission_time"`  //成员离职时间
}

type UnAssignedList added in v1.8.68

type UnAssignedList struct {
	Info       []UnAssignedInfo `json:"info"`
	IsLast     bool             `json:"is_last"`
	NextCursor string           `json:"next_cursor"`
}

type UnLicensedNotify added in v1.8.51

type UnLicensedNotify struct {
	AuthCorpId string //企业微信CorpID
	UserId     string //成员UserID
	AgentID    int    //企业应用的id
}

type UnionIdTo added in v1.8.36

type UnionIdTo struct {
	UnionId        string `json:"unionid"`
	OpenId         string `json:"openid"`
	SubjectType    int    `json:"subject_type"`
	MassCallTicket string `json:"mass_call_ticket,omitempty"` //高频
}

type UnionIdToResult added in v1.8.36

type UnionIdToResult struct {
	ExternalUserId string `json:"external_userid"`
	PendingId      string `json:"pending_id"`
}

type UpdateContactWay added in v1.8.31

type UpdateContactWay struct {
	ConfigId      string      `json:"config_id"`
	Remark        string      `json:"remark"`
	SkipVerify    bool        `json:"skip_verify"`
	Style         int         `json:"style"`
	State         string      `json:"state"`
	User          []string    `json:"user"`
	Party         []int       `json:"party"`
	ExpiresIn     int64       `json:"expires_in"`
	ChatExpiresIn int64       `json:"chat_expires_in"`
	UnionId       string      `json:"unionid"`
	Conclusions   Conclusions `json:"conclusions"`
}

type User added in v1.8.36

type User struct {
	Userid string `json:"userid"`
	Name   string `json:"name"`
}

type UserBehaviorDataReq added in v1.8.23

type UserBehaviorDataReq struct {
	UserId    []string `json:"userid"`  //成员ID列表,最多100个
	PartyId   []int32  `json:"partyid"` //部门ID列表,最多100个
	StartTime int64    `json:"start_time"`
	EndTime   int64    `json:"end_time"`
}

UserBehaviorDataReq 获取「联系客户统计」数据

type UserDetail3rd added in v1.8.40

type UserDetail3rd struct {
	CorpId string `json:"corpid"`
	Userid string `json:"userid"`
	Name   string `json:"name"`
	Gender string `json:"gender"`
	Avatar string `json:"avatar"`
	QrCode string `json:"qr_code"`
}

type UserIdPair added in v1.8.63

type UserIdPair struct {
	Userid     string `json:"userid"`
	OpenUserid string `json:"open_userid"`
}

type UserIdReq

type UserIdReq struct {
	UseridList []string `json:"userid_list"`
}

type UserIdResult added in v1.8.63

type UserIdResult struct {
	UseridList        []UserIdPair `json:"userid_list"`
	InvalidUseridList []string     `json:"invalid_open_userid_list"`
}

type UserInfo

type UserInfo struct {
	Userid  string `json:"userid"`
	Name    string `json:"name"`
	Gender  string `json:"gender"`
	Avatar  string `json:"avatar"`
	QrCode  string `json:"qr_code"`
	Mobile  string `json:"mobile"`
	Email   string `json:"email"`
	BizMail string `json:"biz_mail"`
	Address string `json:"address"`
}

type UserInfo3rd added in v1.8.40

type UserInfo3rd struct {
	CorpId     string `json:"corpid"`
	Userid     string `json:"userid"`
	UserTicket string `json:"user_ticket"`
	ExpiresIn  int64  `json:"expires_in"`
	OpenUserid string `json:"open_userid"`
}

type UserInfoWithCode

type UserInfoWithCode struct {
	Userid string `json:"userid"`
	OpenId string `json:"openid"`
}

type UserTag added in v1.8.36

type UserTag struct {
	Tag
	UserList  []User `json:"userlist,omitempty"`
	PartyList []int  `json:"partylist,omitempty"`
}

type VideoMsg

type VideoMsg struct {
	Head
	Video ExVideo `json:"video"`
}

VideoMsg 视频消息

type VisibleRange added in v1.8.4

type VisibleRange struct {
	SenderList struct {
		UserList       []string `json:"user_list"`
		DepartmentList []int32  `json:"department_list"`
	} `json:"sender_list"`
	ExternalContactList struct {
		TagList []string `json:"tag_list"`
	} `json:"external_contact_list"`
}

type VoiceMsg

type VoiceMsg struct {
	Head
	Voice ExVoice `json:"voice"`
}

VoiceMsg 语音消息

type WayItem added in v1.8.35

type WayItem struct {
	ConfigId string `json:"config_id"`
}

type WechatChannels

type WechatChannels struct {
	Nickname string `json:"nickname"`
	Source   int    `json:"source,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL