Documentation ¶
Index ¶
- func Get(api *token.Api, domain string, mediaId string) ([]byte, error)
- func GetHD(api *token.Api, domain string, mediaId string) ([]byte, error)
- func UpdateImage(api *token.Api, domain string, img *Image) (string, error)
- func UpdateImageV2(api *token.Api, domain string, fileType string, img token.Form) (string, error)
- func UploadASync(api *token.Api, domain string, file *BigFile) (string, error)
- type Articles
- type ArticlesResult
- type BigFile
- type BigJob
- type FileName
- type ID
- func AddNews(api *token.Api, news *Articles) (*ID, error)
- func Upload(api *token.Api, domain, fileType, filename string) (*ID, error)
- func UploadProvider(api *token.Api, fileType string, attachmentType int, img token.Form) (*ID, error)
- func UploadV2(api *token.Api, domain, fileType string, img token.Form) (*ID, error)
- type Image
- type News
- type NewsResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get 获取临时素材 GET, https://api.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID GET, https://qyapi.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID for 企业微信
func GetHD ¶ added in v1.8.43
GetHD 获取高清语音素材 可以使用本接口获取从JSSDK的uploadVoice接口上传的临时语音素材,格式为speex,16K采样率。该音频比上文的临时素材获取接口(格式为amr,8K采样率)更加清晰,适合用作语音识别等对音质要求较高的业务。 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/media/get/jssdk?access_token=ACCESS_TOKEN&media_id=MEDIA_ID
func UpdateImage ¶
UpdateImage 上传图片 上传图片得到图片URL,该URL永久有效 返回的图片URL,仅能用于图文消息正文中的图片展示,或者给客户发送欢迎语等;若用于非企业微信环境下的页面,图片将被屏蔽。 每个企业每月最多可上传3000张图片,每天最多可上传1000张图片 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/media/uploadimg?access_token=ACCESS_TOKEN
func UpdateImageV2 ¶ added in v1.8.39
UpdateImageV2 上传图片 上传图片得到图片URL,该URL永久有效 返回的图片URL,仅能用于图文消息正文中的图片展示,或者给客户发送欢迎语等;若用于非企业微信环境下的页面,图片将被屏蔽。 每个企业每月最多可上传3000张图片,每天最多可上传1000张图片 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/media/uploadimg?access_token=ACCESS_TOKEN
func UploadASync ¶ added in v1.8.43
UploadASync 生成异步上传任务 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/media/upload_by_url?access_token=ACCESS_TOKEN
Types ¶
type ArticlesResult ¶ added in v1.8.38
type ArticlesResult struct { Items []NewsResult `json:"news_item"` FileName }
func GetMaterial ¶
func GetMaterial(api *token.Api, mediaId string) (*ArticlesResult, error)
GetMaterial 获取永久素材 POST,https协议 https://api.weixin.qq.com/cgi-bin/material/get_material?access_token=ACCESS_TOKEN
type BigJob ¶ added in v1.8.43
type ID ¶ added in v1.8.38
type ID struct { Type string `json:"type,omitempty"` MediaId string `json:"media_id"` CreatedAt interface{} `json:"created_at,omitempty"` //企业微信为字符串,公众号为int64 }
func AddNews ¶
AddNews 新增永久图文素材 POST,https://api.weixin.qq.com/cgi-bin/material/add_news?access_token=ACCESS_TOKEN
func Upload ¶
Upload 上传临时素材 素材上传得到media_id,该media_id仅三天内有效 media_id在同一企业内应用之间可以共享 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/media/upload?access_token=ACCESS_TOKEN&type=TYPE 使用multipart/form-data POST上传文件, 文件标识名为"media" fileType 分别有图片(image)、语音(voice)、视频(video),普通文件(file)
func UploadProvider ¶ added in v1.8.43
func UploadProvider(api *token.Api, fileType string, attachmentType int, img token.Form) (*ID, error)
UploadProvider 服务商上传临时素材 素材上传得到media_id,该media_id仅三天内有效 media_id在同一企业内应用之间可以共享 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/service/media/upload?provider_access_token=ACCESS_TOKEN&type=TYPE&attachment_type=3 使用multipart/form-data POST上传文件, 文件标识名为"media"
func (*ID) Int64CreateAt ¶ added in v1.8.47
func (*ID) StringCreateAt ¶ added in v1.8.47
type News ¶ added in v1.8.38
type News struct { Title string `json:"title"` ThumbMediaId string `json:"thumb_media_id"` Author string `json:"author"` Digest string `json:"digest"` ShowCoverPic int8 `json:"show_cover_pic"` Content string `json:"content"` ContentSourceUrl string `json:"content_source_url"` NeedOpenComment int8 `json:"need_open_comment"` OnlyFansCanComment int8 `json:"only_fans_can_comment"` }
type NewsResult ¶ added in v1.8.38
type NewsResult struct { Title string `json:"title"` ThumbMediaId string `json:"thumb_media_id"` Author string `json:"author"` Digest string `json:"digest"` ShowCoverPic int8 `json:"show_cover_pic"` Content string `json:"content"` Url string `json:"url"` Description string `json:"description"` DownUrl string `json:"down_url"` ContentSourceUrl string `json:"content_source_url"` NeedOpenComment int8 `json:"need_open_comment"` OnlyFansCanComment int8 `json:"only_fans_can_comment"` }