Get annotations for alarms - Metasys - LIT-12013522 - Software Application - Basic Services client library for .NET (and COM) - Metasys API - 4.2

Metasys REST Client for .NET and COM Developer Guide

Brand
Metasys
Product name
Basic Services client library for .NET (and COM)
Metasys API
Document type
API Reference Guide
Document number
LIT-12013522
Version
4.2
Revision date
2021-04-07
Language
English (United States)

To get the annotations of an alarm, use the GetAnnotations method. GetAnnotations takes the GUID of the alarm and returns a collection of AlarmAnnotation objects.

Table 1. Get annotations for alarms .NET signature
Library method name GetAnnotations(alarm.Id)
Description Get annotations of a single alarm
Method signature IEnumerable<AlarmAnnotation> GetAnnotations(Guid alarmId);
Method input parameters alarmId: GUID of the alarm object the method targets and retrieves the annotations.
Return values A collection of AlarmAnnotation.
The following .NET C# code is an example of a get annotations call:
IEnumerable<AlarmAnnotation> annotations = client.Alarms.GetAnnotations(alarm.Id);
AlarmAnnotation firstAnnotation = annotations.FirstOrDefault();
Console.WriteLine(firstAnnotation);
/*
  {
    "AlarmUrl": "https://win-ervotujej94/api/v2/alarms/f0f64d5c-b70e-8754-836c-1ac99182f4e4",
    "Text": "Test Annotation 00",
    "User": "metasyssysagent",
    "CreationTime": "2020-05-27T06:21:31Z",
    "Action": "none"
  } 
*/