Sky Ledge Docs
  • Welcome
  • Getting Started
    • Creating Your Account
    • Sky Ledge API - Quick start
    • Developer Guide
      • Creating A Control Room
      • Creating Event Types
      • Creating Events (aka Alerts or Notifications)
      • Creating Asset Types
      • Linking Asset Types to a Control Room
      • Creating Assets
      • Creating and Tracking a Metric
      • Future Updates
  • Fundamentals
    • Launchpad
    • Control Rooms
    • Assets
    • Events
    • Places
    • Cycles
    • Widgets
  • API Docs
  • Client Libraries
    • NodeJs
  • Community
    • Where to find us
  • Knowledge Base
    • Articles
      • What is a LaunchPad
      • What is a Control Room
      • How to use the maps controls and layers options
      • Map marker explained
      • Navigating your profile
      • What is an Event
      • What is an Event Type
      • Exploring the event stream
      • Event Stream Filtering
      • What is an Asset
      • What are asset types
      • Understanding Focus Mode
      • Navigating Asset List Mode
      • Table column selection
      • Asset metrics
      • What is a place
      • Searching and Creating a Place
      • Getting Started with Place Notifications
      • Places and how to use the gatehouse report
      • How to use the Event Report (Top-down Investigations Module)
      • What is a Task
      • How to process a task
      • Task Notifications
      • How to invite a work colleague
      • How to submit an awesome ticket
      • Understanding Your Weekly Email Reports
      • Knowledge Base Template
    • What's New
    • Archived - What's News
Powered by GitBook
On this page
  1. Getting Started
  2. Developer Guide

Creating Assets

Now that we’ve created an Asset Type (The ‘Hero’ Asset Type), it’s time to create our first actual Asset (‘A Hero’).

Asset Creation

Notice that Assets are incredibly flexible, they can refer to physical objects or people, as in this example (we’ll unpack this right after):

Creating Asset - A Hero

POST api.skyledge.com/asset-types/{assetTypeId}/assets

{  
   "assetIdentifier":"hero_001",
   "name":"High Flyer",
   "description":"A high-flying superhero.",
   "attributes":{  
      "icon":"superhero",
      "powers":[  
         "Flight"
      ]
   },
   "metrics":{  
      "remainingPower":100
   },
   "location":{  
      "type":"Point",
      "coordinates":[  
         -73.9848,
         40.7586
      ]
   }
}
curl --location --request POST 'https://api.skyledge.com/asset-types/ASSET_TYPE_ID/assets' \
--header 'X-Authorization: API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{  
   "assetIdentifier":"hero_001",
   "name":"High Flyer",
   "description":"A high-flying superhero.",
   "attributes":{  
      "icon":"superhero",
      "powers":[  
         "Flight"
      ]
   },
   "metrics":{  
      "remainingPower":100
   },
   "location":{  
      "type":"Point",
      "coordinates":[  
         -73.9848,
         40.7586
      ]
   }
}'
import { Configuration, AssetRequest, AssetsApi } from '@skyledge/sdk';

const configuration = new Configuration({
  apiKey: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX',
  basePath: 'https://api.skyledge.com',
});

const data: AssetRequest = {
  assetIdentifier: 'hero_001',
  name: 'High Flyer',
  description: 'A high-flying superhero.',
  attributes: {
    icon: 'superhero',
    powers: ['Flight'],
  },
  metrics: {
    remainingPower: 100,
  },
  location: {
    type: 'Point',
    coordinates: [[-73.9848, 40.7586]],
  },
} as any;

const assetTypeId = ASSET_TYPE_ID;

const assetApi = new AssetsApi(configuration);

const createAsset = await assetApi.createAsset(assetTypeId, data);

console.log(createAsset.status);
import requests
import json

url = "https://api.skyledge.com/asset-types/ASSET_TYPE_ID/assets"

payload = json.dumps({
  "assetIdentifier": "hero_001",
  "name": "High Flyer",
  "description": "A high-flying superhero.",
  "attributes": {
    "icon": "superhero",
    "powers": [
      "Flight"
    ]
  },
  "metrics": {
    "remainingPower": 100
  },
  "location": {
    "type": "Point",
    "coordinates": [
      -73.9848,
      40.7586
    ]
  }
})
headers = {
  'X-Authorization': 'API_KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)var axios = require('axios');
var data = JSON.stringify({
  "assetIdentifier": "hero_001",
  "name": "High Flyer",
  "description": "A high-flying superhero.",
  "attributes": {
    "icon": "superhero",
    "powers": [
      "Flight"
    ]
  },
  "metrics": {
    "remainingPower": 100
  },
  "location": {
    "type": "Point",
    "coordinates": [
      -73.9848,
      40.7586
    ]
  }
});

var config = {
  method: 'post',
  url: 'https://api.skyledge.com/asset-types/ASSET_TYPE_ID/assets',
  headers: { 
    'X-Authorization': 'API_KEY', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

You can see the asset in the control room now:

We can specify a few things as part of creating a new asset:

assetIdentifier

Unique identifier of your own choosing

name

Meaningful name for your asset

description

Describe your asset

attributes

Descriptive properties of your asset

icon

You’ll be able to see some/all of these attributes in a modal when you click on the asset. Pops up like this in the control room:

PreviousLinking Asset Types to a Control RoomNextCreating and Tracking a Metric

Last updated 2 years ago

Leaving this unspecified will create a default asset icon for you. If you have a custom icon, email with the icon you’d like and it’ll be generated within a few hours.

Asset modal
assets@skyledge.com