Copy folder using REST API

how to copy folder/document using REST api?

Comments

  • The basic operation means POSTing to /nodes what (original_id) and where (parent_id), for example:

    POST /otcs/cs/api/v1/nodes
    body={"name":"new name","parent_id":299037,"original_id":985109}
    

    Including the catts & atts of the original node, for example:

    POST /otcs/cs/api/v1/nodes
    body={"name":"new name","parent_id":299037,"original_id":985109,
          "roles":{"categories":{"inheritance":0}}}
    

    Setting cats & atts of the target folder, for example:

    POST /otcs/cs/api/v1/nodes
    body={"name":"new name","parent_id":299037,"original_id":985109,
          "roles":{"categories":{"inheritance":1,"destination":{
            "1165353":{"1165353_2":"test value","1165353_3":null,"1165353_6":false}}}}}
    

    Merging cats & atts of the original node and of the target folder, for example:

    POST /otcs/cs/api/v1/nodes
    body={"name":"new name","parent_id":299037,"original_id":985109,
          "roles":{"categories":{"inheritance":2,"merged":{
            "1165353":{"1165353_2":"test value","1165353_3":null,"1165353_6":false}}}}}
    

    The best "learning tool" about how to perform the CS REST API calls are the CS UI Widgets. If you install them and knock up a testing page with the FolderBrowserWidget, you can do browse/add/copy/move/reserve/unreserve/delete and watch the REST API calls "done by the master" in the browser debugging tools ;-)

  • thank you Ferdinand. it worked well

  • Hi Ferdinand

    DO you have any Java sample code to copy the folders in OTMM?

    Thanks
    Samer