Get File Upload Link

Last edited on 2026-03-16

This API should be called on the server side and cannot be called directly on the client side (Mini Program, web page, APP, etc.). For details, please refer to API Call Guide.

API English Name: getUploadTcbFileLink

You can obtain a file upload link via this API. If you encounter any issues, you can post your questions in the Open Platform Service Provider Zone to discuss with the community.

1. Call Method

HTTPS Call

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

Cloud Call

  • This API does not support cloud call.

Third-party Call

  • This API supports third-party platforms on behalf of Merchant call.

  • The permission set ID of this API is: 49

  • After the service provider obtains one of the permission set authorizations, it can use authorizer_access_token to call on behalf of Merchant, for details please refer to Third-party Call documentation.

2. Request Parameters

Query Parameters Query String Parameters

ParameterTypeRequiredDescription
access_tokenstringYesAPI call credential, you can use access_token, authorizer_access_token

Request Body Request Payload

ParameterTypeRequiredDescription
envstringYesCloud Environment ID
pathstringYesUpload Path

3. Response Parameters

Response Body Response Payload

ParameterTypeDescription
errcodenumberError Code
errmsgstringError Message
urlstringUpload URL
tokenstringtoken
authorizationstringauthorization
file_idstringFile ID
cos_file_idstringCOS File ID

4. Notes

No special notes for this API

5. Code Example

Request Example

{
  "env": "test2-4a89da",
  "path": "this/is/a/example/file.path"
}

Response Example

{
  "errcode": 0,
  "errmsg": "ok",
  "url": "https://cos.ap-shanghai.myqcloud.com/7465-test2-4a89da-1258717764/testupload",
  "token": "Cukha70zkXIBqkh1OhUIFqjUmXLXeSWq7dff61099221bb270522b8e0cf21d72e0aWCfGXEIDT5bKVJgykFFr9_MeQ-ExrsZ8oiFdMwyYag8h0r-EJq_EaO94KzksxH6bAeb4Y7SwZjJqoy_4g1Na797F1IEG9Dnstm_rz02AgaP5HbJwt1P-XHT4Xjw_lafla079gtQKAP-EPbE5Tc8BRXIm32esjGDDDuDyml7IJqbsPolYZ4-CHQsisdx488loGAN4f7YRMkrrP1Pgi5XOm0-iG5HbWd3tHtuE2pzsGkTobO_fyz2PfSPaeUt_735ll38yIWpAFESAsZnBj2DcRSPBT2FJ_s5mOZACS53q6-tWXPO0AR3-EhOCQpiDKsldVsCxz00Uwhgm1T6Ozw777fJEFkUIngUdZ5yajy3LA84Mpfu6CLkFjfiBtz3wpmcCQxhijo_CrVHkmaMc2JBQ",
  "authorization": "q-sign-algorithm=sha1&q-ak=AKID98EDB528Sfqerp0Z_7l23we-u4Avrx04te9VvlzGihMTseysMgu7iSdh_hxEnoAy&q-sign-time=1557307130;1557308030&q-key-time=1557307130;1557308030&q-header-list=&q-url-param-list=&q-signature=ac95227b67a04157bb5e49b435c6ac3ce88e03f2",
  "file_id": "cloud://test2-4a89da.7465-test2-4a89da-1258717764/testupload",
  "cos_file_id": "HDze32/qZENCwWi5N5akgoXSv3U8DsccKaqCxTMGs0zFgvlD28j484/VYFPJ1l2QDh0Qy8wNbQCpxs5zEsLJln1lIY9RGYn1LzRQQQYFQm+Xwvw6S4YEZN1AIwY906mwIBgiI3gKGkU2K1+1ZEnEYEM4Uh/C1JxB4Q=="
}

6. Error Codes

The following is the error code list of this API, other error codes can refer to Common Error Codes; When encountering errors in calling the API, you can use the official API Diagnostic Tool to assist in locating and analyzing problems.

Error CodeError DescriptionSolution
-1000system errorSystem Error
-1system errorSystem is busy. Please try again later.
0okok
40001invalid credential  access_token isinvalid or not latestAppSecret is incorrect, or the access_token is invalid when obtaining access_token. Developers should carefully verify the correctness of the AppSecret or check if they are calling the API for the correct Official Account.
40014invalid access_tokenInvalid access_token. Developers should carefully verify the validity of the access_token (e.g., whether it has expired) or check if they are calling the API for the correct Official Account.
40097invalid argsParameter Error
40101missing parameterMissing Required Parameter
41001access_token missingMissing access_token Parameter
43002require POST methodPOST Request Required
44002empty post dataPOST Data Package is Empty
47001data format errorError parsing JSON/XML content; missing parameters in POST data. Check, correct, and retry.
85088no qbase privilegeCloud Development has not been enabled for this app.

7. Applicable Scope

This API supports 「Third-party Platform」 account type for proxy calls. For permission sets, please refer to the "Call Method" section. Other account types cannot call unless otherwise specified.