Call the Audit query webscript from a js file in the repo
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2014 01:55 AM
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
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
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2014 05:05 AM
You should also pass the alf_ticket for admin user while invoking the audit webscript.
Hope this helps.
Hope this helps.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2014 12:00 AM
Thanks ramesh you were very helpfull
