Zoho Desk Attachments to Zoho WorkDrive
Hi,
I have a requirement to upload attachments to WorkDrive when threads are created in Desk tickets. I have a custom function correctly identifying the attachment URLs (which I am able to open in a browser) and am trying to use these URLs to upload to WorkDrive. I am successfully connecting to the API but get a response:
- {"id":"F000","title":"LESS_THAN_MIN_OCCURANCE"}
Here is my code snippet:
- fileName = attachment.get("name");
- fileUrl = attachment.get("href") + "?orgId=" + ORGID;
- stringURL = "https://www.zohoapis.com/workdrive/api/v1/upload";
- uploadMap = Map();
- uploadMap.put("parent_id","<FOLDER ID IS HERE>");
- uploadMap.put("content",fileUrl);
- uploadMap.put("filename",fileName);
- attributesMap = Map();
- attributesMap.put("attributes",uploadMap);
- attributesMap.put("type","files");
- dataMap = Map();
- dataMap.put("data",attributesMap);
- parameters = dataMap.toString();
- info parameters;
- mp = Map();
- mp.put("Accept","application/vnd.api+json");
-
- response = invokeurl
- [
- url : stringURL
- type : POST
- parameters:parameters
- headers: mp
- connection: "zworkdrive"
- ];
- info response;
Any idea what I am doing wrong or even if this is possible? Does the file need to be local or can it be via a URL as per my requirement?
Thanks!
Access your files securely from anywhere
Zoho Developer Community
Deliver unforgettable customer experiences
Deliver unforgettable customer experiences
New to Zoho Marketing Plus?
Everything you need to run your marketing
New to Zoho Marketing Plus?
Everything you need to run your marketing
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Sticky Posts
Ask the Experts: Five-hour live Q&A session with Zoho WorkDrive product experts
Hello all, We are excited to host the Ask the Experts session on July 18, 2024 between 2:00 PM – 7:00 PM IST. Whether you're just starting to use Zoho WorkDrive, or if you've been with us for a while, this session is an amazing opportunity to discuss
WorkDrive API Documentation
WorkDrive provides users and developers an extensive set of APIs to help integrate functionalities of Zoho WorkDrive with other Zoho applications and third-party tools. We have published the official WorkDrive API Documentation page for all external users.
March 15, 2023: Zoho Docs is discontinued
As of today (March 15, 2023) Zoho Docs is discontinued for all users. We would like to thank our customers for trusting us for so many years! Going forward, we're confident you'll enjoy using Zoho WorkDrive for all your advanced file management and collaboration
Support for auto-upgrade in TrueSync (for Windows)
WorkDrive TrueSync app now supports auto-upgrading to the latest version for Windows OS. You must manually download and install the TrueSync app version 3.4.0 to avail this feature. Download the latest TrueSync app for Windows (version 3.4.0) Supported
Introducing Collections
Create collection links to easily request any number of users to upload files to a particular folder. Once users upload their files, you will be able to view their submissions and manage their files effortlessly. Users don't need a WorkDrive account to
Zoho TeamInbox Resources
Zoho DataPrep Resources
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Qntrl Resources
Zoho Creator Resources
Zoho Campaigns Resources
Zoho CRM Resources
Zoho Show Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.