Collective Space API examples or samples

Hi there,

New to Annotations and Collective Spaces, looking to automate annotations. I am having a hard time getting started on creating annotations, I get a "Security error" when invoking the Annotaiton 2.5 methods. Looking for a sample or example if anyone has used these API.

This is what I have so far

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Boolean success = false;
// using (Trisoft.InfoShare.API25.DocumentObj userClientObj = new Trisoft.InfoShare.API25.DocumentObj())
Trisoft.InfoShare.API25.Annotation userClientAnnotation = new Trisoft.InfoShare.API25.Annotation();
revisionId = "GUID-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
pubGUID = "GUID-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
string xmlMetadata = "<ishfields>" +
"<ishfield name='FISHANNOTATIONTYPE' level='annotation'>General</ishfield>" +
"<ishfield name='FISHANNOTATIONTEXT' level='annotation'>Oracle 12.2 is supported and Oracle 12.1 is deprecated</ishfield>" +
"<ishfield name='FISHANNOTPROPOSEDCHNGTXT' level='annotation'>Replace 'Oracle 12.1' with 'Oracle 12.2'</ishfield>" +
"<ishfield name='FISHREVISIONID' level='annotation'>" + revisionId + "</ishfield>" +
"<ishfield name='FISHPUBLOGICALID' level='annotation'>" + pubGUID + "</ishfield>" +
"<ishfield name='FISHPUBVERSION' level='annotation'>1</ishfield>" +
"<ishfield name='FISHANNOTATIONSTATUS' level='annotation' ishvaluetype='element'>VANNOTATIONSTATUSSHARED</ishfield>" +
"<ishfield name='FISHANNOTATIONCATEGORY' level='annotation'>Comment</ishfield>" +
"<ishfield name='FISHANNOTATIONADDRESS' level='annotation' xml:space='preserve'>[{'revisionId':" + revisionId + ",'type':'TEXT_RANGE_SELECTOR','startContainerQuery':'/*[1]/node()[3]/node()[1]/node()[1]','startOffset':0,'endContainerQuery':'/*[1]/node()[3]/node()[1]/node()[1]','endOffset':34}]</ishfield>" +
"</ishfields>";
try
{
userClientAnnotation.Create(xmlMetadata);
}catch(Exception e)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The error I get when run:-

Fullscreen
1
2
3
4
Security error. at Trisoft.InfoShare.Core.Identity.Services.Base.BaseUserContextPrincipalService.GuardIdentity()
at Trisoft.InfoShare.Core.Identity.Services.Base.BaseUserContextPrincipalService.get_UserContext()
at Trisoft.InfoShare.Core.Identity.Services.UserContextAuthorizationService.RefreshCache()
at Trisoft.InfoShare.API25.Annotation.Create(String xmlMetadata)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

We are on TD14 SP3, hope someone can point me in the right direction.

Thanks in advance

emoji