# getQcloudToken
Call this API at the server side. For more information, see Server API.
Gets the credentials to call APIs on Tencent Cloud. Tencent Cloud API Overview
# Request Address
POST https://api.weixin.qq.com/tcb/getqcloudtoken?access_token=ACCESS_TOKEN
# Request Parameters
Attribute | Type | Default | Required | Description |
---|---|---|---|---|
access_token | string | Yes | Credentials to call API | |
lifespan | number | Yes | Validity period (sec). 7,200 sec is the maximum. |
# Return Value
# Object
JSON data package that is returned
Attribute | Type | Description |
---|---|---|
errcode | number | Error code |
errmsg | string | Error message |
secretid | string | secretid |
secretkey | string | secretkey |
token | string | token |
expired_time | number | Expiration timestamp |
Valid values of errcode
Value | Description | Minimum Version |
---|---|---|
0 | Request successful | |
-1 | System Error | |
-1000 | System Error | |
40014 | Invalid AccessToken | |
40097 | Invalid request parameter | |
40101 | Required parameter missing | |
41001 | AccessToken missing | |
42001 | AccessToken expired | |
43002 | HTTP METHOD error | |
44002 | Empty POST BODY | |
45009 | Frequency limit. Try again one hour later. | |
47001 | Incorrect format of POST BODY | |
85088 | Cloud Base is not enabled on this App | |
Other error codes | Cloud Base error codes |
# Frequency Limit
This API has a frequency limit of 10 times per hour.
# Request Data Example
{
"lifespan" : 7200
}
# Return Data Example
{
"errcode": 0,
"errmsg": "ok",
"secretid": "SECRETID",
"secretkey": "SECRETKEY",
"token": "TOKEN",
"expired_time": 1557310488
}
Instructions to call Tencent Cloud APIs
- The credentials exchanged for this API can only be used for the APIs listed in Tencent Cloud API Overview.
- For the information on how to use the calling credentials, see Tencent Cloud Common Parameters.