Transferring CRM Attachments to Workdrive

Transferring CRM Attachments to Workdrive

  1. relatedrecords = zoho.crm.getRelatedRecords("Attachments","Conditions",conId);
  2. attachid = List();
  3. for each ele in relatedrecords
  4. {
  5. attachementId = ele.get("id");
  6. attachid.add(attachementId);
  7. }
  8. for each ele in attachid
  9. {
  10. counter = 1;
  11. downloadFile = invokeurl
  12. [
  13. url: "https://www.zohoapis.com/crm/v2/Conditions/" + conId + "/Attachments/" + ele
  14. type: GET
  15. connection : "work_drive"
  16. ];
  17. resp2 = zoho.crm.attachFile("Deals",dealId,downloadFile);
  18. resp3 = zoho.workdrive.uploadFile(downloadFile, dealWD, "PlaceHolder"+counter+"", false, "xxxxxxxxxxx");
  19. counter = counter+1;
  20. info resp2;
  21. info resp3;
  22. }
This is my code. I get this error:
  1. An internal error occurred on executing the integration task 'zoho.workdrive.uploadFile'. Line Number:20

Has anyone had success taking .pdf attachments from the attachments related list and uploading them to the work drive?