Documentation ¶
Overview ¶
Package oauth OAuth授权相关API
Index ¶
- func AccessToken(clt *core.SDKClient, authCode string) (*oauth.AccessTokenResponseData, error)
- func AdvertiserGet(clt *core.SDKClient, accessToken string) ([]oauth.Advertiser, error)
- func AppAccessToken(clt *core.SDKClient) (*oauth.AppAccessTokenResult, error)
- func RefreshToken(clt *core.SDKClient, refreshToken string) (*oauth.AccessTokenResponseData, error)
- func Url(clt *core.SDKClient, redirectUrl string, state string, materialAuth bool) string
- func UserInfo(clt *core.SDKClient, accessToken string) (*oauth.UserInfoResponseData, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessToken ¶
AccessToken 获取Access Token Access-Token是调用接口时,操作指定广告账户的身份凭证,有效期为24小时 Refresh-Token用于生成新access_token和refresh_token并且刷新时效达到续期的目的
func AdvertiserGet ¶ added in v1.2.3
AdvertiserGet 获取已授权账户 重新授权会覆盖前一次授权,需要确保此次授权已经勾选了想要的全部账户!!重新授权需要重新获取access token; 此接口可查询授权界面选择的角色账号id,包括广告主id、管家id、代理商id,具体可以通过“advertiser_role” 来区分; 如果是管家或者代理商角色,需要通过“获取管家账户列表”/“获取代理商账户列表”获取其下的广告主;
func AppAccessToken ¶ added in v1.19.3
func AppAccessToken(clt *core.SDKClient) (*oauth.AppAccessTokenResult, error)
AppAccessToken 获取APP Access Token
func RefreshToken ¶
RefreshToken 刷新Refresh Token 由于Access_Token有效期(默认1天)较短,当Access_Token超时后,可以使用refresh_token进行刷新,每次刷新都会产生新的access_token和Refresh_Token,同时重置二者的有效期。 Refresh_Token有效期是30天,但是刷新后会产生新的Refresh_token,老的Refresh_token会过期
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.