Add multiple annotations to audit objects - 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 add multiple annotations to an audit, use the AddAnnotationMultiple method. AddAnnotationMultiple takes a list of BatchRequestParam objects and returns a list of Result objects. The BatchRequestParam objects specify the list of audit GUIDS and annotations.

Note: AddAnnotationMultiple is only available with API v3.
Table 1. Add multiple annotations to audit objects .NET signature
Library method name AddAnnotationMultiple
Description Add multiple annotations to audit objects
Method signature Result AddAnnotationMultiple(IEnumerable<BatchRequestParam> requests);
Method input parameters requests: list of objects that specify the GUIDs of the audit objects that you want to add annotations to, including the text of the annotations.
Return value A list of Result objects.
The following .NET C# code is an example of an adding multiple annotations call:
var requests = new List<BatchRequestParam>();
BatchRequestParam request1 = new BatchRequestParam { ObjectId = new Guid("e0fb025a-d8a2-4258-91ea-c4026c1620d1"), Resource = "THIS IS THE FIRST AUDIT ANNOTATION" };
requests.Add(request1);
BatchRequestParam request2 = new BatchRequestParam { ObjectId = new Guid("5ff1341e-dbf1-4eaf-b9a1-987f51dabefa"), Resource = "THIS IS THE SECOND AUDIT ANNOTATION" };
requests.Add(request2);

IEnumerable<Result> results = client.Audits.AddAnnotationMultiple(requests);
Result resultItem = results.ElementAt(0);
Console.WriteLine(resultItem);
/*
  {
    "Id": "e0fb025a-d8a2-4258-91ea-c4026c1620d1",
    "Status": 201,
    "Annotation": "THIS IS THE FIRST AUDIT ANNOTATION"
  }           
*/