Ayoub Idelhoussain Ayoub Idelhoussain - 1 year ago 97
reST (reStructuredText) Question

copy model folder using Rest API

I'm working with Alfresco Community edition , and i wanna Copy a folder using the Api only because i don't have access to js CMIS , i found so Url to post my Data to but i'm always blocked by an http 401 error , even though my ticket is valide and i also add to the header the authorisation data.

i have both the source folder nodRef :

this is the model folder :


and the destination parent Id (where the copied folder should be :


any help from you guys is appreciated . Thank you

from the documentation i do a POST to this adress

in the header i need
authorization : basic 'base64_encode(ROLE_TICKET:$ticket'

Answer Source
  1. Authorization, you can use:

    • query param PARAM_ALF_TICKET = "alf_ticket":

    • or header AUTHORIZATION_HEADER = "Authorization":

      Authorization: Basic base64_encode(user+":"+password)
  2. Copy Node REST API (available in Alfresco 5.2 and newer versions):

    curl -X POST 
    --header 'Content-Type: application/json' 
    --header 'Accept: application/json' 
    --header 'Authorization: Basic eW91LWFyZTp0aGUtYmVzdC1oYWNrZXI7KQ==' 
    -d '{
      "targetParentId": "new-parent-folder-node-id",
      "name": "new-node-name"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download