# Creating Cloud Functions

Debugging tools

Interface should be called on the server side, seeHattori API

# Interface Dxplaination

# Interface name

batchuUloadCloudFunction

# Functional description

Through this interface you can create cloud functions in batches, if you encounter problems in the process, you canOpen Platform Service Provider ZonePosting exchanges.

# Note

  • When zipfile is packaged, select the function code file you want to package directly, and do not package the folder in a folder. image.png

# Calling mode

# HTTPS call


POST https://api.weixin.qq.com/componenttcb/batchuploadscf?access_token=ACCESS_TOKEN 

# Request parameters

attribute type Required Introductions
access_Token string yes Interface invokes the certificate, which is URL 初始值 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 Encoding, up to 20 M (Cloud development automatically uploads cloud dependencies, no need to manually upload)
vpcid string no VPC Unique Identity
subnetid string no Subnet id

# Return parameters

attribute typeIntroductions
errcode number Return code
errmsg string Error message
fail_env_list array List of failures
attribute type Introductions
env string Environment id
errmsg string Error message

# Call Example

Example Dxplaination: HTTPS Request Example

# 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
85088 no qbase privilege The app is not open for cloud development
47001 data format error analysis JSON/XML Content errorpost Missing parameters in the dataCheck for corrections and try again.
44002 empty post data POST Of the packet is empty. The post request body parameter cannot be null.
43002 require POST method Need POST request
42001 access_Token expired access_Token Timeout, please check access_Token Of the validity period, please refer to the Basic Support - Obtain access_Token Middle, right. access_Token Detailed mechanism explaination of the
41001 access_Token missing lack access_Token parameter
40101 missing parameter Missing required parameters
40097 invalid args Parameter error
40014 invalid access_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
-1 system error The system is busy, please wait for the developer to try again