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 follow https://dev.office.com/docs/add-ins/outlook/use-rest-api?product=outlook this tutorial . For example I success to get some message details), but I have 2 problems:
I can't add attachment with outlook rest API call to message. I try to make call with the itemId like here:
https://outlook.office.com/api/v2.0/me/messages/" + itemId +"/attachments
The error I get is:
{"error":{"code":"ErrorAccessDenied","message":"The api you are trying to access does not support item scoped OAuth."}}
I try to change permissions(ReadWriteMailbox/ReadWriteItem) on manifest but nothing help..
Sometimes the call of Office.context.mailbox.getCallbackTokenAsync({ isRest: true }, function().... function work and return access token and sometimes return error , I don't know also what the reason. The error I get sometimes is:
OSF.DDA.AsyncResult error:OSF.DDA.Error status:"failed"
Hope you could help me , thanks all!!