dingtalk

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ROOTURL = "https://oapi.dingtalk.com"

ROOTURL 钉钉开放平台根RUL

Variables

View Source
var (

	// GetUserInfoBycode GetUserInfoBycode
	GetUserInfoBycode = ROOTURL + "/sns/getuserinfo_bycode"
	// GetUserInfo 通过免登授权码和access_token获取用户的userid。
	GetUserInfo = ROOTURL + "/user/getuserinfo"
	// GetToken GetToken
	GetToken = ROOTURL + "/gettoken"
	// SSOGetToken SSOGetToken
	SSOGetToken = ROOTURL + "/sso/gettoken"
	// SSOGetUserInfo SSOGetUserInfo
	SSOGetUserInfo = ROOTURL + "/sso/getuserinfo"

	// UserCreate UserCreate
	UserCreate = ROOTURL + "/user/create"
	// UserUpdate UserUpdate
	UserUpdate = ROOTURL + "/user/update"
	// UserDelete UserDelete
	UserDelete = ROOTURL + "/user/delete"
	// UserGet UserGet
	UserGet = ROOTURL + "/user/get"
	// UserGetDeptMember UserGetDeptMember
	UserGetDeptMember = ROOTURL + "/user/getDeptMember"
	// UserSimpleList UserSimpleList
	UserSimpleList = ROOTURL + "/user/simplelist"
	// UserListByPage UserListByPage
	UserListByPage = ROOTURL + "/user/listbypage"
	// UserGetAdmin UserGetAdmin
	UserGetAdmin = ROOTURL + "/user/get_admin"
	// UserGetAdminScope UserGetAdminScope
	UserGetAdminScope = ROOTURL + "/topapi/user/get_admin_scope"
	// UserGetUseridByUnionid UserGetUseridByUnionid
	UserGetUseridByUnionid = ROOTURL + "/user/getUseridByUnionid"
	// UserGetByMobile UserGetByMobile
	UserGetByMobile = ROOTURL + "/user/get_by_mobile"
	// UserGetOrgUserCount UserGetOrgUserCount
	UserGetOrgUserCount = ROOTURL + "/user/get_org_user_count"
	// UserGetInactive UserGetInactive
	UserGetInactive = ROOTURL + "/topapi/inactive/user/get"

	// DepartmentCreate 通讯录管理-部门管理
	DepartmentCreate = ROOTURL + "/department/create"
	// DepartmentUpdate DepartmentUpdate
	DepartmentUpdate = ROOTURL + "/department/update"
	// DepartmentDelete DepartmentDelete
	DepartmentDelete = ROOTURL + "/department/delete"
	// DepartmentListIds DepartmentListIds
	DepartmentListIds = ROOTURL + "/department/list_ids"
	// DepartmentList DepartmentList
	DepartmentList = ROOTURL + "/department/list"
	// DepartmentGet DepartmentGet
	DepartmentGet = ROOTURL + "/department/get"
	// DepartmentListParent DepartmentListParent
	DepartmentListParent = ROOTURL + "/department/list_parent_depts_by_dept"
	// DepartmentListParentDepts DepartmentListParentDepts
	DepartmentListParentDepts = ROOTURL + "/department/list_parent_depts"

	// WorkrecordAdd 新增待办事项
	WorkrecordAdd = ROOTURL + "/topapi/workrecord/add"
	// WorkrecordGetbyuserid  获取用户的待办事项
	WorkrecordGetbyuserid = ROOTURL + "/topapi/workrecord/getbyuserid"
	// WorkrecordUpdate 更新待办事项状态
	WorkrecordUpdate = ROOTURL + "/topapi/workrecord/update"

	// MessageCorpconversationAsyncsendV2 企业会话消息异步发送接口
	MessageCorpconversationAsyncsendV2 = ROOTURL + "/topapi/message/corpconversation/asyncsend_v2"
	// MessageCorpconversationGetsendprogress 获取异步发送企业会话消息的发送进度
	MessageCorpconversationGetsendprogress = ROOTURL + "/topapi/message/corpconversation/getsendprogress"
	// MessageCorpconversationGetsendresult 获取异步向企业会话发送消息的结果
	MessageCorpconversationGetsendresult = ROOTURL + "/topapi/message/corpconversation/getsendresult"
	// MessageCorpconversationRecall 撤回工作通知消息
	MessageCorpconversationRecall = ROOTURL + "/topapi/message/corpconversation/recall"

	// ChatCreate 创建会话
	ChatCreate = ROOTURL + "/topapi/chat/create"
	// ChatGet 获取会话
	ChatGet = ROOTURL + "/topapi/chat/get"
	// ChatMemberFriendswitchUpdate 更新群成员之间的添加朋友开关
	ChatMemberFriendswitchUpdate = ROOTURL + "/topapi/chat/member/friendswitch/update"
	// ChatSend 发送群消息
	ChatSend = ROOTURL + "/topapi/chat/send"
	// ChatSubadminUpdate 增加删除群管理员
	ChatSubadminUpdate = ROOTURL + "/topapi/chat/subadmin/update"
	// ChatUpdate 修改会话
	ChatUpdate = ROOTURL + "/topapi/chat/update"

	// MessageSendToConversation 发送普通消息
	MessageSendToConversation = ROOTURL + "/topapi/message/send_to_conversation"
)

Functions

This section is empty.

Types

type ActionCardA

type ActionCardA struct {
	Msgtype    string `json:"msgtype"`
	ActionCard struct {
		Title       string `json:"title"`
		Markdown    string `json:"markdown"`
		SingleTitle string `json:"single_title"`
		SingleURL   string `json:"single_url"`
	} `json:"action_card"`
}

ActionCardA 卡片消息 卡片消息支持整体跳转ActionCard样式和独立跳转ActionCard样式: (1)整体跳转ActionCardA样式,支持一个点击Action,需要传入参数 single_title和 single_url; (2)独立跳转ActionCardB样式,支持多个点击Action,需要传入参数 btn_orientation 和 btn_json_list;

type ActionCardB

type ActionCardB struct {
	Msgtype    string `json:"msgtype"`
	ActionCard struct {
		Title          string `json:"title"`
		Markdown       string `json:"markdown"`
		BtnOrientation string `json:"btn_orientation"`
		BtnJSONList    []struct {
			Title     string `json:"title"`
			ActionURL string `json:"action_url"`
		} `json:"btn_json_list"`
	} `json:"action_card"`
}

ActionCardB 卡片消息 卡片消息支持整体跳转ActionCard样式和独立跳转ActionCard样式: (1)整体跳转ActionCardA样式,支持一个点击Action,需要传入参数 single_title和 single_url; (2)独立跳转ActionCardB样式,支持多个点击Action,需要传入参数 btn_orientation 和 btn_json_list;

type AddTodo

type AddTodo struct {
	BizID      string `json:"biz_id"`
	CreateTime int64  `json:"create_time"`
	// PcURL pc端跳转url,不传则使用url参数
	PcURL        string `json:"pcUrl"`
	PcOpenType   int    `json:"pc_open_type"`
	FormItemList struct {
		Title   string `json:"title"`
		Content string `json:"content"`
	} `json:"formItemList"`
	Title string `json:"title"`
	// Userid 待办事项对应的用户id
	Userid string `json:"userid"`
	// URL 待办事项的跳转链接。当链接是某个微应用链接时,希望在PC端工作台打开,可通过该方式实现。
	URL              string `json:"url"`
	OriginatorUserID string `json:"originator_user_id"`
	SourceName       string `json:"source_name"`
}

AddTodo 待办任务-发起待办 https://ding-doc.dingtalk.com/doc#/serverapi2/gpmpiq

type AddTodoRsp

type AddTodoRsp struct {
	// Errcode 返回码
	Errcode int `json:"errcode"`
	// Errmsg 对返回码的文本描述内容
	Errmsg string `json:"errmsg"`
	// RecordID 待办事项唯一id,更新待办事项的时候需要用到
	RecordID string `json:"record_id"`
}

AddTodoRsp 待办任务-新增待办事项 返回结果 https://ding-doc.dingtalk.com/doc#/serverapi2/gpmpiq

type AuthClient

type AuthClient struct {
	AppID     string
	AppSecret string
}

AuthClient AuthClient

type Client

type Client struct {
	AppKey    string // 企业内部应用appKey
	AppSecret string // 企业内部应用appSecret
	Debug     bool

	Cache cache.Cache
	Tlock *sync.RWMutex
}

Client Client

func NewClient

func NewClient(appkey, appsecret string) *Client

NewClient NewClient

func (*Client) AddWorkrecord

func (c *Client) AddWorkrecord(info AddTodo) (*AddTodoRsp, error)

AddWorkrecord 发起代办

func (*Client) DepartmentCreate

func (c *Client) DepartmentCreate(department *CreateDepartment) (*DepartmentCreateRsp, error)

DepartmentCreate 创建部门

func (*Client) DepartmentDelete

func (c *Client) DepartmentDelete(departmentid int) (*DepartmentCreateRsp, error)

DepartmentDelete 删除部门

func (*Client) DepartmentGet

func (c *Client) DepartmentGet(departmentid int) (*DepartmentGetRsp, error)

DepartmentGet 获取部门详情

func (*Client) DepartmentList

func (c *Client) DepartmentList(departmentid int) (*DepartmentListRsp, error)

DepartmentList 获取部门列表

func (*Client) DepartmentListIds

func (c *Client) DepartmentListIds(departmentid int) (*DepartmentListIdsRsp, error)

DepartmentListIds 获取子部门ID列表

func (*Client) DepartmentListParent

func (c *Client) DepartmentListParent(departmentid int) (*DepartmentListParentRsp, error)

DepartmentListParent 查询部门的所有上级父部门路径

func (*Client) DepartmentUpdate

func (c *Client) DepartmentUpdate(department *UpdateDepartment) (*DepartmentCreateRsp, error)

DepartmentUpdate 更新部门

func (*Client) EditWorkrecord

func (c *Client) EditWorkrecord(info EditTodo) (*EditTodoRsp, error)

EditWorkrecord 更新代办

func (*Client) GetAccessToken

func (c *Client) GetAccessToken() (accessToken string, err error)

GetAccessToken 获取access_token

func (*Client) GetAccessTokenFromServer

func (c *Client) GetAccessTokenFromServer() (resAccessToken ResAccessToken, err error)

GetAccessTokenFromServer 强制从服务器获取token

func (*Client) GetSsoAccessToken

func (c *Client) GetSsoAccessToken(code string) (*SsoAccessToken, error)

GetSsoAccessToken 应用管理后台免登获取AccessToken

func (*Client) GetUserInfoByCode

func (c *Client) GetUserInfoByCode(code, appID, appSecret string) (u *UserinfoBycode, err error)

GetUserInfoByCode 扫描登陆第三方、钉钉内部登录第三方、密码登录第三方

func (*Client) GetUserInfoByIn

func (c *Client) GetUserInfoByIn(code string) (u *UserinfoByInternal, err error)

GetUserInfoByIn 企业内部应用免登 @code 免登授权码,参考上述“获取免登授权码”

func (*Client) GetUserInfoBySso

func (c *Client) GetUserInfoBySso(code, ssoAccessToken string) (*UserinfoBySso, error)

GetUserInfoBySso 应用管理后台免登

func (*Client) GetWorkrecordByUserID

func (c *Client) GetWorkrecordByUserID(info UserTodoList) (*UserTodoListRsp, error)

GetWorkrecordByUserID 获取用户的待办事项

func (*Client) SetCache

func (c *Client) SetCache(key string, cfg interface{})

SetCache SetCache

func (*Client) SetDebug

func (c *Client) SetDebug(b bool)

SetDebug SetDebug

func (*Client) UserCreate

func (c *Client) UserCreate(user *CreateUser) (*CreateUserRsp, error)

UserCreate 创建用户

func (*Client) UserDelete

func (c *Client) UserDelete(userid string) (*CreateUserRsp, error)

UserDelete 删除用户

func (*Client) UserGet

func (c *Client) UserGet(userid string) (*UsertGetRsp, error)

UserGet 获取用户详情

func (*Client) UserGetAdmin

func (c *Client) UserGetAdmin() (*UserGetAdminRsp, error)

UserGetAdmin 获取管理员列表

func (*Client) UserGetAdminScope

func (c *Client) UserGetAdminScope() (*UserGetAdminScopeRsp, error)

UserGetAdminScope 获取管理员通讯录权限范围

func (*Client) UserGetByMobile

func (c *Client) UserGetByMobile(mobile string) (*UserGetByMobileRsp, error)

UserGetByMobile 根据手机号获取userid

func (*Client) UserGetDeptMember

func (c *Client) UserGetDeptMember(userid string) (*UserGetDeptMemberRsp, error)

UserGetDeptMember 获取部门用户userid列表

func (*Client) UserGetInactive

func (c *Client) UserGetInactive() (*UserGetInactiveRsp, error)

UserGetInactive 未登录钉钉的员工列表

func (*Client) UserGetOrgUserCount

func (c *Client) UserGetOrgUserCount() (*UserGetOrgUserCountRsp, error)

UserGetOrgUserCount 获取企业员工人数

func (*Client) UserGetUseridByUnionid

func (c *Client) UserGetUseridByUnionid(unionid string) (*UserGetUseridByUnionidRsp, error)

UserGetUseridByUnionid 根据unionid获取userid

func (*Client) UserListByPage

func (c *Client) UserListByPage(departmentid int) (*UserListByPageRsp, error)

UserListByPage 获取部门用户详情

func (*Client) UserSimpleList

func (c *Client) UserSimpleList(departmentid int) (*UserSimpleListRsp, error)

UserSimpleList 获取部门用户

func (*Client) UserUpdate

func (c *Client) UserUpdate(user *CreateUser) (*CreateUserRsp, error)

UserUpdate 更新用户

func (*Client) WorkNotificationV2Add added in v1.0.2

func (c *Client) WorkNotificationV2Add(info WorkNotificationV2) (*WorkNotificationV2Rsp, error)

WorkNotificationV2Add 发送工作通知消息

func (*Client) WorkNotificationV2GetSendProgress added in v1.0.2

func (c *Client) WorkNotificationV2GetSendProgress(info WorkNotificationGetSendProgress) (*WorkNotificationGetSendProgressRsp, error)

WorkNotificationV2GetSendProgress 查询工作通知消息的发送进度

func (*Client) WorkNotificationV2GetSendResult added in v1.0.2

func (c *Client) WorkNotificationV2GetSendResult(info WorkNotificationGetSendResult) (*WorkNotificationGetSendResultRsp, error)

WorkNotificationV2GetSendResult 查询工作通知消息的发送结果

func (*Client) WorkNotificationV2Remove added in v1.0.2

func (c *Client) WorkNotificationV2Remove(info WorkNotificationCancel) (*WorkNotificationCancelRsp, error)

WorkNotificationV2Remove 工作通知消息撤回

type CreateDepartment

type CreateDepartment struct {
	Name             string `json:"name"`
	Parentid         string `json:"parentid"`
	Order            string `json:"order"`
	CreateDeptGroup  bool   `json:"createDeptGroup"`
	DeptHiding       bool   `json:"deptHiding"`
	DeptPermits      string `json:"deptPermits"`
	UserPermits      string `json:"userPermits"`
	OuterDept        bool   `json:"outerDept"`
	OuterPermitDepts string `json:"outerPermitDepts"`
	OuterPermitUsers string `json:"outerPermitUsers"`
	SourceIdentifier string `json:"sourceIdentifier"`
}

CreateDepartment 创建部门

type CreateUser

type CreateUser struct {
	UserID       string      `json:"userid"`
	Name         string      `json:"name"`
	OrderInDepts string      `json:"orderInDepts"`
	Department   []int       `json:"department"`
	Position     string      `json:"position"`
	Mobile       string      `json:"mobile"`
	Tel          string      `json:"tel"`
	WorkPlace    string      `json:"workPlace"`
	Remark       string      `json:"remark"`
	Email        string      `json:"email"`
	OrgEmail     string      `json:"orgEmail"`
	Jobnumber    string      `json:"jobnumber"`
	IsHide       bool        `json:"isHide"`
	IsSenior     bool        `json:"isSenior"`
	Extattr      interface{} `json:"extattr"`
}

CreateUser 创建、更新用户

type CreateUserRsp

type CreateUserRsp struct {
	Errcode int    `json:"errcode"`
	Errmsg  string `json:"errmsg"`
	Userid  string `json:"userid"`
}

CreateUserRsp CreateUserRsp

type DepartmentCreateRsp

type DepartmentCreateRsp struct {
	Errcode int    `json:"errcode"`
	Errmsg  string `json:"errmsg"`
	ID      int    `json:"id"`
}

DepartmentCreateRsp DepartmentCreateRsp

type DepartmentGetRsp

type DepartmentGetRsp struct {
	Errcode               int    `json:"errcode"`
	Errmsg                string `json:"errmsg"`
	ID                    int    `json:"id"`
	Name                  string `json:"name"`
	Order                 int    `json:"order"`
	Parentid              int    `json:"parentid"`
	CreateDeptGroup       bool   `json:"createDeptGroup"`
	AutoAddUser           bool   `json:"autoAddUser"`
	DeptHiding            bool   `json:"deptHiding"`
	DeptPermits           string `json:"deptPermits"`
	UserPermits           string `json:"userPermits"`
	OuterDept             bool   `json:"outerDept"`
	OuterPermitDepts      string `json:"outerPermitDepts"`
	OuterPermitUsers      string `json:"outerPermitUsers"`
	OrgDeptOwner          string `json:"orgDeptOwner"`
	DeptManagerUseridList string `json:"deptManagerUseridList"`
	SourceIdentifier      string `json:"sourceIdentifier"`
}

DepartmentGetRsp 获取部门详情

type DepartmentListIdsRsp

type DepartmentListIdsRsp struct {
	Errcode       int    `json:"errcode"`
	Errmsg        string `json:"errmsg"`
	SubDeptIDList []int  `json:"sub_dept_id_list"`
}

DepartmentListIdsRsp 获取子部门ID列表

type DepartmentListParentRsp

type DepartmentListParentRsp struct {
	Errcode    int     `json:"errcode"`
	Errmsg     string  `json:"errmsg"`
	Department [][]int `json:"department"`
}

DepartmentListParentRsp DepartmentListParentRsp

type DepartmentListRsp

type DepartmentListRsp struct {
	Errcode    int    `json:"errcode"`
	Errmsg     string `json:"errmsg"`
	Department []struct {
		ID              int    `json:"id"`
		Name            string `json:"name"`
		Parentid        int    `json:"parentid"`
		CreateDeptGroup bool   `json:"createDeptGroup"`
		AutoAddUser     bool   `json:"autoAddUser"`
	} `json:"department"`
}

DepartmentListRsp 获取部门列表

type EditTodo

type EditTodo struct {
	// 待办事项对应的用户id
	Userid string `json:"userid"`
	// 	待办事项唯一id。
	// 该id可以使用创建待办接口中传入的biz_id,也可以使用创建待办接口返回结果中的record_id
	RecordID string `json:"record_id"`
}

EditTodo EditTodo

type EditTodoRsp

type EditTodoRsp struct {
	// Errcode 返回码 33012 无效的userid 请检查userid参数是否合法
	Errcode int `json:"errcode"`
	// Errmsg 对返回码的文本描述内容
	Errmsg string `json:"errmsg"`
	// Result	true表示更新成功,false表示更新失败
	Result bool `json:"result"`
}

EditTodoRsp 待办任务-更新待办 企业可以调用该接口更新待办事项状态,调用成功后,该待办事项在该用户的“待办事项”列表页面中消失。

type File

type File struct {
	Msgtype string `json:"msgtype"`
	File    struct {
		MediaID string `json:"media_id"`
	} `json:"file"`
}

File 文件消息 注意,文件消息只支持文件下载,不支持在线预览。

type Image

type Image struct {
	Msgtype string `json:"msgtype"`
	Image   struct {
		MediaID string `json:"media_id"`
	} `json:"image"`
}

Image 图片消息

type Link struct {
	Msgtype string `json:"msgtype"`
	Link    struct {
		MessageURL string `json:"messageUrl"`
		PicURL     string `json:"picUrl"`
		Title      string `json:"title"`
		Text       string `json:"text"`
	} `json:"link"`
}

Link 链接消息

type Markdown

type Markdown struct {
	Msgtype  string `json:"msgtype"`
	Markdown struct {
		Title string `json:"title"`
		Text  string `json:"text"`
	} `json:"markdown"`
}

Markdown markdown消息

type Oa

type Oa struct {
	Msgtype string `json:"msgtype"`
	Oa      struct {
		MessageURL string `json:"message_url"`
		Head       struct {
			Bgcolor string `json:"bgcolor"`
			Text    string `json:"text"`
		} `json:"head"`
		Body struct {
			Title string `json:"title"`
			Form  []struct {
				Key   string `json:"key"`
				Value string `json:"value"`
			} `json:"form"`
			Rich struct {
				Num  string `json:"num"`
				Unit string `json:"unit"`
			} `json:"rich"`
			Content   string `json:"content"`
			Image     string `json:"image"`
			FileCount string `json:"file_count"`
			Author    string `json:"author"`
		} `json:"body"`
	} `json:"oa"`
}

Oa OA消息

type ResAccessToken

type ResAccessToken struct {
	AccessToken string `json:"access_token"`
	ErrCode     int64  `json:"errcode"`
	ErrMsg      string `json:"errmsg"`
}

ResAccessToken struct

type SendNormalMessageRsp

type SendNormalMessageRsp struct {
	Errcode  int    `json:"errcode"`
	Errmsg   string `json:"errmsg"`
	Receiver string `json:"receiver"`
}

SendNormalMessageRsp 消息通知-发送普通消息 https://ding-doc.dingtalk.com/doc#/serverapi2/pm0m06

type SsoAccessToken

type SsoAccessToken struct {
	ErrCode     int    `json:"errcode"`
	ErrMsg      string `json:"errmsg"`
	AccessToken string `json:"access_token"`
}

SsoAccessToken 应用管理后台免登

type Text

type Text struct {
	Msgtype string `json:"msgtype"`
	Text    struct {
		Content string `json:"content"`
	} `json:"text"`
}

Text 文本消息

type UpdateDepartment

type UpdateDepartment struct {
	Name                  string `json:"name"`
	Parentid              string `json:"parentid"`
	Order                 string `json:"order"`
	ID                    int    `json:"id"`
	CreateDeptGroup       bool   `json:"createDeptGroup"`
	AutoAddUser           bool   `json:"autoAddUser"`
	DeptManagerUseridList string `json:"deptManagerUseridList"`
	DeptHiding            bool   `json:"deptHiding"`
	DeptPermits           string `json:"deptPermits"`
	UserPermits           string `json:"userPermits"`
	OuterDept             bool   `json:"outerDept"`
	OuterPermitDepts      string `json:"outerPermitDepts"`
	OuterPermitUsers      string `json:"outerPermitUsers"`
	OrgDeptOwner          string `json:"orgDeptOwner"`
	SourceIdentifier      string `json:"sourceIdentifier"`
}

UpdateDepartment 更新部门

type UserGetAdminRsp

type UserGetAdminRsp struct {
	Errcode   int    `json:"errcode"`
	Errmsg    string `json:"errmsg"`
	AdminList []struct {
		SysLevel int    `json:"sys_level"`
		Userid   string `json:"userid"`
	} `json:"admin_list"`
}

UserGetAdminRsp 获取管理员列表

type UserGetAdminScopeRsp

type UserGetAdminScopeRsp struct {
	Errcode int    `json:"errcode"`
	Errmsg  string `json:"errmsg"`
	DeptIds []int  `json:"dept_ids"`
}

UserGetAdminScopeRsp 获取管理员通讯录权限范围

type UserGetByMobileRsp

type UserGetByMobileRsp struct {
	CreateUserRsp
}

UserGetByMobileRsp 根据手机号获取userid

type UserGetDeptMemberRsp

type UserGetDeptMemberRsp struct {
	Errcode int      `json:"errcode"`
	Errmsg  string   `json:"errmsg"`
	UserIds []string `json:"userIds"`
}

UserGetDeptMemberRsp 获取部门用户userid列表

type UserGetInactiveRsp

type UserGetInactiveRsp struct {
	Errcode int    `json:"errcode"`
	Errmsg  string `json:"errmsg"`
	Result  struct {
		HasMore bool     `json:"has_more"`
		List    []string `json:"list"`
	} `json:"result"`
}

UserGetInactiveRsp 未登录钉钉的员工列表

type UserGetOrgUserCountRsp

type UserGetOrgUserCountRsp struct {
	Count   int    `json:"count"`
	Errcode int    `json:"errcode"`
	Errmsg  string `json:"errmsg"`
}

UserGetOrgUserCountRsp 获取企业员工人数

type UserGetUseridByUnionidRsp

type UserGetUseridByUnionidRsp struct {
	Errcode     int    `json:"errcode"`
	Errmsg      string `json:"errmsg"`
	ContactType int    `json:"contactType"`
	Userid      string `json:"userid"`
}

UserGetUseridByUnionidRsp 根据unionid获取userid

type UserListByPageRsp

type UserListByPageRsp struct {
	Errcode  int    `json:"errcode"`
	Errmsg   string `json:"errmsg"`
	HasMore  bool   `json:"hasMore"`
	Userlist []struct {
		Userid     string      `json:"userid"`
		Unionid    string      `json:"unionid"`
		Mobile     string      `json:"mobile"`
		Tel        string      `json:"tel"`
		WorkPlace  string      `json:"workPlace"`
		Remark     string      `json:"remark"`
		Order      int         `json:"order"`
		IsAdmin    bool        `json:"isAdmin"`
		IsBoss     bool        `json:"isBoss"`
		IsHide     bool        `json:"isHide"`
		IsLeader   bool        `json:"isLeader"`
		Name       string      `json:"name"`
		Active     bool        `json:"active"`
		Department []int       `json:"department"`
		Position   string      `json:"position"`
		Email      string      `json:"email"`
		Avatar     string      `json:"avatar"`
		Jobnumber  string      `json:"jobnumber"`
		Extattr    interface{} `json:"extattr"`
	} `json:"userlist"`
}

UserListByPageRsp 获取部门用户详情

type UserSimpleListRsp

type UserSimpleListRsp struct {
	Errcode  int    `json:"errcode"`
	Errmsg   string `json:"errmsg"`
	HasMore  bool   `json:"hasMore"`
	Userlist []struct {
		Userid string `json:"userid"`
		Name   string `json:"name"`
	} `json:"userlist"`
}

UserSimpleListRsp 获取部门用户

type UserTodoList

type UserTodoList struct {
	// Userid 待办事项对应的用户id
	Userid string `json:"userid"`
	// Offset 分页游标,从0开始,如返回结果中has_more为true,则表示还有数据,offset再传上一次的offset+limit
	Offset int `json:"offset"`
	// Limit 每次请求可获取的最大待办数量,最多传50
	Limit int `json:"limit"`
	// Status 待办事项状态,0表示未完成,1表示完成
	Status int `json:"status"`
}

UserTodoList 获取用户待办事项

type UserTodoListRsp

type UserTodoListRsp struct {
	// Errcode 返回码
	// 参数      说明            排查方法
	// 40068 	无效的offset 	offset不能小于0
	// 40069	无效的limit	    limit必须在0和50之间
	// 33012 	无效的userid 	请检查userid参数是否合法
	Errcode int `json:"errcode"`
	// Errmsg 对返回码的文本描述内容
	Errmsg  string `json:"errmsg"`
	Records struct {
		// HasMore true和false,其中true表示还有多余的数据
		HasMore bool `json:"has_more"`
		List    []struct {
			// RecordID 待办事项id,可用此id调用更新待办的接口
			RecordID string `json:"record_id"`
			// CreateTime 待办事项发起时间
			CreateTime int `json:"create_time"`
			// Title 待办标题
			Title string `json:"title"`
			// URL 待办跳转链接
			URL string `json:"url"`
			// Forms 待办表单列表
			Forms []struct {
				// 表单标题
				Title string `json:"title"`
				// Content 表单内容
				Content string `json:"content"`
			} `json:"forms"`
		} `json:"list"`
	} `json:"records"`
}

UserTodoListRsp 待办任务-获取用户的待办事项 https://ding-doc.dingtalk.com/doc#/serverapi2/neevhm

type UserinfoByInternal

type UserinfoByInternal struct {
	ErrCode  int    `json:"errcode"`
	ErrMsg   string `json:"errmsg"`
	UserID   string `json:"userid"`
	SYSLevel int    `json:"sys_level"`
	IsSYS    bool   `json:"is_sys"`
}

UserinfoByInternal 企业内部应用免登

type UserinfoBySso

type UserinfoBySso struct {
	ErrCode  int    `json:"errcode"`
	ErrMsg   string `json:"errmsg"`
	IsSys    bool   `json:"is_sys"`
	UserInfo struct {
		Avatar string `json:"avatar"`
		Email  string `json:"email"`
		Name   string `json:"name"`
		UserID string `json:"userid"`
	} `json:"user_info"`
	CorpInfo struct {
		CorpName string `json:"corp_name"`
		CorpID   string `json:"corpid"`
	} `json:"corp_info"`
}

UserinfoBySso UserinfoBySso

type UserinfoBycode

type UserinfoBycode struct {
	ErrCode  int    `json:"errcode"`
	ErrMsg   string `json:"errmsg"`
	UserInfo struct {
		Nick    string `json:"nick"`
		Openid  string `json:"openid"`
		Unionid string `json:"unionid"`
	} `json:"user_info"`
}

UserinfoBycode 扫描登陆第三方、钉钉内部登录第三方、密码登录第三方

type UsertGetRsp

type UsertGetRsp struct {
	Errcode         int    `json:"errcode"`
	UnionID         string `json:"unionid"`
	Remark          string `json:"remark"`
	UserID          string `json:"userid"`
	IsLeaderInDepts string `json:"isLeaderInDepts"`
	IsBoss          bool   `json:"isBoss"`
	HiredDate       int64  `json:"hiredDate"`
	IsSenior        bool   `json:"isSenior"`
	Tel             string `json:"tel"`
	Department      []int  `json:"department"`
	WorkPlace       string `json:"workPlace"`
	Email           string `json:"email"`
	OrderInDepts    string `json:"orderInDepts"`
	Mobile          string `json:"mobile"`
	Errmsg          string `json:"errmsg"`
	Active          bool   `json:"active"`
	Avatar          string `json:"avatar"`
	IsAdmin         bool   `json:"isAdmin"`
	IsHide          bool   `json:"isHide"`
	Jobnumber       string `json:"jobnumber"`
	Name            string `json:"name"`
	Extattr         struct {
	} `json:"extattr"`
	StateCode string `json:"stateCode"`
	Position  string `json:"position"`
	Roles     []struct {
		ID        int    `json:"id"`
		Name      string `json:"name"`
		GroupName string `json:"groupName"`
	} `json:"roles"`
}

UsertGetRsp 获取用户详情

type Voice

type Voice struct {
	Msgtype string `json:"msgtype"`
	Voice   struct {
		MediaID  string `json:"media_id"`
		Duration string `json:"duration"`
	} `json:"voice"`
}

Voice 语音消息

type WorkNotificationCancel

type WorkNotificationCancel struct {
	MsgTaskID int64 `json:"msg_task_id"`
	AgentID   int64 `json:"agent_id"`
}

WorkNotificationCancel 工作通知消息撤回

type WorkNotificationCancelRsp

type WorkNotificationCancelRsp struct {
	Errcode int    `json:"errcode"`
	Errmsg  string `json:"errmsg"`
}

WorkNotificationCancelRsp 工作通知消息撤回返回结果

type WorkNotificationGetSendProgress added in v1.0.2

type WorkNotificationGetSendProgress struct {
	TaskID  int64 `json:"task_id"`
	AgentID int64 `json:"agent_id"`
}

WorkNotificationGetSendProgress 查询工作通知消息的发送进度

type WorkNotificationGetSendProgressRsp added in v1.0.2

type WorkNotificationGetSendProgressRsp struct {
	// 返回码
	Errcode int `json:"errcode"`
	// 对返回码的文本描述内容
	Errmsg   string `json:"errmsg"`
	Progress struct {
		// 取值 0-100,表示处理的百分比
		ProgressInPercent int `json:"progress_in_percent"`
		// 任务执行状态,0=未开始,1=处理中,2=处理完毕
		Status int `json:"status"`
	} `json:"progress"`
}

WorkNotificationGetSendProgressRsp 查询工作通知消息的发送进度返回结果

type WorkNotificationGetSendResult added in v1.0.2

type WorkNotificationGetSendResult struct {
	TaskID  int64 `json:"task_id"`
	AgentID int64 `json:"agent_id"`
}

WorkNotificationGetSendResult 查询工作通知消息的发送结果

type WorkNotificationGetSendResultRsp added in v1.0.2

type WorkNotificationGetSendResultRsp struct {
	SendResult struct {
		// InvalidUserIDList 无效的用户id
		InvalidUserIDList []string `json:"invalid_user_id_list"`
		// 	ForbiddenUserIDList 因发送消息超过上限而被流控过滤后实际未发送的userid。未被限流的接收者仍会被收到消息。限流规则包括:
		// 1.同一个微应用相同消息的内容同一个用户一天只能接收一次
		// 2.同一个微应用给同一个用户发送消息,
		// 如果是第三方企业应用,一天最多为50次;
		// 如果是企业内部开发方式,一天最多为500次
		ForbiddenUserIDList []string `json:"forbidden_user_id_list"`
		// FailedUserIDList 发送失败的用户id
		FailedUserIDList []string `json:"failed_user_id_list"`
		// ReadUserIDList 已读消息的用户id
		ReadUserIDList []string `json:"read_user_id_list"`
		// UnreadUserIDList 未读消息的用户id
		UnreadUserIDList []string `json:"unread_user_id_list"`
		// InvalidDeptIDList 无效的部门id
		InvalidDeptIDList []string `json:"invalid_dept_id_list"`
		ForbiddenList     struct {
			// Code 流控code。包括以下code:
			// 143105表示企业自建应用每日推送给用户的消息超过上限
			// 143106表示企业自建应用推送给用户的消息重复
			Code int `json:"code"`
			// Userid 被流控员工userId
			Userid string `json:"userId"`
			// Count 流控阀值
			Count int `json:"count"`
		} `json:" forbidden_list"`
	} `json:"send_result"`
	RequestID string `json:"request_id"`
	// 返回码
	Errcode int `json:"errcode"`
	// 对返回码的文本描述内容
	Errmsg string `json:"errmsg"`
}

WorkNotificationGetSendResultRsp 查询工作通知消息的发送结果返回结果

type WorkNotificationV2

type WorkNotificationV2 struct {
	AgentID    int64       `json:"agent_id"`
	Msg        interface{} `json:"msg"`
	UseridList string      `json:"userid_list"`
}

WorkNotificationV2 发送工作通知消息需要注意以下事项: 同一个应用相同消息的内容同一个用户一天只能接收一次。 同一个应用给同一个用户发送消息,企业内部开发方式一天不得超过500次。 通过设置to_all_user参数全员推送消息,一天最多3次。 超出以上限制次数后,接口返回成功,但用户无法接收到。详细的限制说明,请参考“工作通知消息的限制”。 该接口是异步发送消息,接口返回成功并不表示用户一定会收到消息,需要通过“查询工作通知消息的发送结果”接口查询是否给用户发送成功。 消息类型和样例可参考消息类型文档。

type WorkNotificationV2Rsp

type WorkNotificationV2Rsp struct {
	Errcode   int    `json:"errcode"`
	Errmsg    string `json:"errmsg"`
	TaskID    int64  `json:"task_id"`
	RequestID string `json:"request_id"`
}

WorkNotificationV2Rsp 工作消息通知返回结果

Jump to

Keyboard shortcuts

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