service

package
v1.8.101 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Zlib Imports: 10 Imported by: 0

README

服务商

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorpIdToOpenCorpId

func CorpIdToOpenCorpId(api *token.Api, corpId string) (string, error)

CorpIdToOpenCorpId 明文corpid转换为加密corpid POST(HTTPS) 为更好地保护企业与用户的数据,第三方应用获取的corpid不再是明文的corpid,将升级为第三方服务商级别的加密corpid(了解更多)。第三方可以将已有的明文corpid转换为第三方的加密corpid。 请求地址:https://qyapi.weixin.qq.com/cgi-bin/service/corpid_to_opencorpid?provider_access_token=ACCESS_TOKEN

func GetAdminList

func GetAdminList(api *token.Api, authCorpId string, agentId int32) (*structs.AdminList, error)

GetAdminList 获取应用的管理员列表 第三方服务商可以用此接口获取授权企业中某个第三方应用的管理员列表(不包括外部管理员),以便服务商在用户进入应用主页之后根据是否管理员身份做权限的区分。 该应用必须与SUITE_ACCESS_TOKEN对应的suiteid对应,否则没权限查看 POST(HTTPS) https://qyapi.weixin.qq.com/cgi-bin/service/get_admin_list?suite_access_token=SUITE_ACCESS_TOKEN

func GetAgentPermissions added in v1.8.5

func GetAgentPermissions(api *token.Api) ([]string, error)

GetAgentPermissions 获取应用权限详情 该API用于获取代开发应用或第三方应用用户授权的权限详情。 请求方式:POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/agent/get_permissions?access_token=ACCESS_TOKEN 权限说明: https://developer.work.weixin.qq.com/document/path/99052

func GetAppQRCode added in v1.8.5

func GetAppQRCode(api *token.Api, qr structs.QRCodeReq) (string, error)

GetAppQRCode 获取应用二维码 POST(HTTPS) 用于获取第三方应用二维码。 要求第三方应用是已上线的第三方应用,不能是代应用 https://qyapi.weixin.qq.com/cgi-bin/service/get_app_qrcode?suite_access_token=SUITE_ACCESS_TOKEN

func GetAuthInfo

func GetAuthInfo(api *token.Api, authCorpId, permanentCode string) (*structs.Permanent, error)

GetAuthInfo 获取企业授权信息 POST(HTTPS) https://qyapi.weixin.qq.com/cgi-bin/service/get_auth_info?suite_access_token=SUITE_ACCESS_TOKEN

func GetCorpToken

func GetCorpToken(corp token.Token, d data.D) (access.Token, error)

GetCorpToken 获取企业凭证 POST(HTTPS) 第三方服务商在取得企业的永久授权码后,通过此接口可以获取到企业的access_token。 获取后可通过通讯录、应用、消息等企业接口来运营这些应用。 此处获得的企业access_token与企业获取access_token拿到的token,本质上是一样的,只不过获取方式不同。 获取之后,就跟普通企业一样使用token调用API接口 https://qyapi.weixin.qq.com/cgi-bin/service/get_corp_token?suite_access_token=SUITE_ACCESS_TOKEN

func GetCustomizedAuthUrl

func GetCustomizedAuthUrl(api *token.Api, state string, templateId []string) (*structs.CustomizedAuthUrl, error)

GetCustomizedAuthUrl 获取带参授权链接 该API用于获取代开发自建应用授权链接,用于生成带参临时二维码。 可用来生成二维码的授权url,需要开发者自行生成为二维码 请求方式:POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/service/get_customized_auth_url?provider_access_token=PROVIDER_ACCESS_TOKEN

func GetLoginInfo

func GetLoginInfo(api *token.Api, authCode string) (*structs.LoginInfo, error)

GetLoginInfo 获取登录用户信息 [扫码授权登录] 第三方可通过如下接口,获取登录用户的信息。建议用户以返回信息中的corpid及userid为主键匹配用户 授权登录服务商的网站时,使用应用提供商的provider_access_token 请求方式:POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/service/get_login_info?access_token=PROVIDER_ACCESS_TOKEN

func GetPermanentCode

func GetPermanentCode(corp token.Token, d data.D) (access.Token, error)

GetPermanentCode 获取企业永久授权码 POST(HTTPS)https://qyapi.weixin.qq.com/cgi-bin/service/get_permanent_code

func GetPreAuthCode

func GetPreAuthCode(api *token.Api) (*structs.PreAuthCode, error)

GetPreAuthCode 获取预授权码

func GetProviderToken

func GetProviderToken(corp token.Token, d data.D) (access.Token, error)

GetProviderToken 获取服务商凭证 开发者需要缓存provider_access_token,用于后续接口的调用(注意:不能频繁调用get_provider_token接口,否则会受到频率拦截)。 当provider_access_token失效或过期时,需要重新获取。 provider_access_token的有效期通过返回的expires_in来传达,正常情况下为7200秒(2小时),有效期内重复获取返回相同结果,过期后获取会返回新的provider_access_token。 provider_access_token至少保留512字节的存储空间。 企业微信可能会出于运营需要,提前使provider_access_token失效,开发者应实现provider_access_token失效时重新获取的逻辑

func GetSuiteToken

func GetSuiteToken(corp token.Token, d data.D) (access.Token, error)

GetSuiteToken 获取第三方应用凭证 ticket suite_ticket 由于第三方服务商可能托管了大量的企业,其安全问题造成的影响会更加严重,故API中除了合法来源IP校验之外,还额外增加了suite_ticket作为安全凭证。 获取suite_access_token时,需要suite_ticket参数。suite_ticket由企业微信后台定时推送给“指令回调URL”,每十分钟更新一次,见推送suite_ticket。 suite_ticket实际有效期为30分钟,可以容错连续两次获取suite_ticket失败的情况,但是请永远使用最新接收到的suite_ticket。 通过本接口获取的suite_access_token有效期为2小时,开发者需要进行缓存,不可频繁获取。

func GetUserDetail3rd

func GetUserDetail3rd(api *token.Api, ticket string) (*structs.UserDetail3rd, error)

GetUserDetail3rd 获取访问用户敏感信息 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/service/auth/getuserdetail3rd?suite_access_token=SUITE_ACCESS_TOKEN

func GetUserInfo3rd added in v1.8.16

func GetUserInfo3rd(api *token.Api, code string) (*structs.UserInfo3rd, error)

GetUserInfo3rd 获取访问用户身份 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/service/auth/getuserinfo3rd?suite_access_token=SUITE_ACCESS_TOKEN&code=CODE

func LICActiveAccount added in v1.0.23

func LICActiveAccount(api *token.Api, corpId string, active ActiveCode) error

LICActiveAccount 激活帐号 下单购买帐号并支付完成之后,先调用获取订单中的帐号列表接口获取到帐号激活码,然后可以调用该接口将激活码绑定到某个企业员工,以对其激活相应的平台服务能力。 1. 一个userid允许激活一个基础帐号以及一个互通帐号。 2. 若userid已激活,使用同类型的激活码来激活后,则绑定关系变为新激活码,新激活码有效时长自动叠加上旧激活码剩余时长,同时旧激活码失效。 3. 为了避免服务商调用出错,多个同类型的激活码累加后的有效期不可超过5年,否则接口报错701030。 4.为了避免服务商调用出错,只有当旧的激活码的剩余使用小于等于20天,才可以使用新的同类型的激活码进行激活并续期 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/active_account?provider_access_token=ACCESS_TOKEN

func LICCancelOrder added in v1.8.12

func LICCancelOrder(api *token.Api, corpId, orderId string) error

LICCancelOrder 取消订单 取消接口许可购买和续费订单,只可取消未支付且未失效的订单。 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/cancel_order?provider_access_token=ACCESS_TOKEN

func LICCreateOrder added in v1.8.12

func LICCreateOrder(api *token.Api, order *LicenseOrder) (string, error)

LICCreateOrder 下单购买帐号 服务商下单为企业购买新的帐号,可以同时购买基础帐号与互通帐号。下单之后,需要到服务商管理端发起支付,支付完成之后,订单才能生效。 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/create_new_order?provider_access_token=ACCESS_TOKEN

func LICGetAutoActiveStatus added in v1.8.90

func LICGetAutoActiveStatus(api *token.Api, corpId string) (int, error)

LICGetAutoActiveStatus 查询企业的许可自动激活状态 服务商可以调用该接口查询授权企业的许可自动激活状态。 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/get_auto_active_status?provider_access_token=ACCESS_TOKEN

func LICSetAutoActiveStatus added in v1.0.23

func LICSetAutoActiveStatus(api *token.Api, corpId string, status int) error

LICSetAutoActiveStatus 设置企业的许可自动激活状态 设置企业的许可自动激活状态 服务商可以调用该接口设置授权企业的许可自动激活状态。设置为自动激活后,对应授权企业的员工使用服务商应用时,接口许可表现为自动激活。 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/set_auto_active_status?provider_access_token=ACCESS_TOKEN

func LICSubmitOrderJob added in v1.8.12

func LICSubmitOrderJob(api *token.Api, order *LicenseSubOrder) (string, error)

LICSubmitOrderJob 提交续期订单 创建续期任务之后,需要调用该接口,以提交订单任务。注意,提交之后,需要到服务商管理端发起支付,支付完成之后,订单才能生效。 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/submit_order_job?provider_access_token=ACCESS_TOKEN

func SetSessionInfo added in v1.8.5

func SetSessionInfo(api *token.Api, preAuthCode string, sessionInfo structs.SessionInfo) error

SetSessionInfo 设置授权配置 该接口可对某次授权进行配置。可支持测试模式(应用未发布时)。 请求方式:POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/service/set_session_info?suite_access_token=SUITE_ACCESS_TOKEN

Types

type ActivatedAccountResult added in v1.8.93

type ActivatedAccountResult struct {
	HasMore    int             `json:"has_more"`
	NextCursor string          `json:"next_cursor"`
	Accounts   []ActiveAccount `json:"account_list"`
}

func LICActivatedAccountList added in v1.8.12

func LICActivatedAccountList(api *token.Api, corpId string, cursor Cursor) (ActivatedAccountResult, error)

获取企业的帐号列表 最后更新:2023/04/27 查询指定企业下的平台能力服务帐号列表。 若为上下游场景,corpid指定的为上游企业,仅返回上游企业激活的账号;若corpid指定为下游企业,若激活码为上游企业分享过来的且已绑定,也会返回。 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/list_actived_account?provider_access_token=ACCESS_TOKEN

type ActiveAccount added in v1.8.93

type ActiveAccount struct {
	Userid     string `json:"userid"`      //账号绑定激活的企业成员userid,企业的成员userid。返回加密的userid
	Type       int    `json:"type"`        //激活码帐号类型:1:基础帐号,2:互通帐号
	ActiveTime int64  `json:"active_time"` //激活时间
	ExpireTime int64  `json:"expire_time"` //过期时间
}

type ActiveAccountDetail added in v1.8.93

type ActiveAccountDetail struct {
	ActiveCode string `json:"active_code"`
	Userid     string `json:"userid"`      //账号绑定激活的企业成员userid,企业的成员userid。返回加密的userid
	Type       int    `json:"type"`        //激活码帐号类型:1:基础帐号,2:互通帐号
	CreateTime int64  `json:"create_time"` //创建时间,订单支付成功后立即创建
	ActiveTime int64  `json:"active_time"` //激活时间
	ExpireTime int64  `json:"expire_time"` //过期时间
}

type ActiveAccountDetailResult added in v1.8.93

type ActiveAccountDetailResult struct {
	ActiveStatus int                   `json:"active_status"` // -1表示无效,账号激活状态。0:未激活、 1:已激活
	List         []ActiveAccountDetail `json:"active_info_list"`
}

func LICGetActiveByUser added in v1.0.23

func LICGetActiveByUser(api *token.Api, corpId, userId string) (ActiveAccountDetailResult, error)

LICGetActiveByUser 获取成员的激活详情 查询某个企业成员的激活情况。 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/get_active_info_by_user?provider_access_token=ACCESS_TOKEN return ActiveAccountDetailResult

type ActiveCode added in v1.0.23

type ActiveCode struct {
	ActiveCode string `json:"active_code"`
	Userid     string `json:"userid,omitempty"`
	Type       int    `json:"type,omitempty"`
}

type ActiveCodeDetail added in v1.8.94

type ActiveCodeDetail struct {
	ActiveCode string     `json:"active_code"`
	Userid     string     `json:"userid,omitempty"` //账号绑定激活的企业成员userid,未激活则不返回该字段。返回加密的userid
	Merge      *MergeInfo `json:"merge_info"`       //合并信息
	Share      *ShareInfo `json:"share_info"`       //分配信息
	Type       int        `json:"type"`             //激活码帐号类型:1:基础帐号,2:互通帐号
	Status     int        `json:"status"`           //账号状态 1: 未绑定 2: 已绑定且有效 3: 已过期 4: 待转移(企业开启自动激活时,成员离职或者被移出可见范围,第二天凌晨会更新为该状态) 5: 已合并(激活码本身激活了userid,后续使用新的激活码重新激活了该userid,则该码变为已合并状态。若被合并时,该激活码未过期则合并后会重置expire_time为合并时间。若被合并时,激活码已过期则不重置expire_time。注:该状态的激活码是已经失效的,不能重新用于激活或者继承。) 6: 已分配给下游
	CreateTime int64      `json:"create_time"`      //创建时间,订单支付成功后立即创建
	ActiveTime int64      `json:"active_time"`      //激活时间
	ExpireTime int64      `json:"expire_time"`      //过期时间
}

func LICActiveCodeDetail added in v1.0.23

func LICActiveCodeDetail(api *token.Api, corpId, activeCode string) (ActiveCodeDetail, error)

LICActiveCodeDetail 获取激活码详情 查询某个帐号激活码的状态以及激活绑定情况。 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/get_active_info_by_code?provider_access_token=ACCESS_TOKEN

type ActiveCodeDetailResult added in v1.8.93

type ActiveCodeDetailResult struct {
	List     []ActiveCodeDetail `json:"active_info_list"`
	Invalids []string           `json:"invalid_active_code_list"`
}

func LICBatchActiveCodeDetail added in v1.0.34

func LICBatchActiveCodeDetail(api *token.Api, corpId string, codes []string) (ActiveCodeDetailResult, error)

LICBatchActiveCodeDetail 批量获取激活码详情 批量查询帐号激活码的状态以及激活绑定情况。 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/batch_get_active_info_by_code?provider_access_token=ACCESS_TOKEN

type ActiveCodeResult added in v1.0.23

type ActiveCodeResult struct {
	ActiveCode string `json:"active_code"`
	Userid     string `json:"userid"`
	Errcode    int32  `json:"errcode"`
}

func LICBatchActiveAccount added in v1.0.23

func LICBatchActiveAccount(api *token.Api, corpId string, codes []ActiveCode) ([]ActiveCodeResult, error)

LICBatchActiveAccount 批量激活帐号 可在一次请求里为一个企业的多个成员激活许可帐号,便于服务商批量化处理。 1.一个userid允许激活一个基础帐号以及一个互通帐号。 2. 若userid已激活,使用同类型的激活码来激活后,则绑定关系变为新激活码,新激活码有效时长自动叠加上旧激活码剩余时长,同时旧激活码失效。 3. 为了避免服务商调用出错,多个同类型的激活码累加后的有效期不可超过5年,否则接口报错701030。 4.为了避免服务商调用出错,只有当旧的激活码的剩余使用小于等于20天,才可以使用新的同类型的激活码进行激活并续期 5. 单次激活的员工数量不超过1000 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/batch_active_account?provider_access_token=ACCESS_TOKEN

type AppLicense added in v1.0.23

type AppLicense struct {
	Status    int              `json:"license_status"`     //license检查开启状态。 0:未开启license检查状态(未迁移的历史授权的第三方应用(接入版本付费)或者未达到拦截时间的历史授权的的第三方应用(未接入版本付费)以及代开发应用) 1:已开启license检查状态。若开启且已过试用期,则需要为企业购买license账号才可以使用
	CheckTime int64            `json:"license_check_time"` //接口开启拦截校验时间。开始拦截校验后,无接口许可将会被拦截,有接口许可将不会被拦截。
	TrailInfo LicenseTrailInfo `json:"trail_info"`         //试用
}

func LICGetAppInfo added in v1.0.23

func LICGetAppInfo(api *token.Api, corpId, suiteId, appid string) (AppLicense, error)

LICGetAppInfo 获取应用的接口许可状态 服务商可获取某个授权企业的应用接口许可试用期,免费试用期为企业首次安装应用后的90天。 appid (旧的多应用套件中的应用id,新开发者请忽略) 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/get_app_license_info?provider_access_token=ACCESS_TOKEN

type Cursor added in v1.0.23

type Cursor struct {
	Limit  int    `json:"limit"`
	Cursor string `json:"cursor,omitempty"`
}

type LicenseAccount added in v1.8.17

type LicenseAccount struct {
	ActiveCode string `json:"active_code,omitempty"` //账号码,订单类型为购买账号时,返回该字段
	Userid     string `json:"userid,omitempty"`      //企业续期成员userid,订单类型为续期账号时,返回该字段。返回加密的userid
	Type       int    `json:"type"`                  //账号类型:1:基础账号,2:互通账号
}

type LicenseAccountListResult added in v1.8.17

type LicenseAccountListResult struct {
	HasMore     int              `json:"has_more"`
	NextCursor  string           `json:"next_cursor"`
	AccountList []LicenseAccount `json:"account_list"`
}

func LICOrderAccountList added in v1.8.12

func LICOrderAccountList(api *token.Api, orderId string, cursor Cursor) (*LicenseAccountListResult, error)

LICOrderAccountList 获取订单中的帐号列表 查询指定订单下的平台能力服务帐号列表。若为购买帐号的订单或者存量企业的版本付费迁移订单,则返回帐号激活码列表;若为续期帐号的订单,则返回续期帐号的成员列表。注意,若是购买帐号的订单,则仅订单支付完成时,系统才会生成帐号,故支付完成之前,该接口不会返回帐号激活码。 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/list_order_account?provider_access_token=ACCESS_TOKEN

type LicenseBuy added in v1.8.17

type LicenseBuy struct {
	SubOrderId       string                      `json:"sub_order_id"`
	CorpId           string                      `json:"corpid"`
	AccountCount     LicenseOrderAccountCount    `json:"account_count"`
	AccountDuration  LicenseOrderAccountDuration `json:"account_duration"`
	AutoActiveStatus int                         `json:"auto_active_status"`
}

type LicenseInvalidAccount added in v1.8.17

type LicenseInvalidAccount struct {
	Errcode int32  `json:"errcode"`
	Errmsg  string `json:"errmsg"`
	Userid  string `json:"userid"`
	Type    int    `json:"type"`
}

type LicenseOrder added in v1.8.17

type LicenseOrder struct {
	CorpId          string                      `json:"corpid"`
	BuyerUserId     string                      `json:"buyer_userid"`
	AccountCount    LicenseOrderAccountCount    `json:"account_count"`
	AccountDuration LicenseOrderAccountDuration `json:"account_duration"` //账号购买时长
}

type LicenseOrderAccountCount added in v1.8.17

type LicenseOrderAccountCount struct {
	BaseCount            int `json:"base_count"`             //基础账号个数
	ExternalContactCount int `json:"external_contact_count"` //互通账号个数
}

type LicenseOrderAccountDuration added in v1.8.17

type LicenseOrderAccountDuration struct {
	Months        int   `json:"months"`
	Days          int   `json:"days"`
	NewExpireTime int64 `json:"new_expire_time,omitempty"` //下单续期账号中指定新过期时间时返回
}

type LicenseOrderDetail added in v1.8.17

type LicenseOrderDetail struct {
	CorpId          string                      `json:"corpid"`
	OrderId         string                      `json:"order_id"`
	OrderType       int                         `json:"order_type"`   //订单类型,1:购买账号,2:续期账号,5:应用版本付费迁移订单,6:历史合同迁移订单
	OrderStatus     int                         `json:"order_status"` //订单状态,0:待支付,1:已支付,2:已取消(未支付,订单已关闭)3:未支付,订单已过期,4:申请退款中,5:退款成功,6:退款被拒绝,7:订单已失效(将企业从服务商测试企业列表中移除时会将对应测试企业的所有测试订单置为已失效)
	Price           int32                       `json:"price"`        //订单金额,单位分
	CreateTime      int64                       `json:"create_time"`
	PayTime         int64                       `json:"pay_time"`         //迁移订单不返回该字段
	AccountCount    LicenseOrderAccountCount    `json:"account_count"`    //订单的账号数
	AccountDuration LicenseOrderAccountDuration `json:"account_duration"` //账号购买时长
}

func LICGetOrderDetail added in v1.8.12

func LICGetOrderDetail(api *token.Api, orderId string) (*LicenseOrderDetail, error)

LICGetOrderDetail 获取订单详情 查询某个订单的详情,包括订单的状态、基础帐号个数、互通帐号个数、帐号购买时长等。注意,该接口不返回订单中的帐号激活码列表或者续期的帐号成员列表,请调用获取订单中的帐号列表接口以获取帐号列表。 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/get_order?provider_access_token=ACCESS_TOKEN

type LicenseOrderInfo added in v1.8.17

type LicenseOrderInfo struct {
	OrderId   string `json:"order_id"`
	OrderType int    `json:"order_type"` //1:购买账号 2:续期账号 5:历史企业迁移订单 8:多企业新购订单(只返回父订单,且仅当corpid不填时返回)
}

type LicenseOrderListResult added in v1.8.17

type LicenseOrderListResult struct {
	NextCursor string             `json:"next_cursor"`
	HasMore    int                `json:"has_more"`
	OrderList  []LicenseOrderInfo `json:"order_list"`
}

func LICGetOrderList added in v1.8.12

func LICGetOrderList(api *token.Api, cond *LicenseOrderListSearch) (*LicenseOrderListResult, error)

LICGetOrderList 获取订单列表 服务商查询自己某段时间内的平台能力服务订单列表 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/list_order?provider_access_token=ACCESS_TOKEN

type LicenseOrderListSearch added in v1.8.17

type LicenseOrderListSearch struct {
	CorpId    string `json:"corpid"`
	StartTime int64  `json:"start_time,omitempty"`
	EndTime   int64  `json:"end_time,omitempty"`
	Cursor
}

type LicenseReOrder added in v1.8.17

type LicenseReOrder struct {
	CorpId      string           `json:"corpid"`
	JobId       string           `json:"jobid,omitempty"`
	AccountList []LicenseAccount `json:"account_list"`
}

type LicenseReOrderResult added in v1.8.17

type LicenseReOrderResult struct {
	//任务id,请求包中未指定jobid时,会生成一个新的jobid返回
	JobId string `json:"jobid"`
	//不合法的续期账号列表
	InvalidAccountList []LicenseInvalidAccount `json:"invalid_account_list"`
}

func LICCreateNewOrderJob added in v1.8.12

func LICCreateNewOrderJob(api *token.Api, buyList []LicenseBuy, JobId string) (*LicenseReOrderResult, error)

LICCreateNewOrderJob 创建多企业新购任务

func LICCreateRenewOrderJob added in v1.8.12

func LICCreateRenewOrderJob(api *token.Api, order *LicenseReOrder) (*LicenseReOrderResult, error)

LICCreateRenewOrderJob 创建续期任务 在同一个订单里,首次创建任务无须指定jobid,后续指定同一个jobid,表示往同一个订单任务追加续期的成员。 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/create_renew_order_job?provider_access_token=ACCESS_TOKEN

type LicenseShareActiveCode added in v1.8.90

type LicenseShareActiveCode struct {
	FromCorpId string       `json:"from_corpid"`
	ToCorpId   string       `json:"to_corpid"`
	ShareList  []ActiveCode `json:"share_list"`
}

type LicenseShareResult added in v1.8.90

type LicenseShareResult struct {
	ActiveCode string `json:"active_code"`
	Errcode    int32  `json:"errcode"`
	Errmsg     string `json:"errmsg"`
}

func LICBatchShareActiveCode added in v1.0.23

func LICBatchShareActiveCode(api *token.Api, share *LicenseShareActiveCode) ([]LicenseShareResult, error)

LICBatchShareActiveCode 分配激活码给下游企业 服务商可调用该接口将为上游企业购买的激活码分配给下游企业使用。 (1) 上游企业有共享该服务商的应用给下游企业,应用包括第三方应用和代开发应用 (2) 分配给下游企业的激活码,当前未激活,且属于上游企业的,且未分配给其他下游企业 (3) 分配的激活码帐号数的上限,单次分享激活码不可超过1000个, 不能超过下游企业在上下游通讯录中人数上限的两倍 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/batch_share_active_code?provider_access_token=ACCESS_TOKEN

type LicenseSubOrder added in v1.8.17

type LicenseSubOrder struct {
	JobId           string                      `json:"jobid"`
	BuyerUserid     string                      `json:"buyer_userid"`
	AccountDuration LicenseOrderAccountDuration `json:"account_duration"`
}

type LicenseTrailInfo added in v1.8.90

type LicenseTrailInfo struct {
	StartTime int64 `json:"start_time"`
	EndTime   int64 `json:"end_time"`
}

type LicenseTransfer added in v1.8.90

type LicenseTransfer struct {
	HandoverUserid string `json:"handover_userid"`
	TakeoverUserid string `json:"takeover_userid"`
}

type LicenseTransferResult added in v1.8.90

type LicenseTransferResult struct {
	HandoverUserid string `json:"handover_userid"`
	TakeoverUserid string `json:"takeover_userid"`
	Errcode        int32  `json:"errcode"`
}

func LICBatchTransfer added in v1.0.23

func LICBatchTransfer(api *token.Api, corpId string, transfer []LicenseTransfer) ([]LicenseTransferResult, error)

LICBatchTransfer 帐号继承 在企业员工离职或者工作范围的有变更时,允许将其许可帐号继承给其他员工。 调用限制: 转移成员和接收成员属于同一个企业 转移成员的帐号已激活,且在有效期 转移许可的成员为离职成员,或不在服务商应用的可见范围内时,不限制下次转移的时间间隔 转移许可的成员为在职成员且在服务商应用的可见范围内时,转移后30天后才可进行下次转移 接收成员许可不能与转移成员的许可重叠(同时拥有基础帐号或者互通帐号) 单次转移的帐号数限制在1000以内 请求方式: POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/license/batch_transfer_license?provider_access_token=ACCESS_TOKEN return []LicenseTransferResult

type LicenseUnionOrderResult added in v1.8.17

type LicenseUnionOrderResult struct {
	Order      LicenseOrderDetail `json:"order"`
	HasMore    int                `json:"has_more"`
	NextCursor string             `json:"next_cursor"`
	BuyList    []LicenseBuy       `json:"buy_list"`
}

func LICGetUnionOrder added in v1.8.12

func LICGetUnionOrder(api *token.Api, orderId string, cursor Cursor) (*LicenseUnionOrderResult, error)

LICGetUnionOrder 获取多企业订单详情

type MergeInfo added in v1.0.23

type MergeInfo struct {
	ToActiveCode   string `json:"to_active_code"`
	FromActiveCode string `json:"from_active_code"`
}

type ShareInfo added in v1.8.12

type ShareInfo struct {
	ToCorpId   string `json:"to_corpid"`
	FromCorpId string `json:"from_corpid"`
}

Jump to

Keyboard shortcuts

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