Documentation
¶
Index ¶
- Constants
- func AddTag(accessToken, tagName string) (*offiaccount.TagResponse, error)
- func BatchBlackList(accessToken string, openIdList []string) (*offiaccount.Response, error)
- func BatchGetUserInfo(accessToken string, openIds []string) (*offiaccount.UserInfoListResponse, error)
- func BatchTagging(accessToken string, tagId int64, openIdList []string) (*offiaccount.Response, error)
- func BatchUnBlackList(accessToken string, openIdList []string) (*offiaccount.Response, error)
- func BatchUnTagging(accessToken string, tagId int64, openIdList []string) (*offiaccount.Response, error)
- func ClearQuota(accessToken, appid string) (*offiaccount.Response, error)
- func CreateMenu(accessToken string, menu map[string]interface{}) (*offiaccount.Response, error)
- func CreateQrCode(accessToken string, QrType string, sceneKey interface{}, expireSeconds int64) (*offiaccount.QrCodeResponse, error)
- func DelMenu(accessToken string) (*offiaccount.Response, error)
- func DelTag(accessToken string, tagId int64) (*offiaccount.Response, error)
- func FetchShorten(accessToken, shortKey string) (*offiaccount.FetchShortenResponse, error)
- func GenShorten(accessToken, longData string, expireSeconds int64) (*offiaccount.ShortenResponse, error)
- func GetApiDomainIp(accessToken string) (*offiaccount.IpAddressResponse, error)
- func GetBlackList(accessToken, nextOpenId string) (*offiaccount.BlackListResponse, error)
- func GetCallbackIp(accessToken string) (*offiaccount.IpAddressResponse, error)
- func GetMenu(accessToken string) (*offiaccount.MenuResponse, error)
- func GetNetworkDetection(accessToken, action, checkOperator string) (*offiaccount.NetworkDetectionResponse, error)
- func GetQuota(accessToken, cgiPath string) (*offiaccount.QuotaResponse, error)
- func GetTagUsers(accessToken string, tagId int64, nextOpenId string) (*offiaccount.TagUserResponse, error)
- func GetTags(accessToken string) (*offiaccount.TagsResponse, error)
- func GetUserInfo(accessToken, openId string) (*offiaccount.UserInfoResponse, error)
- func GetUserList(accessToken, nextOpenId string) (*offiaccount.UserListResponse, error)
- func GetUserTags(accessToken, openId string) (*offiaccount.UserTagsResponse, error)
- func ParseRid(accessToken, rid string) (*offiaccount.RidResponse, error)
- func UpdateTag(accessToken string, tagId int64, tagName string) (*offiaccount.Response, error)
- type AccessTokenResponse
- type Client
- type Config
Constants ¶
const (
// https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Get_access_token.html
GET_ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s"
)
Variables ¶
This section is empty.
Functions ¶
func AddTag ¶ added in v0.0.4
func AddTag(accessToken, tagName string) (*offiaccount.TagResponse, error)
创建标签 一个公众号,最多可以创建100个标签。
accessToken 接口调用凭证、令牌
tagName 标签名称
func BatchBlackList ¶ added in v0.0.4
func BatchBlackList(accessToken string, openIdList []string) (*offiaccount.Response, error)
批量拉黑用户
accessToken 接口调用凭证、令牌
openIdList 需要拉黑的openid 一次只能拉黑20个用户
func BatchGetUserInfo ¶ added in v0.0.4
func BatchGetUserInfo(accessToken string, openIds []string) (*offiaccount.UserInfoListResponse, error)
批量获取用户基本信息
accessToken 接口调用凭证、令牌
openIds 微信公众号用户唯一标识 最多100个
func BatchTagging ¶ added in v0.0.4
func BatchTagging(accessToken string, tagId int64, openIdList []string) (*offiaccount.Response, error)
批量为用户打标签
accessToken 接口调用凭证、令牌
openIdList 微信用户openid列表
func BatchUnBlackList ¶ added in v0.0.4
func BatchUnBlackList(accessToken string, openIdList []string) (*offiaccount.Response, error)
批量取消拉黑用户
accessToken 接口调用凭证、令牌
openIdList 需要拉黑的openid 一次只能拉黑20个用户
func BatchUnTagging ¶ added in v0.0.4
func BatchUnTagging(accessToken string, tagId int64, openIdList []string) (*offiaccount.Response, error)
批量为用户取消标签
accessToken 接口调用凭证、令牌
tagId 标签ID
openIdList 微信用户openid列表
func ClearQuota ¶ added in v0.0.3
func ClearQuota(accessToken, appid string) (*offiaccount.Response, error)
用于清空公众号/小程序/第三方平台等接口的每日调用接口次数。
accessToken 接口调用凭证、令牌
appid 要被清空的账号的appid
func CreateMenu ¶ added in v0.0.3
func CreateMenu(accessToken string, menu map[string]interface{}) (*offiaccount.Response, error)
创建公众号菜单
accessToken 接口调用凭证、令牌
menu 需要发布的公众号菜单信息
func CreateQrCode ¶ added in v0.0.4
func CreateQrCode(accessToken string, QrType string, sceneKey interface{}, expireSeconds int64) (*offiaccount.QrCodeResponse, error)
生成公众号二维码
accessToken 接口调用凭证、令牌
QrType 二维码类型 enum(QR_SCENE, QR_STR_SCENE, QR_LIMIT_SCENE, QR_LIMIT_STR_SCENE)
sceneKey 二维码参数 整数参数请传整数 字符串参数请传字符串
expireSeconds 有效时长 永久二维码请填写0
func DelMenu ¶ added in v0.0.3
func DelMenu(accessToken string) (*offiaccount.Response, error)
删除公众号菜单(默认菜单和全部的个性化菜单)
accessToken 接口调用凭证、令牌
func DelTag ¶ added in v0.0.4
func DelTag(accessToken string, tagId int64) (*offiaccount.Response, error)
删除标签
accessToken 接口调用凭证、令牌
tagId 标签ID
func FetchShorten ¶ added in v0.0.4
func FetchShorten(accessToken, shortKey string) (*offiaccount.FetchShortenResponse, error)
根据短key还原数据
accessToken 接口调用凭证、令牌
shortKey 短key
func GenShorten ¶ added in v0.0.4
func GenShorten(accessToken, longData string, expireSeconds int64) (*offiaccount.ShortenResponse, error)
生成短key
accessToken 接口调用凭证、令牌
longData 原始数据 4k以内
expireSeconds 有效时长 永久二维码请填写0
func GetApiDomainIp ¶
func GetApiDomainIp(accessToken string) (*offiaccount.IpAddressResponse, error)
获取微信 API 接口 IP地址
accessToken 接口调用凭证、令牌
func GetBlackList ¶ added in v0.0.4
func GetBlackList(accessToken, nextOpenId string) (*offiaccount.BlackListResponse, error)
公众号的黑名单列表
accessToken 接口调用凭证、令牌
nextOpenId 拉取列表最后一个用户的openid
func GetCallbackIp ¶
func GetCallbackIp(accessToken string) (*offiaccount.IpAddressResponse, error)
获取微信callback IP地址
accessToken 接口调用凭证、令牌
func GetMenu ¶ added in v0.0.3
func GetMenu(accessToken string) (*offiaccount.MenuResponse, error)
获取公众号当前菜单信息
accessToken 接口调用凭证、令牌
func GetNetworkDetection ¶
func GetNetworkDetection(accessToken, action, checkOperator string) (*offiaccount.NetworkDetectionResponse, error)
获取公众号回调地址网络信息。dns、ping丢包等
accessToken 接口调用凭证、令牌
action 执行的检测动作,允许的值:dns(做域名解析)、ping(做 ping 检测)、all(dns和 ping 都做)
checkOperator 指定平台从某个运营商进行检测,允许的值:CHINANET(电信出口)、UNICOM(联通出口)、CAP(腾讯自建出口)、DEFAULT(根据 ip 来选择运营商)
func GetQuota ¶ added in v0.0.3
func GetQuota(accessToken, cgiPath string) (*offiaccount.QuotaResponse, error)
用于查询公众号/小程序/第三方平台等接口的每日调用接口的额度以及调用次数。
accessToken 接口调用凭证、令牌
cgiPath api的请求地址,例如"/cgi-bin/message/custom/send";不要前缀“https://api.weixin.qq.com” ,也不要漏了"/",否则都会76003的报错
func GetTagUsers ¶ added in v0.0.4
func GetTagUsers(accessToken string, tagId int64, nextOpenId string) (*offiaccount.TagUserResponse, error)
获取标签下粉丝列表
accessToken 接口调用凭证、令牌
nextOpenId 拉取列表最后一个用户的openid
func GetTags ¶ added in v0.0.4
func GetTags(accessToken string) (*offiaccount.TagsResponse, error)
获取公众号已创建的标签
accessToken 接口调用凭证、令牌
func GetUserInfo ¶ added in v0.0.4
func GetUserInfo(accessToken, openId string) (*offiaccount.UserInfoResponse, error)
用户基本信息
accessToken 接口调用凭证、令牌
openId 微信公众号用户唯一标识
func GetUserList ¶ added in v0.0.4
func GetUserList(accessToken, nextOpenId string) (*offiaccount.UserListResponse, error)
帐号的关注者列表
accessToken 接口调用凭证、令牌
nextOpenId 拉取列表最后一个用户的openid
func GetUserTags ¶ added in v0.0.4
func GetUserTags(accessToken, openId string) (*offiaccount.UserTagsResponse, error)
获取用户身上的标签列表
accessToken 接口调用凭证、令牌
openId 微信公众号用户唯一标识
func ParseRid ¶ added in v0.0.3
func ParseRid(accessToken, rid string) (*offiaccount.RidResponse, error)
本接口用于查询调用公众号/小程序/第三方平台等接口报错返回的 rid 详情信息,辅助开发者高效定位问题。
accessToken 接口调用凭证、令牌
rid 接口异常返回的rid参数
Types ¶
type AccessTokenResponse ¶ added in v0.0.3
type AccessTokenResponse struct {
offiaccount.Response
AccessToken string `json:"access_token"` // 接口调用凭证、令牌
ExpiresIn int64 `json:"expires_in"` // 凭证有效时间,单位:秒
}
func GetAccessToken ¶
func GetAccessToken(appid, secret string) (*AccessTokenResponse, error)
获取公众号/小程序的接口调用凭证
appid 公众号唯一appid
secret 第三方用户唯一凭证密钥,即appsecret
type Client ¶ added in v0.0.4
type Client struct {
*offiaccount.OffiAccountAccess
}
微信客户端 内嵌offiaccount 可以使用此实例调用offiaccount的所有method。