Zoho Creator to Zoho CRM - Create new record with attachments

Zoho Creator to Zoho CRM - Create new record with attachments

I am trying to create a new record in our CRM when a new record is created in Zoho Creator. This works well with simple fields, but I am having trouble figuring out how to pass out an attachment. 

  1. link1 = "https://creatorexport.zoho.com/paulina108/dev-app/View_All_Visits/";
  2. recordid = input.ID;
  3. link2 = "/patientAttachments&privatelink=9C2k9U29NCUwF7XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  4. attachmentURL = link1 + recordid + link2;

I would then use this URL with zoho.crm.attachfiles as the file object along with the Record ID but it isn't working.

Any help would be appreciated.