/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
Detail | Value |
---|---|
Group | Asset |
From Server Version | 0.9.0 |
Permission | Admin |
Methods | POST |
Parameters
Parameter | Notes | Meaning |
---|---|---|
id | Integer [Required] | The ID of the asset |
line | Integer (-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) |
effect | String | The name of the effect to apply |
attribute | String | The attribute to change |
value | String | The attribute value |
filter | String | An optional search filter, in the form of 'a=b' |
atr_<name> | String | Arguments to assign to the effect |
format | String (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" ] }]