tencent cloud

DescribeStorageCredential
Last updated: 2025-10-30 21:48:55
DescribeStorageCredential
Last updated: 2025-10-30 21:48:55

1. API Description

Domain name for API request: lke.intl.tencentcloudapi.com.

This API is used to get the temporary key for file upload.

A maximum of 100 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: DescribeStorageCredential.
Version Yes String Common Params. The value used for this API: 2023-11-30.
Region Yes String Common Params. For more information, please see the list of regions supported by the product. This API only supports: ap-jakarta.
BotBizId No String Application ID. The parameter still needs to be filled in. Different combinations of parameters will result in different permissions. For details, see https://www.tencentcloud.com/document/product/1759/116238?from_cn_redirect=1.
FileType No String File type, normal file name type suffixes, such as xlsx, pdf, docx, png, etc.
IsPublic No Boolean This parameter is used to select a scenario when uploading a file or an image. When uploading an image in a chat, "Ispublic" is "true." When uploading a file (including files in the document library, images, etc. and files in a chat), "Ispublic" is "false."
TypeKey No String Storage type: offline - offline file; realtime - real-time file. If empty, it defaults to offline.

3. Output Parameters

Parameter Name Type Description
Credentials Credentials Key information.
ExpiredTime Integer Expiration time.
StartTime Integer Start time.
Bucket String Cloud object storage bucket.
Region String COS availability zone.
FilePath String Cloud file storage directory.
Type String Storage type.
CorpUin String Primary account.
ImagePath String Image storage directory.
UploadPath String Upload storage path to a specific file.
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Get the COS Upload Key

Input Example

POST / HTTP/1.1
Host: lke.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeStorageCredential
<Common request parameters>

{
    "BotBizId": "1727231073371148288"
}

Output Example

{
    "Response": {
        "Bucket": "qidian-qbot-test-1251316161",
        "CorpUin": "0",
        "Credentials": {
            "TmpSecretId": "***************************************************",
            "TmpSecretKey": "***************************************************",
            "Token": "***************************************************"
        },
        "ExpiredTime": 1701429243,
        "FilePath": "/corp/137/doc/",
        "Region": "ap-guangzhou",
        "RequestId": "87d578f9-6de5-4515-906e-d28e56d33fe0",
        "StartTime": 1701425643,
        "Type": "cos"
    }
}

Example2 Get Document Upload Key

Offline documents.

Input Example

POST / HTTP/1.1
Host: lke.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeStorageCredential
<Common request parameters>

{
    "BotBizId": "1779863007508561920",
    "FileType": "md",
    "TypeKey": "offline"
}

Output Example

{
    "Response": {
        "Bucket": "qidian-qbot-test-1251316161",
        "CorpUin": "0",
        "Credentials": {
            "TmpSecretId": "*****************************************",
            "TmpSecretKey": "***************************************",
            "Token": "*******************************************************"
        },
        "ExpiredTime": 1717063483,
        "FilePath": "",
        "ImagePath": "",
        "Region": "ap-guangzhou",
        "RequestId": "11b8fa96-4700-4f11-8eb0-421de37ed48d",
        "StartTime": 1717062883,
        "Type": "cos",
        "UploadPath": "/corp/1737374499879124992/1779863007508561920/doc/QUiGRdWFAFBkDKjhuxbd-1796118032488595456.md"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation Operation failed.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback