Not enough permissions to add attachment to Invoice
Hey, I have been trying to automate some attachment processing and hit an unexpected permissions issue. My goal is to automate the upload of some files as attachments of Invoices. My steps were the following:
- Created a new self-client through the Developer Space UI
- Downloaded the self-client
- Got the Refresh token and first access token
- Sent a POST request to: https://books.zoho.com/api/v3/invoices/{INVOICE_ID}/attachment
POST req; Upload attachment
- POST /api/v3/invoices/INVOICE_ID/attachment?organization_id=ORG_ID HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, br
Authorization: Bearer
{ACCESS_TOKEN}
Connection: keep-alive
Content-Length: 16045
Content-Type: multipart/form-data; boundary=697684a1c19f4bf4ada93be359205fb8
Host: books.zoho.com
User-Agent: HTTPie/3.2.1
+-----------------------------------------+
| NOTE: binary data not shown in terminal |
+-----------------------------------------+
With the following command:
And got:
- {
"code": 104003,
"message": "You don't have permission to perform this operation. Please contact your Administrator."
}
This is the scope I'm using for the self-client:
"scope": [
"ZohoBooks.invoices.CREATE",
"ZohoBooks.invoices.READ",
"ZohoBooks.invoices.UPDATE",
"ZohoBooks.invoices.DELETE"
],
(I concatenate all those values in a single line, separated by comma).
Notes:
- I can successfully send a READ (get) request to the same invoice_id
- The same behavior is observed in other Objects (can READ, cannot WRITE)
I'm guessing a box needs to be checked somewhere throughout the Admin Panel?
Bonus question: According to the docs (
here), one can only upload gif, png, jpeg, jpg, bmp and pdf files. Is there a reason for this? I would like to be able to upload xlsx files, as can be easily done through the UI.
Thank you :)