Sky Ledge API - Quick start

We’re going to show you how easy it is to:

This guide will just focus on the API calls, the next section will unpack this in more detail using our Hero Potions Inc example

Getting your Sky Ledge API Key

To get your API Key:

  1. Click on the Manage Organization menu item

  2. Click on API Keys in the sidebar

  3. Add your API Key as part of a X-Authorization header in your API requests

Creating assets and displaying them on a map in four steps

Creating a Control Room

POST api.skyledge.com/controlrooms

// raw JSON body for api request
{  
   "name":"Hero Logistics",
   "description":"Real-time monitoring of Hero Logistics"
}
curl --location --request POST 'https://api.skyledge.com/controlrooms' \
--header 'X-Authorization: API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{  
   "name":"Hero Logistics",
   "description":"Real-time monitoring of Hero Logistics"
}'

Creating an Asset Type - Truck

POST api.skyledge.com/asset-types

{  
   "identifier":"truck",
   "name":"Delivery Truck",
   "description":"Trucks belonging to our delivery fleet"
}
curl --location --request POST 'https://api.skyledge.com/asset-types' \
--header 'X-Authorization: API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{  
   "identifier":"truck",
   "name":"Delivery Truck",
   "description":"Trucks belonging to our delivery fleet"
}'

Assigning our Truck Asset Type to our Control Room

PUT api.skyledge.com/controlrooms/{controlRoomId}/asset-types/{assetTypeId}

{}
curl --location --request PUT 'https://api.skyledge.com/controlrooms/CONTROL_ROOM_ID/asset_types/ASSET_TYPE_ID' \
--header 'X-Authorization: API_KEY'

Creating Asset - Our First Truck

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

{  
   "assetIdentifier":"truck_001",
   "name":"Mercedes Truck",
   "description":"Refrigerated truck.",
   "attributes":{  
      "icon":"truck",
      "model":"Actos Rigid Truck",
      "year":"2019",
      "asset-manager":"David Lawton",
      “colour” : “pink”
   },
   "metrics":{  
      "maximumCarryingWeightTonnes":3,
      "currentSpeed":80,
      “temperatureOfCargo” : 2
   },
   "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":"truck_001",
   "name":"Mercedes Truck",
   "description":"Refrigerated truck.",
   "attributes":{  
      "icon":"truck",
      "model":"Actos Rigid Truck",
      "year":"2019",
      "asset-manager":"David Lawton",
      "colour" : "pink"
   },
   "metrics":{  
      "maximumCarryingWeightTonnes":3,
      "currentSpeed":80,
      "temperatureOfCargo" : 2
   },
   "location":{  
      "type":"Point",
      "coordinates":[  
         -73.9848,
         40.7586
      ]
   }
}'

Voila. In four steps we’ve created a Control Room, an asset type, pushed our first asset type to the Control Room and created our first asset.

Last updated