Hello All,
here is example:
File Upload Field Name: Unsigned PDF
File Name: XYZ.PDF
Sample Code:
data = zoho.crm.getRecordById("Custom_Function_API",id);
pdf = data.get("Unsigned_PDF");
//info pdf;
//------------Get Old PDF----------------
for each rec in pdf
{
file_id = rec.get("file_Id");
response = invokeurl
[
url :"https://www.zohoapis.in/crm/v2/files?id=" + file_id
type :GET
connection:"crm1"
];
info response;
response.setparamname("file");
}
//--------------Delete File--------------------
//-----------My Try--------------------
for each r in pdf
{
//file_id = r.get("file_Id");
attachementId = r.get("attachment_Id"); info attachementId;//223553000000643001
res = invokeurl
[
url: "https://www.zohoapis.in/crm/v2/Custom_Function_API/" + id + "/Attachments/" + attachementId
type: DELETE
connection: "crm1"
];
//file.add(res);
info res;
}
Output:
- {"code":"OAUTH_SCOPE_MISMATCH","details":{},"message":"invalid oauth scope to access this URL","status":"error"}
- Note:
- *I think Connection Details in Scope have only ZohoCRM.files.CREATE & ZohoCRM.files.READ this not anything for DELETE*
This File I want Remove using Deluge.
Is there any solution for this!!! then Please Guide me Thank You.