I am implementing an add-in for Outlook, the add-in receives the attachment and sends it to my server for processing. It works flawlessly at https://outlook.office.com , but does not start Outlook 2016 for Mac.
Here is the API I'm trying to access:
var getMessageUrl =Office.context.mailbox.restUrl + '/v2.0/me/messages/' + {messageID} + "/attachments/" + {attachmentID}; var attachmentID = Office.context.mailbox.item.attachments[0].id; var messageID = getItemRestId(); $.ajax({ url: getMessageUrl, dataType: 'json', headers: { 'Authorization': 'Bearer ' + outlookToken } }).done(function 1(response) {
Using Outlook 2016 for Mac, I get 401 from the above API.
Also, the auth_token that I get from calling getCallbackTokenAsync in Outlook 2016 for Mac is different from the one I get in the browser:
Office.context.mailbox.getCallbackTokenAsync({isRest: true}, function (result) { if (result.status === "succeeded") {
The values ββin my manifest are:
<Set Name="MailBox" MinVersion="1.3"/> <Permissions>ReadWriteMailbox</Permissions>
Can someone point out what I'm doing wrong here?
UPDATE According to Jason's suggestion, I checked the token that I received on jwt.io The token options vary in browser and in mac application.
On the Browser: "ver": "Exchange.Callback.V2" On the Mac App: "ver": "Exchange.Callback.V1"
How do I get outlook_mac_app to return a v2 token?