1

I am trying to access office 365 groups using ews java api using impersonation. I am getting error:

 The SMTP address has no mailbox associated with it.

Code:

ExchangeCredentials credentials = new WebCredentials("admin@xxxx.onmicrosoft.com", "passwordxxx");
service.setCredentials(credentials);
service.setImpersonatedUserId(
            new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "group-smtp@xxx.onmicrosoft.com"));
FolderView folderView = new FolderView(50);
FindFoldersResults findFolderResults = service.findFolders(WellKnownFolderName.MsgFolderRoot, folderView);

The aim is to get channel messages of the team associated with this group. According to this: link

The channel messages are stored in group's mailbox's Conversation History/Team Chat folder

1 Answers1

0

If you want to access the messages in a Teams channel. You could use List Channel messages graph API

Subhasish
  • 504
  • 2
  • 9
  • Yes, I am very well aware of this API. But it has limitations it requires a signed user since it's a protected API. I believe there has to be some way to use **EWS or Powershell**. I am unable to find one. – Victor Marcus Jun 03 '20 at 07:40