Reputation: 11
I’m creating an add on that adds attachments to an event (think one click button to generate meeting notes and then add that newly created doc to the event as an attachment).
I’m using the example shown here Add attachments with a callback function.
I have the OAUTH scopes setup correctly (fixed an error that complained about that), but adding an attachment fails with this message:
An add-on cannot add attachments when canAddAttachments capability is false.
I’m not sure how to set this capability. This is on a standard Gmail account calendar, not a workspace account.
Thanks
Upvotes: 0
Views: 143
Reputation: 567
This seems to be possible only part of the file attachment flow (when user clicks attach button). Programmatically attaching from an eventOpenTrigger function doesn't work and will return the error:
"An add-on cannot add attachments when canAddAttachments capability is false."
In order to make it work create the callback function as described in this Google Doc
And make sure you have these 2 in your oauthScope:
"https://www.googleapis.com/auth/calendar.addons.current.event.read",
"https://www.googleapis.com/auth/calendar.addons.current.event.write"
As well as this in calendar events:
"currentEventAccess": "READ_WRITE",
Upvotes: 0
Reputation: 1
From the comment in the sample code, only the event in eventAttachmentTrigger can add an attachment.
/**
Upvotes: 0