zoho workdrive forlder structure copy
I have a structured workdrive folder present in my workdrive .
I want whenever i create a new deal…this same structure should be copied to my new deals workdrive folder.
i had this code which was working fine.
But recently..its stopped working properly.
Instead of copying all the folders its only copying first page folders …not the folders inside it..
please help .
origin_folder = "e17fy3246e0123fa44a9bb85a6455cabb9092";
header = Map();
header.put("Accept","application/vnd.api+json");
response = invokeurl
[
url :"https://www.zohoapis.eu/workdrive/api/v1/files/" + origin_folder + "/files"
type :GET
headers:header
connection:"workdrive1"
];
//info response;
for each recs in response.get("data")
{
data = Map();
data_param1 = Map();
att_param1 = Map();
// Copy to folder where you want to copy
att_param1.put("resource_id",recs.get("id"));
data_param1.put("attributes",att_param1);
data_param1.put("type","files");
data.put("data",data_param1);
//POST Request to copy
response = invokeurl
[
url :"https://www.zohoapis.eu/workdrive/api/v1/files/" + parent1 + "/copy"
type :POST
parameters:data.toString()
headers:header
connection:"workdrive1"
];
info response;
}