Can't add attachment to message in outlook add-in using Outlook rest API

后端 未结 1 1302
予麋鹿
予麋鹿 2021-01-28 04:49

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

相关标签:
1条回答
  • 2021-01-28 04:57

    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.

    0 讨论(0)
提交回复
热议问题