/api/asset/create

Usage

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).

Details

DetailValue
GroupAsset
From Server Version0.9.0
PermissionAdmin
MethodsPOST
Parameters
ParameterNotesMeaning
nameString [Required]The name of the new asset
originNumber [Required]The ARDI ID of the parent asset
relationshipNumber [Required]The relationship to connect to the parent with
descStringThe description of the asset
tagwithStringComma-delimited list of parent type IDs
formatString (xml)Either 'xml' or 'json'

Examples

Call
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.

Success (XML)
<?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 (JSON - 2026+)
{
    "success": true,
    "id": "24"
}