I would like to use the RESTful API to access a list of documents accessible by a particular user. I can log in to alfredo and get the associated ticket, and calls such as http://server_ip:port/alfresco/service/api/people/username/sites?alf_ticket=TICKET_ticketnum succeed in getting the list of sites for a user. But calls against the share fail. For instance: http://server_ip:port/share/service/components/documentlibrary/data/doclist/all/node/alfresco/company/home/User%20Homes/username?alf_ticket=TICKET_ticketnum
results in an internal server error with the stack trace giving the following error message: "exception": "org.springframework.extensions.webscripts.WebScriptException - 06040013 Failed to execute script 'classpath*:alfresco/site-webscripts/org/alfresco/components/documentlibrary/data/surf-doclist.get.js': 06040012 06040013 Failed to run action evaluator: 06040012 User ID must exist and cannot be guest."
Similarly, http://server_ip:port/share/service/components/documentlibrary/data/doclist/all/node/workspace/SpacesStore/sitenodenumber gives a 401 response without the ticket, and the same server error as above when the ticket is passed with the URL.
I am using Postman as my testbed. I have tried setting the Authentication header in the Basic Header portion of Postman to resolve this – and tried the URL with and without the ticket – but I have had no luck (without the ticket, I simply get a 401 Unauthorized status from the server). I have also tried the URL parameter as "ticket" instead of "alf_ticket". Just for grins, I also tried these calls via curl, with the same results.
I am running against Alfredo community edition 4.0.0, build 7, schema 5025.
Any help would be greatly appreciated!
Thanks,
Cindy Huyser
results in an internal server error with the stack trace giving the following error message: "exception": "org.springframework.extensions.webscripts.WebScriptException - 06040013 Failed to execute script 'classpath*:alfresco/site-webscripts/org/alfresco/components/documentlibrary/data/surf-doclist.get.js': 06040012 06040013 Failed to run action evaluator: 06040012 User ID must exist and cannot be guest."
Similarly, http://server_ip:port/share/service/components/documentlibrary/data/doclist/all/node/workspace/SpacesStore/sitenodenumber gives a 401 response without the ticket, and the same server error as above when the ticket is passed with the URL.
I am using Postman as my testbed. I have tried setting the Authentication header in the Basic Header portion of Postman to resolve this – and tried the URL with and without the ticket – but I have had no luck (without the ticket, I simply get a 401 Unauthorized status from the server). I have also tried the URL parameter as "ticket" instead of "alf_ticket". Just for grins, I also tried these calls via curl, with the same results.
I am running against Alfredo community edition 4.0.0, build 7, schema 5025.
Any help would be greatly appreciated!
Thanks,
Cindy Huyser
You can look at this webscript for example:
http://host:port/alfresco/service/api/node/workspace/SpacesStore/3c1586a2-87da-4611-aa55-99bb88ae4568/children
where 3c1586a2-87da-4611-aa55-99bb88ae4568 coud be the uuid of the user home folder.
Otherwise you can use open cmis library:
http://chemistry.apache.org/java/opencmis.html
or you can easily write your own webscript handling the format you want:
http://wiki.alfresco.com/wiki/Web_Scripts_Examples
http://serverIP:port/ alfresco/service/slingshot/doclib2/doclist /treenode/node/alfresco/company/home/User%20Homes/{username}?alf_ticket=ticketNum
I can also now read the data that is in a site to which the member belongs:
http://serverIP:port/ alfresco/service/slingshot/doclib2/doclist/all/node/workspace/SpacesStore/{sitenode id}?alf_ticket=ticketNum
where ticketNum is the TICKET_**** string returned from login.
Thanks again,
Cindy Huyser