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
      ]
   }
}'

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:

Last updated