Documentation ¶
Index ¶
Constants ¶
View Source
const ( NotifyBaseURL = "https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2" NotifyResultURL = "https://oapi.dingtalk.com/topapi/message/corpconversation/getsendresult" GetAccessTokenURL = "https://oapi.dingtalk.com/gettoken" GetUserIdURL = "https://oapi.dingtalk.com/topapi/v2/user/getbymobile" MsgTextType = "text" MsgImageType = "image" MsgVoiceType = "voice" MsgFileType = "file" MsgLinkType = "link" MsgMarkdownType = "markdown" )
Variables ¶
This section is empty.
Functions ¶
func GetAccountToken ¶
GetAccountToken @Description: get dingtalk account token @return err
Types ¶
type Interface ¶
type Interface interface { Send(msg map[string]interface{}) (result string, err error) SendText(content string) (result string, err error) SendImage(mediaId string) (result string, err error) SendVoice(mediaId, duration string) (result string, err error) SendFile(mediaId string) (result string, err error) SendLink(title, text, messageUrl, picUrl string) (result string, err error) SendMarkdown(title, text string) (result string, err error) }
type UserIdResponse ¶
type UserIdResponse struct { RequestID string `json:"request_id"` ErrCode int `json:"errcode"` ErrMsg string `json:"errmsg"` Result struct { UserID string `json:"userid"` ExclusiveAccountUserIDList []string `json:"exclusive_account_userid_list"` } `json:"result"` }
func GetDingtalkUserId ¶
func GetDingtalkUserId(mobile string) (res UserIdResponse, err error)
GetDingtalkUserId @Description: obtain the user ID of DingTalk users through their phone number, and enterprise applications need to have this interface permission, https://open.dingtalk.com/document/orgapp/obtain-the-userid-of-your-mobile-phone-number @param mobile phone number @return res return results @return err error message
Click to show internal directories.
Click to hide internal directories.