# Token
Token (component_access_token) is the credential a third-party platform uses to call APIs. Each token is valid for 2 hours, so you must manage it well and call the API again to get a new token before expiration (e.g., at 1 hour 50 minutes).
Unless otherwise specified, the token is generally used as the value of the GET parameter component_access_token of the called API.
# Request Address
POST https://api.weixin.qq.com/cgi-bin/component/api_component_token
# Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
component_appid | string | Yes | Third-party platform's AppID |
component_appsecret | string | Yes | Third-party platform's appsecret |
component_verify_ticket | string | Yes | The ticket pushed by the Weixin backend |
POST data example:
{
"component_appid": "appid_value" ,
"component_appsecret": "appsecret_value",
"component_verify_ticket": "ticket_value"
}
# Parameters of Returned Result
Parameter | Type | Description |
---|---|---|
component_access_token | string | Third-party platform's access_token |
expires_in | number | Validity period (in sec) |
Example of returned result
{
"component_access_token": "61W3mEpU66027wgNZ_MhGHNQDHnFATkDa9-2llqrMBjUwxRSNPbVsMmyD-yq8wZETSoE5NQgecigDrSHkPtIYA",
"expires_in": 7200
}