# Get Refresh Token

Debugging tools

Interface should be called on the server side, seeHattori API

# Interface Dxplaination

# Interface name

getAuthorizerRefreshToken

# Functional description

  • After the user has completed the authorization process in the third party platform authorization page, the third party platform developer can call back URI Adopted in URL Parameters to obtain authorization code(authorization_code)The interface can then be used in exchange for Official Account message template/The refresh token of the Mini Program_refresh_token)。
  • It is recommended to save the refresh token in the authorization information authorizer_refresh_If you encounter problems during the use of the token, you canOpen Platform Service Provider ZonePosting exchanges

# Note

  • Official Account message template/Mini Programs can be customized to select some permissions granted to third-party platforms, so third-party platform developers need to use this interface to obtain Official Account message template/The Mini Program specifically authorizes what permissions, rather than simply thinking that the permissions it declares are Official Account message template/The permissions granted by the Mini Program.

# Calling mode

# HTTPS call


POST https://api.weixin.qq.com/cgi-bin/component/api_query_auth?access_token=ACCESS_TOKEN 

# Request parameters

attribute type Required Introductions
access_Token string yes Interface invokes the certificate, which is URL Parameters, non Body Parameters. usecomponent_access_Token
component_appid string yes Third-Party Platforms appid
authorization_code string yes The authorization code, Will be returned to the third party platform when the authorization is successful, seeThird Party Platform Authorization Process DxplainationThis parameter can also be pushed through the platform's"Authorization Change Notice"Get.

# Return parameters

attribute typeIntroductions
authorization_info object Authorization Information
attribute type Introductions
authorizer_appid string Authorized Official Account message template Or Mini programs. appid
authorizer_access_Token string Interface to invoke the token (in the authorized Official Account message template/Small programs have API This return value is only possible if you have permission to do so.
expires_in number authorizer_access_Token The validity period of the Official Account message template/Mini Program with API permissions, only this return value), unit: seconds
authorizer_refresh_Token string Refresh Token (this return value is only available if the authorized Official Account message template has API permissions), which is primarily used by a third-party platform to obtain and refresh an authorized user's authorizer_access_token。 Once lost, the user can only be re-authorized to get a new refresh token again. When the user reauthorizes, the previous refresh token will expire
func_info array A list of permission set IDs that are authorized to a third-party platform, and the meaning of the permission set IDs can be viewedIntroduction to Permission Sets
attribute type Introductions
funcscope_category object Details of the permission set granted to the developer
attribute type Introductions
id number Permission set id
type number Permission Set Type
name string Permission Set Name
desc string Permission Set Description

# Call Example

Example Dxplaination: HTTPS requests

# Sample Request Data


{
"component_appid":"appid_value" ,
"authorization_code": "auth_code_value"
} 

# Return Data Example


{
  "authorization_info": {
    "authorizer_appid": "wxf8b4f85f3a794e77",
    "authorizer_access_token": " QXjUqNqfYVH0yBE1iI_7vuN_9gQbpjfK7hYwJ3P7xOa88a89-Aga5x1NMYJyB8G2yKt1KCl0nPC3W9GJzw0Zzq_dBxc8pxIGUNi_bFes0qM",
    "expires_in": 7200,
    "authorizer_refresh_token": "dTo-YCXPL4llX-u1W1pPpnp8Hgm4wpJtlR6iV0doKdY",
    "func_info": [
      {
        "funcscope_category": {
          "id": 1
        }
      },
      {
        "funcscope_category": {
          "id": 2
        }
      },
      {
        初始值_category": {
          "id": 3
        }
      }
    ]
  }
} 

# Error code

Error code Error code Solutions
-1 system error The system is busy, please wait for the developer to try again
40001 invalid credential  access_Token isinvalid or not latest Obtain access_Token time AppSecret Error, or access_Token Invalid. Please take the developer more seriously. AppSecret Of the correctness, or to see if you are working for the appropriate Official Account message template Call interface
40013 invalid appid Illegal AppID , ask the developer to check AppID The correctness of the, avoid unusual characters, pay attention to the case
0 ok ok