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
Query the added 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 "list" under this interface |
The returned JSON packet
Property | Type | Description |
---|---|---|
errcode | number | Error code |
errmsg | string | The error message |
plugin_list | Array.<Object> | A list of plug-ins in request or use |
plugin_list structure of the system
Property | Type | Description |
---|---|---|
appid | string | Plug-in appId |
status | number | The state of the plug-in |
nickname | string | Plug-in nickname |
headimgurl | string | Plug-in avatar |
The legal value of the status
Value | Description | The lowest version |
---|---|---|
1 | In the application | |
2 | The application is passed | |
3 | Rejected | |
4 | Timed out |
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 | This plugin does not exist | |
89240 | Unable to do this, only "to be confirmed" application can be operated / rejection | |
89241 | Unable to do this, only "Refused / Timeout" application can be operated | |
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":"list"
}
{
"errcode": 0,
"errmsg": "ok",
"plugin_list": [{
"appid": "aaaa",
"status": 1,
"nickname": "插件昵称",
"headimgurl": "http://plugin.qq.com"
}]
}
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.getPluginList
You need to configure the permissions for the pluginManager.getPluginList API in config.json, details
Property | Type | The default | Required | Description |
---|---|---|---|---|
action | string | Is | Fill in "list" under this interface |
The returned JSON packet
Property | Type | Description |
---|---|---|
errCode | number | Error code |
errMsg | string | The error message |
pluginList | Array.<Object> | A list of plug-ins in request or use |
The structure of pluginList
Property | Type | Description |
---|---|---|
appid | string | Plug-in appId |
status | number | The state of the plug-in |
nickname | string | Plug-in nickname |
headimgurl | string | Plug-in avatar |
The legal value of the status
Value | Description | The lowest version |
---|---|---|
1 | In the application | |
2 | The application is passed | |
3 | Rejected | |
4 | Timed out |
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.getPluginList({
action: 'list'
})
return result
} catch (err) {
return err
}
}
{
"errCode": 0,
"errMsg": "openapi.pluginManager.getPluginList:ok",
"pluginList": [
{
"appid": "aaaa",
"status": 1,
"nickname": "插件昵称",
"headimgurl": "http://plugin.qq.com"
}
]
}