Skip to main content
Skip table of contents

IA Software Development Kit (SDK)

We have exposed a selection of methods from Intelligent Assets for use by other developers. You can call these endpoints directly within custom code services on the developer console.

Endpoints

AssetTrees

getChildrenForAsset

Gets the direct descendents of an asset specified by <parentID>

Request

TYPESCRIPT
{ parentID: string }

Response

TYPESCRIPT
Promise<string[]>

Example usage

TYPESCRIPT
const client = new IAClient()
client.AssetTrees.getChildrenForAsset({ 
  parentID: 'myParentID'
}).then()
updateChildrenForAsset

Sets the <children> for an asset specified by <parentID>

Request

TYPESCRIPT
{ parentID: string; children: string[] }

Response

TYPESCRIPT
Promise<void>

Example usage

TYPESCRIPT
const client = new IAClient()
client.AssetTrees.updateChildrenForAsset({ 
  parentID: 'myParentID',
  children: ['child1', 'child2']
}).then()

Assets

createAsset

Creates an asset

Request

TYPESCRIPT
{
  item: {
    id: string;
    type: string;
    //...any additional properties of an asset are optional
  },
  groupIds: string[]
}

Response

TYPESCRIPT
// Same shape as the request type will be returned

Example usage

TYPESCRIPT
const client = new IAClient()
client.Assets.createAsset({
  item: {
    id: 'test1',
    type: 'truck',
    label: 'MyTestTruck',
  },
  groupIds: ['default'],
}).then()

Example usage in a code service

  1. Start by adding the IA_SDK library to your code service

  1. Use the SDK methods like any other asynchronous requests. Here is an example of calling the SDK to create an asset.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.