How to upload a file to Zoho Catalyst?

How to upload a file to Zoho Catalyst?

I'm trying to upload a file to Catalyst using the following API. 
https://catalyst.zoho.com/help/api/file/upload-file.html
The problem is that I keep getting the following error.
  1. {"status":"failure","data":{"message":"Invalid input value for file","error_code":"INVALID_INPUT"}}
Here's my code in CRM. 
  1. getFile = invokeurl
  2. [
  3. url: "https://creator.zoho.com/api/v2/debbie/form-upload/report/Upload_Report/4270790000000301923"
  4. type: GET
  5. connection: "creator"
  6. ];
  7. name = getFile.get("data").get("Upload_Field").getSuffix("filepath=");
  8. //TestFile.pdf
  9. code = getFile.get("data").get("Upload_Field")
  10. //api/v2/debbie/form-upload/report/Upload_Report/4270790000000301923/Upload_Field/download?filepath=TestFile.pdf
  11. newCatalyst = Map();
  12. newCatalyst.put("code", code);
  13. newCatalyst.put("file_name", name);
  14. uploadToCatalyst = invokeurl
  15. [
  16. url :"https://api.catalyst.zoho.com/baas/v1/project/11711000000010382/folder/11711000000019052/file"
  17. type :POST
  18. parameters: newCatalyst.toString()
  19. connection: "catalyst"
  20. ];
  21. info uploadToCatalyst;
getFile is an API call to the file I have stored in a creator report. The call returns a file path which I then pass into the upload API call. No matter which values I pass into this API call, I always get the exact same error. Does anyone know why I keep getting this error? I also tried calling the download api for creator to download the file and it still gives me the exact same error. 

  1. fileUrl = (getFile.get("data").get("Upload_Field")).getPrefix("?")
  2.  download = invokeurl
  3. [
  4. url :"https://creator.zoho.com" + fileUrl
  5. type :GET
  6. connection:"creator"
  7. ];