Upload CSV

Upload CSV

Hi I would be interested in using the API to submit a CSV file from Google Apps Script. So far, I am using this:

  1.   var url="https://reportsapi.zoho.com/api/xxxxxxxxx/yyyyyyyyyyyyyy/"+tabla;
      var ticket="zzzzzzzzzzzzzzzzz" ;//getTicket();
      url=url + "?ZOHO_ACTION=IMPORT&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=json&ZOHO_API_VERSION=1.0"
      var params={"ZOHO_API_KEY":"vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv"
    //              ,"ZOHO_ACTION":"IMPORT"
    //              ,"ZOHO_OUTPUT_FORMAT":"XML"
    //              ,"ZOHO_ERROR_FORMAT":"XML"
                  ,"ticket":ticket
    //              ,"ZOHO_API_VERSION":1.0
                  ,"ZOHO_FILE":file
                  ,"ZOHO_IMPORT_TYPE":"APPEND"
                  ,"ZOHO_ON_IMPORT_ERROR":"ABORT"
                  ,"ZOHO_AUTO_IDENTIFY":"true"
                  ,"ZOHO_CREATE_TABLE":"false"
                  ,"ZOHO_DATE_FORMAT":"dd-MM-YYYY"
                  ,"ZOHO_DELIMITER":"0"
                 };


      var options =
        {
          "method" : "post",
          "payload" : params,
          "contentType": "multipart/form-data"
        };
      //Logger.log("query:"+query);
      var response=UrlFetchApp.fetch(url, options);

however, I am getting an error:

returned code 500. Server response: { "response":{ "action":"IMPORT", "error":{ "code":7005, "message":"Sorry, an unexpected error occured when performing this operation. The error has been logged and will be looked into.\n\nIt would be of great help if you could provide us with additional information using the \'\'Feedback\'\' link at the top of this page." } } }