##Adding the Draft to the Code Template Library

You can obtain the draft ID by Obtaining All Drafts from the Draft Box. This API allows you to select a temporary draft as a permanent code template.

# Request Address

POST https://api.weixin.qq.com/wxa/addtotemplate?access_token=TOKEN

# Request Parameters

Parameter Type Required Description
access_token String Yes Third-party platform's token component_access_token
draft_id String Yes Draft ID

POST data example

{
  "draft_id": 0
}

# Response Parameters

Parameter Type Description
errcode Number Error code
errmsg String Error message

Example of returned result

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

# Error Code

Error Code Description
-1 The system is busy.
85064 No draft is found.
85065 The template library reaches the maximum value.