Skip to main content

Automation Target Service

The automation target resource contains all of the standard and custom created automation targets available in the platform.

An automation target is a resource where data can be sent to, i.e. Email, Message Queue etc.

An automation target is created in your private source and can be published to make it accessible to all clients using the OpenDataDSL platform (In the same way as Extensions)

Automation Target REST API​

The Automation Target REST API is a full CRUD API allowing you to search and filter automation targets as well as update, version and delete them.

It is accessed through the following URL:

https://api.opendatadsl.com/api/automationtarget

The API consists of the following calls:

MethodPathExampleDescription
GETGet the build information for this service
GET{release}/{source}v1/public v1/private v1/allList public, private or all automation targets
GET{release}/{source}/{key}v1/private/odsl.emailRetrieve a single automation target using its unique id
GET{release}/{source}/{key}/{version}v1/private/odsl.email/1Retrieve a version of a single automation target
GET{release}/{source}/{key}/*v1/private/odsl.email/*Get a list of versions for a specific automation target
PUT{release}/{source}/{key}/{version}/{tag}v1/private/odsl.email/1/PRODTag a version with a name (which can be used instead of the version number when retrieving it)
POST{release}v1Create or update an automation target, the automation target is the body of the POST request
DELETE{release}/{source}/{key}v1/private/odsl.emailRollback to the previous version of an automation target, if it is the only version then the automation target will be deleted
DELETE{release}/{source}/{key}/{version}v1/private/odsl.email/1Delete a specific version of an automation target
DELETE{release}/{source}/{key}/*v1/private/odsl.email/*Fully delete an automation target, including all versions

Special REST Calls​

Publish an automation target​

To publish an automation target to the public repository, you need to:

Entities​

Automation Target Entity​

The automation target entity contains the following information:

NameDescriptionType
_idUnique id for the automation target (must be {publisher}.{code})String
_typeThe type - always VarAutomationTargetString
publisherThe publisher of the automation targetString
codeThe code id of the automation targetString
nameThe name of the automation targetString
descriptionThe long description of the automation targetString
iconThe icon (bootstrap icons) to be shown next the automation target name in the GUIString
scriptThe script that performs the actionString (Script name)
templateThe text used to collect information from the user and the data to collectString
tagsA list of strings used to categorise this automation targetList(String)
propertiesThe properties array to send to the targetObject
inputsThe input configuration informationObject
servicesThe services this target can work with, * for allList(String)
actionsThe actions this target can work with, * for allList(String)
allowTransformationTrue if we allow the user to specify a transformer to transform the data to be submittedBoolean
allowPropertyChangeTrue if we allow the user to specify a check for a property changing to either a specific value or anythingBoolean

Target Templates​

The template on the automation target should be structured as an variable encoded string such that the GUI can collect information from the user.

The syntax for each variable in the string is as follows:

[varname]

Example​

Send an email to [to] with subject [subject], add the data as an attachment named [attachmentName].

Target Inputs​

The inputs object must contain the configuration of the inputs defined in the target template.

Each property should have:

  • A description to be shown as help in the GUI
  • A type, if omitted it defaults to String
  • An optional filter to be used to filter items if type is group, object, calendar, expiry, data
  • An optional default value

Example for above template​

{
"to": {
"description": "The email address of the recipient(s) of the email, separate multiple email addresses with either ,; or space"
},
"subject": {
"description": "The message subject"
},
"attachmentName": {
"description": "The name of the file in the attachment, default is the id of the variable, can use embedded dates"
}
}

General example​

{
"varname": {
"description": "Text description of the input property",
"type": "The type of input, e.g. String, Boolean, VarGroup etc.",
"default": "An optional default value for this input property"
},
"string": {
"description": "A string property with no default value"
},
"group": {
"description": "A property which expects a group id, the GUI will show a group selector",
"type": "group",
"filter": {
"type": "Favourites"
}
},
"object": {
"description": "A property which expects a master data id, the GUI will show an object selector",
"type": "object",
"filter": {
"_type": "#ForeignExchange"
}
}
}

Target Properties​

The properties object is sent to the target, you can set any defaults on this and all the inputs provided by the GUI will be appended to it.

Example​

{
"attachment": true
}

Examples​

The email target​

{
"publisher": "odsl",
"code": "email",
"name": "Send an email",
"description": "Send the data to 1 or more email addresses",
"icon": "envelope-at",
"script": "@EmailTarget",
"template": "send an email to [to] with subject [subject]",
"tags":["Communication"],
"inputs": {
"to": {
"description": "The email address of the recipient(s) of the email, separate multiple email addresses with either ,; or space"
},
"subject": {
"description": "The message subject"
}
},
"properties": {
"attachment": false
},
"services": ["*"],
"actions": ["*"],
"allowTransformation": true,
"allowPropertyChange": true
}

The curve build target​

{
"publisher": "odsl",
"code": "curve",
"name": "Build a curve",
"description": "Triggers a curve build",
"icon": "graph-up",
"script": "@CurveTarget",
"template": "build curve [curve]",
"tags":["Curves", "Process", "Automation"],
"inputs": {
"curve": {
"description": "The id of the curve to build"
}
},
"properties": {},
"services": ["data"],
"allowTransformation": false,
"allowPropertyChange": false,
"actions": ["update"]
}