When I delete an user to notify, it returns Error: com.softlayer.api.ApiException$Internal: All objects being deleted must have an ID set.(code: SoftLayer_Exception, status: 500) I've set a proper UserId and DeviceId, but it still returns the same error. This is my sample code.
private void deleteUserTonotify(){
// Define the hardware and user identifiers
Long hardwareId = new Long(164420);
Long userId = new Long(538047);
// Define SoftLayer_User_Customer_Notification_Hardware service
com.softlayer.api.service.user.customer.notification.Hardware.Service hardwareService = com.softlayer.api.service.user.customer.notification.Hardware
.service(client);
// Declare SoftLayer_User_Customer_Notification_Hardware List
List<com.softlayer.api.service.user.customer.notification.Hardware> templateObjects = new ArrayList<com.softlayer.api.service.user.customer.notification.Hardware>();
com.softlayer.api.service.user.customer.notification.Hardware templateObject = new com.softlayer.api.service.user.customer.notification.Hardware();
templateObject.setUserId(userId);
templateObject.setHardwareId(hardwareId);
// Add templateObject to templateObjects
templateObjects.add(templateObject);
try {
boolean result = hardwareService.deleteObjects(templateObjects);
System.out.println(" delete result : " + result);
} catch (Exception e) {
System.out.println("Error: " + e);
}
}