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
Start a request to the plug-in developer to use the plug-in
How to call:
POST https://api.weixin.qq.com/wxa/plugin?access_token=TOKEN
Property | Type | The default | Required | Description |
---|---|---|---|---|
access_token | string | Is | The interface calls the credentials | |
action | string | Is | Fill in "apply" under this interface | |
plugin_appid | string | Is | Plug-in appId | |
reason | string | Whether | Reasons to apply for use |
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 | The plug-in appid does not exist |
{
"action": "apply",
"plugin_appid": "aaaa",
"reason": "hello"
}
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.applyPlugin
The permissions for the pluginManager.applyPlugin API need to be configured in config.json, details
Property | Type | The default | Required | Description |
---|---|---|---|---|
action | string | Is | Fill in "apply" under this interface | |
pluginAppid | string | Is | Plug-in appId | |
reason | string | Whether | Reasons to apply for use |
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.applyPlugin({
action: 'apply',
reason: 'hello',
pluginAppid: 'aaaa'
})
return result
} catch (err) {
return err
}
}