Forum Discussion
Yeah, you can do that. You’d have to select each instance and define the SDT there though. Just click on the instance then go to the SDT tab.
If you want to manage it programmatically, you can use the API/SDK. Just do a post to /sdt/sdts with payload like this:
{
"type": "DeviceDataSourceInstanceSDT",
"dataSourceInstanceId": 1693806,
"sdtType": "oneTime",
"startDateTime": 1675970040000,
"endDateTime": 1675973640000,
"timezone": "America/New_York",
"comment": "SDT Notes here"
}
Trick is getting the dataSourceInstanceId. But if you find out the datasource ID by doing a GET on:
/setting/datasources?filter=name:\”The_DS_Short_Name_Not_displayName\”&fields=id,name,displayName
You can also get this from the URL once you’re looking at the DS on the settings page.
Now you have the DS ID. Then you can do a GET on:
/device/devices/{deviceId}/instances?filter=dataSourceId:”{DS_ID}”&size=1000&fields=id,name,displayName
From that response, use the id in your post to /sdt/sdts.
Related Content
- 2 years ago
- 2 years agoAnonymous