# Get Preauthorization Code
Interface should be called on the server side, seeHattori API。
# Interface Dxplaination
# Interface name
getPreAuthCode
# Functional description
This interface is used to obtain a preauthorization code_auth_Code) is the necessary information for the third party platform to achieve authorization hosting, and each pre-authorization code is valid for 1800 seconds. If you encounter problems during use, you canOpen Platform Service Provider ZonePosting exchanges.
# Calling mode
# HTTPS call
POST https://api.weixin.qq.com/cgi-bin/component/api_create_preauthcode?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 |
# Return parameters
attribute | type | Introductions |
---|---|---|
pre_auth_code | string | Preauthorization code |
expires_in | number | Duration, in seconds |
# Call Example
Example Dxplaination: HTTPS requests
# Sample Request Data
{
"component_appid": "appid_value"
}
# Return Data Example
{
"pre_auth_code": "Cx_Dk6qiBE0Dmx4EmlT3oRfArPvwSQ-oa3NL_fwHM7VI08r52wazoZX2Rhpz1dEw",
"expires_in": 600
}
# 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 |
61004 | access clientip is not registered | Third-party platform export IP is not set |
61005 | component ticket is expired | |
41004 | appsecret missing | lack secret parameter |
40125 | invalid appsecret view more at http://t.cn/RAEkdVq | Invalid appsecret |
61006 | component ticket is invalid | |
61011 | invalid component | |
45009 | reach max api daily quota limit | The call exceeded the day-level frequency limit. Callable clear_The quota interface restores the invocation quota. |
47001 | data format error | analysis JSON/XML Content errorpost Missing parameters in the dataCheck for corrections and try again. |
48001 | api unauthorized | api Function is not authorized, please confirm Official Account message template Have obtained the interface, can be in the public platform official website - View interface permissions in the Developer Center page |
42001 | access_Token expired | access_Token Timeout, please check access_Token Of the validity period, please refer to the Basic Support - Obtain access_Token Middle, right. access_Token Detailed mechanism explaination of the |
41001 | access_Token missing | lack access_Token parameter |