# Add a draft to the Template Gallery

Debugging tools

Interface should be called on the server side, seeHattori API

# Interface Dxplaination

# Interface name

addToTemplate

# Functional description

This interface is used to add drafts to the template library to set as persistent code templates. If you encounter problems during the use, you can openPlatform Service Provider ZonePosting exchanges.

# Calling mode

# HTTPS call


POST https://api.weixin.qq.com/wxa/addtotemplate?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
draft_id number yes draft ID
template_type number no The default value is 0, corresponding to the normal templateOptional 1, corresponding to the standard template library, the difference between the standard template library and the ordinary template library can be viewedIntroduction to Mini Program Template Library

# Return parameters

attribute type Introductions
errcode number Error code
errmsg string Error message

# Call Example

Example Dxplaination: HTTPS Request Example

# Sample Request Data


{
  "draft_id": "1"
} 

# Return Data Example


{
  "errcode": 0,
  "errmsg": "ok"
} 

# Error code

Error code Error code Solutions
-1 system error The system is busy, please wait for the developer to try again
40001 invalid credential  access_Token isinvalid or not latest Obtain access_Token time AppSecret Error, or access_Token Invalid. Please take the developer more seriously. AppSecret Of the correctness, or to see if you are working for the appropriate Official Account message template Call interface
85064 template not found Template not found
85065 template list is full Template library is full