Send data from Zoho CRM to Teamwork Project

Send data from Zoho CRM to Teamwork Project

Hello everyone,

I created a function that is supposed to set up a milestone in Teamwork Project (from teamwork.com) but I can't make it work. I don't get any response code so I'm kinda stuck here, can anyone tell me what I've been doing wrong ?

Here is the Teamwork doc, and the milestone reference. I noticed that Teamwork expect the POST request to be made with HTTPS, but the postURL doc from Zoho doesn't say anything about that, can it be an issue ?

Thanks in advance

Oh and here is the code :
  1. createTeamworkTask (string Quote_ID string Auth string Project_ID ) {
  2.   quoteID=input.Quote_ID.toLong();
  3.   //Get the data to be send
  4.   quoteData = zoho.crm.getRecordById("Quotes",quoteID);
  5.   quoteTitle=quoteData.get("Subject");
  6.   quoteText=quoteData.get("Description");
  7.   quoteDate=(quoteData.get("Valid Till")).toString();
  8.   deadline=quoteDate.replaceAll("-","");
  9.   //Prepare the data with mandatory fields filled up
  10.   teamworkData=map();
  11.   teamworkData.put("title",quoteTitle);
  12.   teamworkData.put("description",ifnull(quoteText,""));
  13.   teamworkData.put("responsible-party-ids","118535");
  14.   teamworkData.put("deadline",deadline);
  15.   teamworkDataLayer="[" + teamworkData + "]";
  16.   //Set the prepared data in valid JSON and format it the way Teamwork expect it to be
  17.   data=map();
  18.   data.put("milestone",teamworkDataLayer);
  19.   dataJSONString=data.toString().replaceAll("]\"","]");
  20.   dataJSONString=dataJSONString.replaceAll("\"\[","\[");
  21.   dataValidJSON=dataJSONString.replaceAll("\\\"","\"");
  22.   //Set header info, auth key is provided by a CRM variable
  23.   headerData=map();
  24.   headerData.put("Authorization",input.Auth);
  25.   headerData.put("Content-type","application/json");
  26.   header="[" + headerData + "]";
  27.   //The URL is composed with the project ID, provided by a CRM variable
  28.   url="https://urgh.teamwork.com/projects/" + input.Project_ID + "/milestones.json";
  29.   teamwork = postUrl(url,dataValidJSON,header,false);
  30.   info teamwork;
  31.   //Check if data has been send successfully and display a message according to situation
  32.   code=teamwork.get("responseCode");
  33.   response=teamwork.get("responseText");
  34.   if(code  !=  "200")
  35.   {
  36. message=((((("Une erreur est survenue, contactez un administrateur.") + "\n") + "Erreur ") + code) + " : ") + response;
  37.   }
  38.   else
  39.   {
  40. message="Jalon créé dans Teamwork";
  41.   }
  42.   return message;
  43. }