AnsweredAssumed Answered

Quickshare by webscript

Question asked by afasis on May 29, 2018
Latest reply on Jun 2, 2018 by afasis


I am using Alfresco Entreprise 5.2.3.
I created a service with org.apache.chemistry.opencmis  (client) 1.1.0 with atompub connection, which creates folders and saves documents to a repository /Sites/bdes/documentLibrary/extraitconforme/  that I can view with alfresco webpage :
http://localhost:9080/share/page/site/bdes/document-details?nodeRef=workspace://SpacesStore/7d1cbc32-747d-44ba-9d1a-6a0709be4b77.  Works perfectly.


I also want to make a document publicly downloadable with no authentication.
Meaning after saving of the document I want to make it immediatly publicly shareble for download only.
Because there is nothing in chemistry doing this I start using Alfresco's following webscript.



Because this is a httppost request to the server, I cannot do this without authentication.
So I got an authtenication ticket first by the webscript : /alfresco/service/api/login


Than I call the "quickshare" webscript : /alfresco/service/api/internal/shared/share/workspace/SpacesStore/{node_id}.

to make the document publicly shareble and get a share_id.
Because I don't know yet how to get the nodeId (unless its the same as the docId from Document

I get de the id from sharelink in alfresco webpage in the share field and add it to the httppost

So My httppost to make the file shareable will be :






when putting this in my browser (firefox) , I get :


code    500
name    "Internal Error"
description    "An error inside the HTTP server which prevented it from fulfilling the request."
message    "04290072 Wrapped Exception (with status template): 04290094 Unable to find: workspace/SpacesStore/7d1cbc32-747d-44ba-9d1a-6a0709be4b77"
exception    ""
callstack    []
server    "Enterprise v5.2.3 (r852994b1-b12) schema 10.065"
time    "29-mei-2018 18:22:04"


What am I doing wrong here?..
Can I even use ticket to get a document publicaly downloadable?


Can anyone please help me out.

I've read a lot of article about this, still I dont see whats wrong here.