OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
682 stars 95 forks source link

office.js callbacktoken for ews write operations. #441

Closed garrit-schroeder closed 5 years ago

garrit-schroeder commented 5 years ago

Hello and thanks in advance.

Is it possible to use the token returned by getCallbackTokenAsync() for write operations in the ews api?

My scenario is: I want to send the callbacktoken to a backendserver, which uses this token with the ews api to read the mail. Works great! Put after that i want to move the mail into another folder. That does not work. I get the error message: The requested web method is unavailable to this caller or application.

Is there a way i can use the users oauth token to make mailbox write operations via the ews api?

dmahugh commented 5 years ago

@exextoc do you know whether the token can be used as described here?

exextoc commented 5 years ago

The EWS token is item scoped so write operation won't work. However calling the API with isRest = true will return a mailbox scoped token that only works with REST and can be used to write.

kbrandl commented 5 years ago

Closing this issue, as the information provided by @exextoc seems to provide information that effectively addresses it. @garrit-schroeder if that's not the case (and you need further assistance), please comment here and we'll re-open the issue. Thanks!