I need to get the number of annotations for a document. It looks like I could possibly get it from IAnnotationService.ListAnnotations() but this method requires the connectionId which I don’t know how to get.
Here is a source code which performs what you have required.
var sessionId = Groupdocs.Web.Annotation.FileSessionMapper.Instance[“folder/file.ext”];
var annotationSvc = StructureMap.ObjectFactory.GetInstance<Groupdocs.Core.IAnnotationService>();
var annotations = annotationSvc.GetSessionAnnotations(sessionId);
Where “folder/file.ext” is a target document in the root storage where annotations are present.
If you will have more questions please feel free to contact us.