Custom action plugins
Last updated
Was this helpful?
Last updated
Was this helpful?
A custom action plugin is a that can be associated to a custom action node in an automation, allowing you to trigger a custom action in an automation.
This feature is useful for triggering actions not available in the current list of actions in automations.
If you don't know what a plugin is, you can find
Custom action plugins have only one predefined endpoint to implement.
POST
myworker/v1/scenario_custom_actions
This entry point is called any time a user point goes through a custom action node in an automation.
user_point_id
string
The ID of the user point.
custom_action_id
string
The ID of the custom action plugin instance. Used to retrieve the instance properties.
See to learn why you should use the custom_action_id
parameter to retrieve the instance properties.
GET
https://api.mediarithmics.com/v1/scenario_custom_actions/:id
Use the custom_action_id from the incoming request to retrieve the custom action plugin instance that has been called.
id
string
ID of the custom action plugin instance, typically the custom_action_id
from the incoming request.
GET
https://api.mediarithmics.com/v1/scenario_custom_actions/:id/properties
Get the properties associated with the custom action plugin instance.
id
string
ID of the custom action plugin instance, typically thecustom_action_id
from the incoming request
A custom action plugin has the SCENARIO_CUSTOM_ACTION
plugin type. Its group id should be {domain.organisation.scenario-custom-action}
(for example com.mediarithmics.scenario-custom-action
).
Its artifact id should be the name of the custom action plugin, i.e. example-custom-action
.
We can provide you with a Hello World project using our SDK. Please contact your support to gain access to it.
You should extend CustomActionBasePlugin
class and implement the onCustomActionCall
function from the plugin SDK.
The onCustomActionCall
function is called every time a user point runs through a custom action node in an automation. It is responsible for implementing the custom action.
Don't forget to catch your errors. You should log / respond with the appropriate message to facilitate debugging.
POST
https://api.mediarithmics.com/v1/scenario_custom_actions
Use this method to create a custom action plugin instance attached to an organisation. This will display the custom action as a choice in the custom action automation node.
organisation_id
string
The ID of the organisation you want to attach this instance to.
name
string
The name for this instance. If not given, the instance ID will be used in the interface instead.
artifact_id
string
The artifact ID of the plugin.
group_id
string
The group ID of the plugin.
PUT
https://api.mediarithmics.com/v1/scenario_custom_actions/:id/properties/technical_name=:name
Use this method to update a property for the custom action plugin instance.
name
string
The technical name of the property to update.
id
string
The ID for the custom action plugin instance.
deletable
boolean
writable
boolean
origin
string
One of PLUGIN_STATIC
, PLUGIN
, INSTANCE
.
property_type
string
One of DOUBLE
, INT
, BOOLEAN
, ASSET
, DATA_FILE
, URL
, STRING
, AD_LAYOUT
, STYLE_SHEET
, PIXEL_TAG
, RECOMMENDER
, NATIVE_IMAGE
, NATIVE_TITLE
, NATIVE_DATA
.
technical_name
string
The technical name of the property to update.
value
object
Value format depends on property type. If property type is STRING
, value will be an object {"value": "string"}
.
The code of the custom action plugin can call the following API endpoints to retrieve.
See the documentation to see .
Use our to create your custom action plugin in Node.js
: the required routes are already defined and you only have to override specific functions.
You can find a sample custom action plugin .
The project structure and files work as .
You can monitor custom action plugins.