Workdrive file uplaod API Error : "LESS_THAN_MIN_OCCURANCE"

Workdrive file uplaod API Error : "LESS_THAN_MIN_OCCURANCE"

https://help.zoho.com/portal/en/ticket/4017421689571 This is a continuation of a previous question.


I am currently developing a widget on CRM using React. I have successfully connected to WorkDrive using the CONNECTION in the JavaScript SDK as described in the document at https://help.zwidgets.com/help/latest/ZOHO.CRM.CONNECTION.html


Below is a sample source code:

function createFileOnZoho(filename, parent_id, file, override = true) {
  let conn_name = "workdrive";

  const formData = new FormData();
  formData.append("filename", "test.png");
  formData.append("parent_id", parent_id);
  formData.append("override-name-exist", "true");
  formData.append("content", file);

  let req_data = {
    headers: {
      Accept: "application/vnd.api+json",
    },
    parameters: {
      data: {
        attributes: formData,
      },
      type: "files",
    },
    method: "POST",
    url: "https://www.zohoapis.com/workdrive/api/v1/upload",
  };

  return new Promise(function (resolve, reject) {
    window.ZOHO.CRM.CONNECTION.invoke(conn_name, req_data).then(function (
      data
    ) {
      resolve(data);
    });
  });
}


I am receiving the following response, and it seems like I am sending the wrong type of parameters. Could you please tell me what might be the problem? I have tried various solutions but couldn't find the answer.

{ "code": "SUCCESS", "details": { "statusMessage": { "errors": [ { "id": "F000", "title": "LESS_THAN_MIN_OCCURANCE" } ] }, "status": "true" }, "message": "Connection invoked successfully", "status": "success", "$responseHeaders": { "x-ratelimit-remaining": null, "x-ratelimit-limit": null, "x-ratelimit-reset": null } }

I have confirmed that APIs using different POST methods are successful. Only file uploading API is failed.

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    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

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now