native

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DINGTALKMESSAGETYPE_MARKDOWN   = DingtalkMessageType("markdown")
	DINGTALKMESSAGETYPE_TEXT       = DingtalkMessageType("text")
	DINGTALKMESSAGETYPE_IMAGE      = DingtalkMessageType("image")
	DINGTALKMESSAGETYPE_LINK       = DingtalkMessageType("link")
	DINGTALKMESSAGETYPE_FILE       = DingtalkMessageType("file")
	DINGTALKMESSAGETYPE_VOICE      = DingtalkMessageType("voice")
	DINGTALKMESSAGETYPE_OA         = DingtalkMessageType("oa")
	DINGTALKMESSAGETYPE_ACTIONCARD = DingtalkMessageType("action_card")
)
View Source
const DINGTALK_OAPI_DOMAIN = "https://oapi.dingtalk.com"

Variables

This section is empty.

Functions

func CreateNativeClient

func CreateNativeClient() (client *dingtalkoauth2_1_0.Client, err error)

func GetAccessToken

func GetAccessToken(appKey, appSecret string) (accessToken string, expireIn int64, err error)

func GetUserIdByMobile

func GetUserIdByMobile(accessToken string, mobile string) (userId string, err error)

func SendCorpConversationMarkdownMessage

func SendCorpConversationMarkdownMessage(accessToken string, agentId int64, userIds []string, title, content string) error

Types

type DingtalkBaseResponse

type DingtalkBaseResponse struct {
	ErrCode int    `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
}

type DingtalkMessageObj

type DingtalkMessageObj struct {
	MsgType  DingtalkMessageType `json:"msgtype"`
	Markdown MarkdownMessage     `json:"markdown"`
}

type DingtalkMessageType

type DingtalkMessageType string

type GetUserIdByMobileRequest

type GetUserIdByMobileRequest struct {
	Mobile                        string `json:"mobile"`
	SupportExclusiveAccountSearch bool   `json:"support_exclusive_account_search"`
}

type GetUserIdByMobileResponse

type GetUserIdByMobileResponse struct {
	DingtalkBaseResponse
	Result struct {
		UserId string `json:"userid"`
	} `json:"result"`
}

type MarkdownMessage

type MarkdownMessage struct {
	Text  string `json:"text"`
	Title string `json:"title"`
}

type SendCorpConversationMarkdownMessageRequest

type SendCorpConversationMarkdownMessageRequest struct {
	AgentId    int64              `json:"agent_id"`
	UseridList string             `json:"userid_list"`
	ToAllUser  bool               `json:"to_all_user"`
	Msg        DingtalkMessageObj `json:"msg"`
}

type SendCorpConversationMarkdownMessageResponse

type SendCorpConversationMarkdownMessageResponse struct {
	DingtalkBaseResponse
	TaskId int64 `json:"task_id"`
}

Jump to

Keyboard shortcuts

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