Documentation ¶
Overview ¶
*
第一类 模板消息
- 1 设置所属行业
- 2 获取设置的行业信息
- 3 获得模板ID
- 4 获取模板列表
- 5 删除模板
- 6 发送模板消息
Index ¶
- func Delete(api *token.Api, tmId string) error
- func GetId(api *token.Api, tmShortId string) (string, error)
- func GetIndustry(api *token.Api) (*structs.IndustryS, error)
- func GetList(api *token.Api) ([]structs.TMInfo, error)
- func SetIndustry(api *token.Api, req *structs.IndustryReq) error
- type Base
- type Data
- type KeyWord
- type Program
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
删除模板 POST https://api.weixin.qq.com/cgi-bin/template/del_private_template?access_token=ACCESS_TOKEN { "template_id" : "Dyvp3-Ff0cnail_CDSzk1fIc6-9lOkxsQE7exTJbwUE" }
func GetId ¶
获得模板ID POST https://api.weixin.qq.com/cgi-bin/template/api_add_template?access_token=ACCESS_TOKEN
func GetIndustry ¶
获取设置的行业信息 GET https://api.weixin.qq.com/cgi-bin/template/get_industry?access_token=ACCESS_TOKEN ErrorIf { "primary_industry":{"first_class":"运输与仓储","second_class":"快递"}, "secondary_industry":{"first_class":"IT科技","second_class":"互联网|电子商务"} }
func GetList ¶
获取模板列表 GET https://api.weixin.qq.com/cgi-bin/template/get_all_private_template?access_token=ACCESS_TOKEN
func SetIndustry ¶
func SetIndustry(api *token.Api, req *structs.IndustryReq) error
设置所属行业,每月可修改行业1次 数据示例如下:
{ "industry_id1":"1", "industry_id2":"4" }
POST https://api.weixin.qq.com/cgi-bin/template/api_set_industry?access_token=ACCESS_TOKEN
Types ¶
type Base ¶
type Base struct { AppId string `json:"-"` ToUser string `json:"touser"` Id string `json:"template_id"` Url string `json:"url,omitempty"` Mini *Program `json:"miniprogram,omitempty"` }
Base 模板消息