Adding Attachment to Desk Ticket via Deluge

Adding Attachment to Desk Ticket via Deluge

Hello,

My team has a process where some people are entering information into a workbook in Zoho Sheet, and we need to get a copy of workbook into a ticket in Desk.  We currently have a 'Submit' button on the Sheet that triggers a webhook to Flow, and from there we find the appropriate Desk Ticket and run a function to download a copy of the file (Sheet file as xlsx) and attach it to the Ticket.  

I'm able to get the file from Sheet just fine, but whenever I try to attach it I get an error saying Bad Request.  Here is a portion of the code where I grab the file and try to attach it..
  1. if(targetSheetId != null)
  2. {
  3. downloadParams = Map();
  4. downloadParams.put("method","workbook.download");
  5. downloadParams.put("format","xlsx");
  6. downloadSheet = invokeurl
  7. [
  8. url :"https://sheet.zoho.com/api/v2/download/" + targetSheetId
  9. type :GET
  10. parameters:downloadParams
  11. connection:"sheetconnection"
  12. ];
  13. info "Download? " + downloadSheet;
  14. info "is File? " + downloadSheet.isFile();
  15. //
  16. //
  17. ticketAttachment = Map();
  18. ticketAttachment.put("file",downloadSheet);
  19. attachFile = invokeurl
  20. [
  21. url :"https://desk.zoho.com/api/v1/tickets/" + ticketId + "/attachments"
  22. type :POST
  23. parameters:ticketAttachment
  24. connection:"deskconnection"
  25. ];
  26. info attachFile;
  27. }
The responses I get on my info statements are:
  1. [
    	"Download? Testing File.xlsx",
    	"is File? true",
    	{
    		"errorCode": "BAD_REQUEST",
    		"message": "Bad Request."
    	}
    ]
The Create Attachment api references to types of parameters needing to be passed and I imagine that is where I'm getting tripped up, but am not sure.  

Any help is appreciated!

      • Sticky Posts

      • Live Webinar - Work smarter with Zoho Desk and Zoho Workplace integration

        Hello customers! Zoho Desk and Zoho Workplace are coming together for a webinar on 14th May, 2024. Zoho Workplace is a suite of productivity apps for email, chat, docs, calls, and more at one single place. Zoho Desk is closely integrated with a few tools
      • Apple iOS 17 and iPadOS 17 updates for Zoho Desk users

        Hello Zoho Desk users! Apple recently announced the release of iOS 17 and iPad OS 17. These latest OS updates will help you stay productive and efficient, through interactive and seamless user experiences. Zoho Desk has incorporated the updates to help
      • Zoho Desk Partners with Microsoft's M365 Copilot for seamless customer service experiences

        Hello Zoho Desk users, We are happy to announce that Zoho Desk has partnered with Microsoft's M365 to empower customer service teams with enhanced capabilities and seamless experiences for agents. Microsoft announced their partnership during their keynote
      • Zoho Desk Cheat Sheet For The Year-End

        Check out these Zoho Desk best practices to end this year on a high and have a great one ahead! #1 Set Business (Holiday) Hours - If you have limited working hours, please make sure you restrict your business hours or set them as holidays for the coming days. Let your customers know when you will, and won't, be available. #2 Update the Annual Holiday List - Check the holidays for the new year and update the holiday schedule. Usually, holidays from the current year will be carried over for the next
      • Deprecation of older versions of ASAP Mobile SDK | Zoho Desk

        Hello, everyone.    Greetings from Zoho Desk ASAP!   In order to continue to deliver the best and most secure experience to our mobile SDK users. On account of the recent enhancements and updates to the mobile SDKs, we have planned to mark the older versions