Linking Asset Types to a Control Room
You may want to display certain types of assets in different Control Rooms. For example, Hero Potions may want to display their delivery trucks inside of their Logistics Control Rooms. They may want to display their customers in another type of Control Room.
Let’s go ahead and pair our Hero Asset Type to the Control Room we’ve created previously:
PUT api.skyledge.com/controlrooms/{controlRoomId}/asset-types/{assetTypeId}
{}
cURL
NodeJs
Python
curl --location --request PUT 'https://api.skyledge.com/controlrooms/CONTROL_ROOM_ID/asset_types/ASSET_TYPE_ID' \
--header 'X-Authorization: API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{}'
import { Configuration, AssetTypesApi } from '@skyledge/sdk';
const configuration = new Configuration({
apiKey: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX',
basePath: 'https://api.skyledge.com',
});
const assetTypeApi = new AssetTypesApi(configuration);
const controlRoomId = CONTROL_ROOM_ID;
const assetTypeId = ASSET_TYPE_ID;
const addAssetType2ControlRoom =
await assetTypeApi.assignsAssetTypeToControlRoom(controlRoomId, assetTypeId);
console.log(addAssetType2ControlRoom.status);
import requests
import json
url = "https://api.skyledge.com/controlrooms/CONTROL_ROOM_ID/asset_types/ASSET_TYPE_ID"
payload = json.dumps({})
headers = {
'X-Authorization': 'API_KEY',
'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
Last modified 8mo ago