May 19, 2021 WeChat Mini Program Development Document
This interface should be called on the server side, as detailed in the Service Side API.
This interface supports cloud calls. Developer tool version required . . . 1.02.1904090 (latest stable download)
wx-server-sdk >= 0.4.0
Modify the status of the plug-in usage request (for plug-in developers to call)
How to call:
POST https://api.weixin.qq.com/wxa/devplugin?access_token=TOKEN
Property | Type | The default | Required | Description |
---|---|---|---|---|
access_token | string | Is | The interface calls the credentials | |
action | string | Is | The modification action | |
appid | string | Whether | The user's appid. Fill in when you agree to the application. | |
reason | string | Whether | Reason for refusal. Fill in when you reject the application. |
The legal value of the action
Value | Description | The lowest version |
---|---|---|
dev_agree | Agree to the application | |
dev_refuse | Reject the application | |
dev_delete | Delete the rejected applicant |
The returned JSON packet
Property | Type | Description |
---|---|---|
errcode | number | Error code |
errmsg | string | The error message |
Error code | The error message | Description |
---|---|---|
0 | Ok | Normal |
-1 | System error | |
89236 | The plug-in cannot be requested | |
89237 | The plug-in has been added | |
89238 | The maximum number of plug-ins to apply for or use has been reached | |
89239 | The plug-in does not exist | |
89240 | This cannot be done and only "to be confirmed" applications can be operationally passed/rejected | |
89241 | This operation cannot be performed and only requests for Rejected/Timed can be deleted operationally | |
89242 | The appid is not on the application list | |
89243 | Applications for "to be confirmed" cannot be deleted | |
89044 | Do not exist the plugin AppID |
{
"action": "dev_agree",
"appid": "aaaa"
}
Or
{
"action": "dev_refuse",
"reason": "refuse reason"
}
Cloud call is the ability provided by the small program Cloud Development to call WeChat open interfaces in cloud functions and need to be used in cloud functions via wx-server-sdk.
openapi.pluginManager.setDevPluginApplyStatus
You need to configure the permissions for the pluginManager.setDevPluginApplyStatus API in config.json, details
Property | Type | The default | Required | Description |
---|---|---|---|---|
action | string | Is | The modification action | |
appid | string | Whether | The user's appid. Fill in when you agree to the application. | |
reason | string | Whether | Reason for refusal. Fill in when you reject the application. |
The legal value of the action
Value | Description | The lowest version |
---|---|---|
dev_agree | Agree to the application | |
dev_refuse | Reject the application | |
dev_delete | Delete the rejected applicant |
The returned JSON packet
Property | Type | Description |
---|---|---|
errCode | number | Error code |
errMsg | string | The error message |
The exception thrown
Property | Type | Description |
---|---|---|
errCode | number | Error code |
errMsg | string | The error message |
The legal value of errCode
Value | Description | The lowest version |
---|
Error code | The error message | Description |
---|---|---|
0 | Ok | Normal |
-1 | System error | |
89236 | The plug-in cannot be requested | |
89237 | The plug-in has been added | |
89238 | The maximum number of plug-ins to apply for or use has been reached | |
89239 | The plug-in does not exist | |
89240 | This cannot be done and only "to be confirmed" applications can be operationally passed/rejected | |
89241 | This operation cannot be performed and only requests for Rejected/Timed can be deleted operationally | |
89242 | The appid is not on the application list | |
89243 | Applications for "to be confirmed" cannot be deleted | |
89044 | The plug-in appid does not exist |
const cloud = require('wx-server-sdk')
cloud.init()
exports.main = async (event, context) => {
try {
const result = await cloud.openapi.pluginManager.setDevPluginApplyStatus({
action: 'dev_agree',
appid: 'aaaa'
})
return result
} catch (err) {
return err
}
}
Or
const cloud = require('wx-server-sdk')
cloud.init()
exports.main = async (event, context) => {
try {
const result = await cloud.openapi.pluginManager.setDevPluginApplyStatus({
action: 'dev_refuse',
reason: 'refuse reason'
})
return result
} catch (err) {
return err
}
}