post https://example.com/settings/v1/plugins
Create a new Plugin
Will create a service user in the UMS, upload the code file if sent, publish the plugin,
create an accessible endpoint for it and subscribe all requested notifications and interceptions to that endpoint.
If code is not sent it will use a seed code instead.
If this API fails, it will roll back the changes it made.
This is a "multipart/form-data" request that includes both the binary zip file and configuration
information.
The form should include 2 parameters:
- "code": Non-mandatory binary zip file.
- "configuration": Mandatory JSON configuration of the plugin as follows:
{
"name": "string",
"displayName": "string",
"version": 1,
"environmentVariables": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"subscriptions": {
"interceptionOrder": 1,
"interceptions": [
{
"type": "PRE_REQUEST",
"apiId": "string",
"entityTypeName": "string",
"order": 5
}
],
"notifications": [
{
"entityTypeName": "string",
"actionName": "string"
}
]
}
}
The below table describes the request parameters:
Parameter | Type | Mandatory | Description |
---|---|---|---|
name | String | true | Unique plugin name. A prefix "Plugin-" will be added to it |
displayName | String | true | The display name of the plugin. It will be added to environment variables with a reserved key |
version | String | true | The plugin version number, Must be between 1 and 32767 |
environmentVariables | JSON | false | A map that contains environment variables as key value pairs, keys starting with BIOT_ are reserved for system use |
subscriptions | JSON | false | |
subscriptions.interceptionOrder | String | true | The order of which this plugin will be executed if more than one interceptor exist for the API. This parameter applies for all interceptors sent in the request. Must be positive |
subscriptions.interceptions | JSON | false | A list of interceptors APIs that this plugin will handle |
subscriptions.interceptions.type | String | true | The interception's type, must be sent for every interception |
subscriptions.interceptions.apiId | String | false | The ID of the API that you want to subscribe to, This only applies to PRE_REQUEST & POST_REQUEST types |
subscriptions.interceptions.entityTypeName | String | false | The entity name that you want to modify. Provided only if type=ADAPT_ENTITY |
subscriptions.interceptions.order | String | false | If sent, this will override the interceptionOrder parameter for a specific interception. Must be positive |
subscriptions.notifications | JSON | false | A list of notifications APIs that this plugin will handle |
subscriptions.notifications.entityTypeName | String | true | The entity type that you would like to be notified about |
subscriptions.notifications.actionName | String | true | The action performed on the entity that you would like to be notified about |
This API requires SETTINGS_PLUGIN_CREATE permission(s).