Issue with attaching files to a task through the API
Hello!
I've implemented a function that creates a task for every new bill that is created but I haven't been able to attach to the task the files which are attached to the bill. I have encountered multiple errors but the most common one is error 33003: file not found
Here's the code snippet for my last attempt.
- headers_data.put("Authorization","Zoho-oauthtoken 1000.xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxx");
- bill_documents = invokeurl
- [
- url :"https://www.zohoapis.com/books/v3/bills/" + bill.get("bill_id") + "/attachment?organization_id=XXXXXXXX"
- type :GET
- headers:headers_data
- connection:conn
- ];
- if(bill_documents == null)
- {
- return;
- }
- bill_documents.setParamName("attachment");
- params = {"organization_id":"XXXXXXXX"};
- params = params.toString();
- res = invokeurl
- [
- url :"https://www.zohoapis.com/books/v3/tasks/" + task_id + "/attachment"
- type :POST
- parameters:params
- headers:headers_data
- files:bill_documents
- connection:conn
- ];
Can you please help me understand how my code is incorrect? The API documentation hasn't been helpful in this case.
Thanks in advance,
Luca