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
Solved! Go to Solution.
Solved!
To get folder content use
iport/alfresco/service/slingshot/doclib2/doclist/all/node/workspace/SpacesStore/ + {folder id} + ?alf_ticket=TICKET_nnn
Solved!
To get folder content use
iport/alfresco/service/slingshot/doclib2/doclist/all/node/workspace/SpacesStore/ + {folder id} + ?alf_ticket=TICKET_nnn
Thank you abhinav for your reply.
I registered the 2 files desc.xml and the html.ftl files and refreshed the Wev Scripts Extensions (.js not yet involved)
What will be the SiteShortName in my setup (here you used 'test')
site ? in Alfresco terminilogy ?
Thanks
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.