AnsweredAssumed Answered

Call the Audit query webscript from a js file in the repo

Question asked by kavilash23 on Aug 20, 2014
Latest reply on Aug 22, 2014 by kavilash23
Hi Guys,

I am currently working on an auditing report and having issues when calling the Audit query webscript (http://localhost:8080/alfresco/service/api/audit/query/AuditExampleLogin2) from a javascript file in the repo.

I have tried the following after enabling the 'remote' object for alfresco (its enabled only for share OOTB)
  
   var url = "http://localhost:8080/alfresco/service/api/audit/query/AuditExampleLogin2?verbose=true"
   var theUrl = "/api/audit/query/AuditExampleLogin2?verbose=true";
   var json = remote.call(theUrl);
   //var connector = remote.connect("http");
   //var json = connector.call(url);
   logger.log(json);

but the returned json is complaining about authentication

{ "status" : { "code" : 401, "name" : "Unauthorized", "description" : "The request requires HTTP authentication." }, "message" : "07200002 Authentication failed for Web Script org\/alfresco\/repository\/audit\/query.get", "exception" : "org.springframework.extensions.webscripts.WebScriptException - 07200002 Authentication failed for Web Script org\/alfresco\/repository\/audit\/query.get",

Can anyone please advice?

Kind Regards,

Kavi

Outcomes