batchDownloadFile

View Markdown

Last edited on 2026-07-05

This API should be called on the server side. For detailed instructions, refer to Server API.

Retrieves file download links.

Request URL

POST https://api.weixin.qq.com/tcb/batchdownloadfile?access_token=ACCESS_TOKEN

Request Parameters

Attribute Type Default Value Required Description
access_token / cloudbase_access_token string Yes API call credential
env string Yes Cloud Environment ID
file_list Array.<Object> Yes File list

file_list Structure

Attribute Type Default Value Required Description
fileid string Yes File ID
max_age number Yes Download link expiration

Return Value

Object

Returned JSON data packet

Property Type Description
errcode number Error code
errmsg string Error message
file_list Array.<Object> File list

Valid values for errcode

Value Description Minimum Version
0 Request successful
-1 System error
-1000 System error
40014 Invalid AccessToken
40097 Invalid request parameters
40101 Missing required parameters
41001 Missing AccessToken
42001 AccessToken expired
43002 HTTP METHOD error
44002 POST BODY is empty
47001 POST BODY format error
85088 Cloud Development is not enabled for this app
Other error codes Cloud Development Error Codes

Structure of file_list

Property Type Description
fileid string File ID
download_url string Download link
status number Status code
errmsg string Error message for this file

Request Data Example

{
	"env": "test2-4a89da",
	"file_list": [
		{
			"fileid":"cloud://test2-4a89da.7465-test2-4a89da/A.png",
			"max_age":7200
		}
		]
}

Return Data Example

{
    "errcode": 0,
    "errmsg": "ok",
    "file_list": [
        {
            "fileid": "cloud://test2-4a89da.7465-test2-4a89da/A.png",
            "download_url": "https://7465-test2-4a89da-1258717764.tcb.qcloud.la/A.png",
            "status": 0,
            "errmsg": "ok"
        }
    ]
}