Skip to content

WeChat Official Account Authorization Login

API Address:/v2/enduser/enduserapi/wechatOffiaccountAuthLogin

Request Method:POST

Request Data Type:application/json

Response Data Type:*/*

API Description:WeChat Official Account Authorization Login

Request Parameters:

Parameter NameParameter DescriptionRequest TypeRequiredData TypeSchema
appIdOfficial account unique identifierquerytruestring
codeCode obtained after user authorizationquerytruestring
signatureSignature
SHA256(appId+code+userDomainSecret)
querytruestring
userDomainUser domainquerytruestring
mccMCCqueryfalseinteger(int32)

Response Status:

Status CodeDescriptionSchema
200Login successful, token returned in dataReturn registration code response data«Login returned token»
5013User domain format incorrect
5015User domain does not exist
5023Please enter user domain
5104User domain has been disabled
5218Please enter appid
5367Exception in requesting user OpenID
5368Failed to get user OpenID
5369Failed to parse user OpenID
5372Please enter code
6084MCC does not belong to current data center
6085Failed to query data center for MCC

Response Parameters:

Parameter NameParameter DescriptionTypeSchema
codeResponse status codeinteger(int32)integer(int32)
dataResponse dataLogin returned tokenLogin returned token
  accessTokenInterface access tokentokentoken
    expirationTimeExpiration timestamp in seconds. Token becomes invalid after expiration time.integer
    tokentokenstring
  refreshTokenRefresh tokentokentoken
    expirationTimeExpiration timestamp in seconds. Token becomes invalid after expiration time.integer
    tokentokenstring
extMsgExtended messagestring
msgResponse messagestring

Response Example:

javascript
{
	"code": 0,
	"data": {
		"accessToken": {
			"expirationTime": 0,
			"token": ""
		},
		"refreshToken": {
			"expirationTime": 0,
			"token": ""
		}
	},
	"extMsg": "",
	"msg": ""
}