# Draft box switching settings

Debugging Tools

Interface should be called on the server side, not in the front end (Weixin Mini Program, web pages, APP, etc.) directly called, specific reference interface call guide

Interface name: draft_switch

This interface is used to set or query the switching status of draft boxes and release functions.

  1. The volume will be gradually released during the internal testing, and any user may open it automatically;
  2. This switch is irreversible after it is turned on, in other words, it cannot go from an opened state to a closed one;
  3. During the beta, whether the switch is on or not, the old version of the graphic material API, and the new version of the draft box, release and other APIs can be used normally;
  4. After the end of the beta, all users will automatically open, that is, the draft box, release and other functions will be open to all users, the switch together with the previous graphic material API will be subsequently offline.

# Other Notes

Since the Draft Box and Publishing feature are still in private beta, you may not be able to experience the Draft Box and Publishing feature if Official Account is not covered by gray.In order to solve this problem, we set up a switch based on the above API: When an Official Account message template is selected,The account in WeChat public platform backstage (mp.weixin.qq.com) will be upgraded to draft box, and you can use the WeChat Official Platform backstage release function.

# 1. How to call

# HTTPS calls

POST https://api.weixin.qq.com/cgi-bin/draft/switch?access_token=ACCESS_TOKEN&checkonly=CHECKONLY

# Cloud Calls

  • This interface does not support cloud calls

# Third party invocation

  • This interface supports Third Party Platform generation business call.

  • The permission set to which this interface belongs is: 11,100

  • When a service provider is authorized by one of the permissions set, it can call on behalf of the merchant by using authorizer_access_token , which can be viewed in the third-party call documentation.

# 2. Request parameters

# Query parametersQuery String parameters

Parameter NametypeRequired to fill inExampleIntroductions
access_tokenstringyesACCESS_TOKENInterface invocation credentials, using access_token , authorizer_access_token
checkonlynumberno1Pass 1 only when checking the status

# Request BodyRequest Payload

nothing

# 3. Return Parameters

# Response Payload

Parameter NametypeIntroductions
errcodenumberError code
errmsgstringError message
is_opennumberReturns only when errcode = = 0 (that is, the call is successful), 0 means the switch is off, 1 means the switch is on (or the switch is on)

# 4. Note

There are no special considerations for this interface

# 5. Code examples

# 5.1 Set the switch state

Example Requests

https://api.weixin.qq.com/cgi-bin/draft/switch?access_token=ACCESS_TOKEN

Return an example

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

# 5.2 Query the status of the switch

Example Requests

https://api.weixin.qq.com/cgi-bin/draft/switch?access_token=ACCESS_TOKEN&checkonly=1

Return an example

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

# 6. Error code

The following is a list of error codes for this interface, other error codes can refer to General error codes

Error codeError DescriptionSolutions
0oksuccess

# 7. Scope of application

How this interface can be invoked under different account types:
Official Account Service Account
  • ✔: The account can call this interface
  • Other account types that are not expressly stated may not be called on this interface without special instructions;