# pluginManager.setDevPluginApplyStatus

Call this API at the server side. For more information, see Server API.

This API supports Cloud Calls. The WeChat DevTools version must be 1.02.1904090 or later (download the latest stable version here), and the wx-server-sdk version must be 0.4.0 or later.

Modifies the status of the plug-in use request (for calling by the plug-in developer).

Calling methods:

# HTTPS Call

# Request Address

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

# Request Parameters

Attribute Type Default Required Description
access_token string Yes Credentials to call API
action string Yes A modification operation.
appid string No The AppID of the user. It is required when the application is approved.
reason string No The reason for rejection. It is required when the application is rejected.

Valid values of action

Value Description Minimum Version
dev_agree Approves the application
dev_refuse Rejects the application
dev_delete Deletes rejected applicants

# Return Value

# Object

JSON data package that is returned

Attribute Type Description
errcode number Error code
errmsg string Error message

# Errors

Error Code Error Message Description
0 ok Normal
-1 System error
89236 This plug-in is not available for application.
89237 This plug-in has been added.
89238 The upper limit of plug-ins that are being applied for or in use is exceeded.
89239 The plug-in does not exist.
89240 Cannot perform this operation. Only "Pending" requests can be approved/rejected.
89241 Cannot perform this operation. Only "Rejected/Timed Out" requests can be deleted.
89242 This AppID is not in the request list.
89243 "Pending" requests cannot be deleted.
89044 The AppID of this plug-in does not exist.

# Request Data Example

{
  "action": "dev_agree",
  "appid": "aaaa"
}

or

{
  "action": "dev_refuse",
  "reason": "refuse reason"
}

# Cloud Call

Cloud call is a capability provided by Mini Program·Cloud Base that allows you to call WeChat APIs in a cloud function. It must be used via wx-server-sdk in the cloud function.

# API Calling Method

openapi.pluginManager.setDevPluginApplyStatus

You need to configure the permissions for the pluginManager.setDevPluginApplyStatus API via config.json. Details

# Request Parameters

Attribute Type Default Required Description
action string Yes A modification operation.
appid string No The AppID of the user. It is required when the application is approved.
reason string No The reason for rejection. It is required when the application is rejected.

Valid values of action

Value Description Minimum Version
dev_agree Approves the application
dev_refuse Rejects the application
dev_delete Deletes rejected applicants

# Return Value

# Object

JSON data package that is returned

Attribute Type Description
errCode number Error code
errMsg string Error message

# Exceptions

# Object

Thrown Exceptions

Property Type Description
errCode number Error code
errMsg string Error message

Valid values of errCode

Value Description Minimum Version

# Errors

Error Code Error Message Description
0 ok Normal
-1 System error
89236 This plug-in is not available for application.
89237 This plug-in has been added.
89238 The upper limit of plug-ins that are being applied for or in use is exceeded.
89239 The plug-in does not exist.
89240 Cannot perform this operation. Only "Pending" requests can be approved/rejected.
89241 Cannot perform this operation. Only "Rejected/Timed Out" requests can be deleted.
89242 This AppID is not in the request list.
89243 "Pending" requests cannot be deleted.
89044 The AppID of this plug-in does not exist.

# Request Data Example

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'
      })
      console.log(result)
      return result
    } catch (err) {
      console.log(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'
      })
      console.log(result)
      return result
    } catch (err) {
      console.log(err)
      return err
    }
  }