Hi, my troubles are below.
1. I need to replace code "EWS" to "office365 Rest API" because
The deadline is approacing.
In my source, "targetGroup" is address for Microsoft.Exchange.WebServices.Data.MailboxType.PublicGroup.
I tried to search a function which can get members in PublicGroup in office365 REST API, but I can't.
How do I replace ?(Now using v1.0 in otherplace)
2. How do I get userID from user address.My Apprication is Calendar.
First: find user in PublicGroup.
Second : get userID from user.
Third : get schedule using userID.
Last : show schedule for a day.
EWS is easy to get schedle. But I can't in office365 REST API.
client.Users[userID].Calendar.Request().GetAsync();
What I have tried:
public class EWSHandler {
public static List<UserDataInfo> GetUserData(string userAddress, string userPassword, string targetGroup) {
var retval = new List<UserDataInfo>();
try {
ExchangeService service = new ExchangeService {
Credentials = new WebCredentials(userAddress, userPassword)
};
service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");
var myGroupMembers = service.ExpandGroup(targetGroup);
foreach (EmailAddress address in myGroupMembers.Members) {
retval.Add(new UserDataInfo() {
UserAddress = address.Address,
UserName = address.Name,
IsUser = (address.MailboxType == MailboxType.Mailbox ? true : false),
});
}
}
catch (ServiceResponseException ex) {
}
catch (Exception ex) {
}
return retval;
}
}