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.