I have a data template with multiple files associated to it, and trying to write a Deluge script that will fetch files associated with this data template.
I created the script below based on the WorkDrive API documentation, one request uses the data templates endpoint while the other uses the search endpoint. Both requests are returning empty responses, even though I know the data template has files associated.
What am I doing wrong here? Is there any way to find a specific file via API based on a value in a data template field?
- dataTemplate_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
- header = Map();
- header.put("Accept","application/vnd.api+json");
- response = invokeurl
- [
- url :"https://www.zohoapis.com/workdrive/api/v1/datatemplates/" + dataTemplate_id + "/files"
- type :GET
- headers:header
- connection:"wdrive"
- ];
- info response;
- //
- //
- team_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
- query = "test";
- params = "?search%5Ball%5D=" + query + "&filter%5Bdatatemplate%5D=" + dataTemplate_id;
- info params;
- response = invokeurl
- [
- url :"https://www.zohoapis.com/workdrive/api/v1/teams/" + team_id + "/records" + params
- type :GET
- headers:header
- connection:"wdrive"
- ];
- info response;