/api/asset/effects [POST]

Usage

Adds or replaces an effect on this asset.

There are two methods of using this function.

Changing a Single Value

If you want to change a single attribute on an effect, you can specify the effect, the attribute and value, using the parameters with those names.

Changing Multiple Values

You can use the effect parameter to nominate the effect you want to use, and specify effect arguments using atr_<parameter_name> parameters.

By passing a parameter atr_enabled will specify a value for the enabled property, while attr_colour will change the colour property.

Example Solutions

For example, let's say you have the effects below…

<occluded/>
<tint coloura="#FFFFFF" enabled="[Running]"/>

You could change the colour of the tint effect to red in one of two ways….

  • By setting 'effect' to tint and the parameter 'atr_coloura' to #FF0000
  • By setting 'line' to 1, 'attribute' to coloura and 'value' to #FF0000

Please note that line ID is only related to the effects that are on the asset itself - you can not edit the effects of a type unless you use the asset ID of the type.

Note that there are special values for line.

A value of -1 (the default) asks the system to create or replace an effect. If you don't have an instance of the effect on the asset, a new one is created. If you do have an instance, it is updated.

A value of -2 forces the system to add a new line.

Details

DetailValue
GroupAsset
From Server Version0.9.0
PermissionAdmin
MethodsPOST
Parameters
ParameterNotesMeaning
idInteger [Required]The ID of the asset
lineInteger (-1)The zero-based line number of the effect line to replace (-1 to replace any existing item, -2 to force the addition of a new line)
effectStringThe name of the effect to apply
attributeStringThe attribute to change
valueStringThe attribute value
filterStringAn optional search filter, in the form of 'a=b'
atr_<name>StringArguments to assign to the effect
formatString (xml)Either 'xml' or 'json'

Examples

Original XML
<occluded/>
<tint coloura="#FFFFFF" enabled="[Running]"/>
Call
[POST] http://ardiserver.com/s/sitename/api/asset/effects
id:25
line: 1
attribute: coloura
value: #FF0000
Success (XML)
<success>
    <message>Saved</message>
</success>
Success (JSON)
[{
	"message": [ "Saved" ]
}]