AnsweredAssumed Answered

How to get files list of a shared folder using rest api?

Question asked by dmitriyp on Oct 31, 2017
Latest reply on Nov 7, 2017 by dmitriyp

Hi!

I have Alfresco Community 5.2.0

 

I need to get a filelist from some shared folder.

It is need for external application on android which I am developing.

The Application should get a filelist of folder, parse it and get files with names and descriptions, then user can download one or several of them.

 

I would like to use rest api.

I found out how authorize and get ticket by get-request.

https://my-site.com/alfresco/service/api/login?u=my_user_name&pw=my_password

 

Then I need to get a filelist from shared folder (it's name is test).

 

get-request work fine if i logged in via browser.


https://my-site.com/share/service/components/documentlibrary/data/doclist/all/node/alfresco/company/shared/test

 

And i get the content of this folder (filesm descriptions and etc)

 

But if I logged out from alfresco and try get-request with alf_ticket, it doesn't work. ticket is valid

https://my-site.com/share/service/components/documentlibrary/data/doclist/all/node/alfresco/company/shared/test?alf_ticket=TICKET_33e6923d0a527f34a2c5a276f915fcde8feafe77

 

I receives an error

 

{
"status": {
"code": 500,
"name": "Internal Error",
"description": "An error inside the HTTP server which prevented it from fulfilling the request."
},
"message": "09310019 Failed to execute script 'classpath*:alfresco/site-webscripts/org/alfresco/components/documentlibrary/data/surf-doclist.get.js': 09310018 09310019 Failed to run action evaluator: 09310018 User ID must exist and cannot be guest.",
"exception": "",
"callstack": [],
"server": "Spring WebScripts - v6.5.0 schema 1,000",
"time": "Oct 31, 2017 4:42:10 PM"
}

 

if ticket is invalid, it's ok, I receive status 401 Unauthorized

Outcomes