I see this Access to Outlook RestAPI from an Outlook web Add-in question but nothing about attachment there.
I success to make outlook rest API request from my add-in fo
On #1, the error indicates that the token you have is scoped to just the current item. The REST API cannot use this kind of token for modifying attachments, so you get that error. The correct way that this should work is that you specify ReadWriteMailbox
in your add-in manifest, and then the token you get back should be a mailbox-scoped token. However, there is currently a bug with desktop Outlook's handling of getCallbackTokenAsync
that causes it to incorrectly still return an item-scoped token. That bug has been fixed but the update hasn't been publicly pushed yet.
If you want to check this, copy the token you get back and head over to https://jwt.io/. Paste it in the "Encoded" box and check the payload. If you see "ver": "Exchange.Callback.V1"
it's the item-scoped token. If you see "ver": "Exchange.Callback.V2"
it's the mailbox-scoped one.
On #2, I have no idea. It would be helpful if you could get a Fiddler trace on your Outlook client machine that catches the add-in making the token request.