# Update Cloud Function Code
Interface should be called on the server side, seeHattori API。
# 初始值
# Interface name
uploadCloudFunctionCode
# Functional description
Batch update of cloud function code via this interface
# Calling mode
# HTTPS call
POST https://api.weixin.qq.com/componenttcb/batchuploadscfcode?access_token=ACCESS_TOKEN
# Request parameters
attribute | type | Required | Introductions |
---|---|---|---|
access_Token | string | yes | Interface invokes the certificate, which is URL Parameters, non Body Parameters. usecomponent_access_Token |
functionname | string | yes | Function name |
envs | array | yes | Environment ID |
zipfile | string | yes | Containing the function code file zip Format file, using this interface requires that the zip The contents of the document into base64 Coding, maximum support 20 M (cloud development automatic upload cloud dependency, no need to manually upload) |
# Return parameters
attribute | type | Introductions | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
errcode | number | Return code | |||||||||||||
errmsg | string | Error message | |||||||||||||
fail_list | array | List of failures | |||||||||||||
|
# Other Notes
- When zipfile is packaged, select the function code file you want to package directly, and do not package the folder in a folder.
# Call Example
Example Dxplaination: HTTPS requests
# Sample Request Data
{
"functionname": "testfunc",
"envs": ["dev-3gewtf9c10f60c76", "mytestenv-7gniuaq95b51dcdc", "mytestenv-7gniuaq95b51dcdc22"],
"zipfile": "UEsDBBQACAAIALB WU4AAAAAAAAAAAAAAAAIABAAaW5kZXguanNVWAwAAZ9zXPuec1z1ARQAdY7BCsIwEETv Yoll6ZQ wOhnv0DD IhxkWC664kWwmI/27V3IpzGuYNw3RzQSiaU9TOG6x3yVrGW0gMEzh8IOsAUVixfkwgOoV47WHawtPAooUVIRxJLs7ukEhgL5nOtl/h79qf GBZeIM1FbXHdac9aKC9cDwTDfCb9eblzRtQSwcI6 pcr4AAAADOAAAAUEsBAhUDFAAIAAgAsH5ZTuvqXK AAAAAzgAAAAgADAAAAAAAAAAAQKSBAAAAAGluZGV4LmpzVVgIAAGfc1z7nnNcUEsFBgAAAAABAAEAQgAAAMYAAAAAAA=="
}
# Return Data Example
{
"errcode": 0,
"errmsg": "ok"
}
# Error code
Error code | Error code | Solutions |
---|---|---|
40014 | invalid 初始值_Token | Illegal access_Token Please take the developer seriously. access_Token Of the validity (such as whether it is expired), or to see if you are working for the appropriate Official Account message template Call interface |
40101 | missing parameter | Missing required parameters |
41001 | access_Token missing | lack access_Token parameter |