Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

email.Move from inbox to public folder gives error #438

Open
pascalgross opened this issue Jun 14, 2024 · 1 comment
Open

email.Move from inbox to public folder gives error #438

pascalgross opened this issue Jun 14, 2024 · 1 comment

Comments

@pascalgross
Copy link

When trying to move a mail item from an user's inbox to a public folder, I get the following API error:

'Access to this API requires the following permissions: 'MailExport-Internal.Read.All,MailExport-Internal.Read.Shared,MailExport-Internal.ReadWrite.All,MailExport-Internal.ReadWrite.Shared'. However, the application only has the following permissions granted: 'full_access_as_app,Mail.ReadWrite,Mail.Read,Mail.Send'.";error_category="invalid_grant"

I'm unable to grant those internal permissions but the app has "full_access_as_app" but it doesn't seem to be sufficient.

My codes looks like this:

let token = this._token;
if (!token) {
  token = await this.getToken();
}

const ews = new ExchangeService();
ews.Url = new Uri('https://outlook.office365.com/EWS/Exchange.asmx');
ews.Credentials = new OAuthCredentials(token);
ews.ImpersonatedUserId = new ImpersonatedUserId(
  ConnectingIdType.PrincipalName,
  principalName
);

const email = await EmailMessage.Bind(ews, new ItemId(mailItemId));
await email.Move(new FolderId(folderId));
@gautamsi
Copy link
Owner

you would need to assign some permissions to Azure app which may not be available anymore, switch to RBAC permission and try to assign permission in the Exchange Server app permission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants