Not enough permissions to add attachment to Invoice

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:

  1. Created a new self-client through the Developer Space UI
  2. Downloaded the self-client
  3. Got the Refresh token and first access token
  4. Sent a POST request to: https://books.zoho.com/api/v3/invoices/{INVOICE_ID}/attachment
POST req; Upload attachment
  1. 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:
  1. http --form --verbose post https://books.zoho.com/api/v3/invoices/{INVOICE_ID}/attachment organization_id=={ORG_ID} Authorization:"Bearer {ACCESS_TOKEN}" attachment@test.png
And got:
  1. {
        "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:
  1. "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:
  1. I can successfully send a READ (get) request to the same invoice_id
  2. 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 :)





                            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 WorkDrive Resources



                                                                  Zoho Campaigns Resources

                                                                    Zoho CRM Resources

                                                                    • CRM Community Learning Series

                                                                      CRM Community Learning Series


                                                                    • Tips

                                                                      Tips

                                                                    • 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