In my outlook web add-in I use Office.js's getCallbackTokenAsync
to get the token before connecting to EWS
in my asp.net back end.
ExchangeService service = new ExchangeService();
service.Url = new Uri(mailItem.ewsUrl);
service.Credentials = new OAuthCredentials(mailItem.ewsToken);
PropertySet ps = new PropertySet(
ItemSchema.Subject,
);
_email = EmailMessage.Bind(service, new ItemId(mailItem.itemID),ps);
//the following throws error
ConversationResponse response = service.GetConversationItems(convId,
properties,
null,
foldersToIgnore,
ConversationSortOrder.TreeOrderDescending);
Seems like this GetConversationItems
method is not allowed when I used the token retrieved by Office.js to initialize the EWS service. I tried to updated the manifest permission to the highest level to ReadWriteMailBox
but still not working. Seems like I can only use Office.js to call EWS
?
The token you get from getCallbackTokenAsync is only used to retrieve attachments on the current item or on the current item. For more information, please see the following link:
Best Regards,
Evan
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.