Creating Asset Types
Not everyone needs Event Types and Events.
You could go straight to creating Assets and managing these as first class entities in Sky Ledge. Sky Ledge offers an out of the box Asset Management solution that’s fully API driven.
Asset Management is easy to understand, there are two concepts:
- 1.Asset Types (Classes of Asset, e.g. Cars, Phones)
- 2.Assets (Specific Assets, e.g. Ferrari Spider or iPhone X)
Creating Asset Types is easy:
POST api.skyledge.com/asset-types
{
"identifier":"hero",
"name":"Hero",
"description":"A HP Inc consumer"
}
cURL
NodeJs
Python
curl --location --request POST 'https://api.skyledge.com/asset-types' \
--header 'X-Authorization: API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"identifier":"hero",
"name":"Hero",
"description":"A HP Inc consumer"
}'
import { Configuration, AssetTypeRequest, AssetTypesApi } from '@skyledge/sdk';
const configuration = new Configuration({
apiKey: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX',
basePath: 'https://api.skyledge.com',
});
const data: Partial<AssetTypeRequest> = {
"identifier":"hero",
"name":"Hero",
"description":"A HP Inc consumer"
};
const assetTypeApi = new AssetTypesApi(configuration);
const newAssetType = await assetTypeApi.createAssetType(data);
console.log(newAssetType.status);
import requests
import json
url = "https://api.skyledge.com/asset-types"
payload = json.dumps({
"identifier": "hero",
"name": "Hero",
"description": "A HP Inc consumer"
})
headers = {
'X-Authorization': 'API_KEY',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)