This function is used to create a new ARDI asset.
This is part of the core API.
Because we discourage the creation of orphan assets (ie. assets that have no relationships), the function requires that the asset be connected via at least one relationship when it is created. We suggest the Location relationship (ID #2).
| Detail | Value |
|---|---|
| Group | Asset |
| From Server Version | 0.9.0 |
| Permission | Admin |
| Methods | POST |
| Parameter | Notes | Meaning |
|---|---|---|
| name | String [Required] | The name of the new asset |
| origin | Number [Required] | The ARDI ID of the parent asset |
| relationship | Number [Required] | The relationship to connect to the parent with |
| desc | String | The description of the asset |
| tagwith | String | Comma-delimited list of parent type IDs |
| format | String (xml) | Either 'xml' or 'json' |
http://ardiserver.com/s/sitename/api/asset/createasset
Content:
Name: Building A Relationship: 2 Origin: 5 Desc: The main production building TagAs: 44
This creates a new asset called 'Building A', a child of asset #5 in the Location relationship.(the 'Site' asset in the default ARDI server). It's tagged with type #44.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<response>
<success id="175"/>
</response>
The response includes the ID number of the newly created asset.
{
"success": true,
"id": "24"
}