Reputation: 11
I am trying to fetch room list through EWS api 2.0, but getting list 0.
Here is my Sample code:
var RoomList = new List<RoomListData>();
List<string> userLists = new List<string>();
ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallBack;
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
service.Credentials = new NetworkCredential("username", "password");
service.TraceEnabled = true;
service.TraceFlags = TraceFlags.All;
ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallBack;
service.Url = new Uri("**************/ews/exchange.asmx");
EmailAddressCollection myRoomLists = service.GetRoomLists();
//Display the room lists.
foreach (EmailAddress address in myRoomLists)
{
RoomList.Add(new RoomListData()
{
Address = address.Address,
Id = address.Id,
MailboxType = address.MailboxType,
Name = address.Name,
RoutingType = address.RoutingType,
});
}
response.RoomList = RoomList;
Upvotes: 1
Views: 717
Reputation: 22032
There are no room lists configured by default in Exchange you need to create a RoomList using New-DistributionGroup -RoomList switch https://technet.microsoft.com/en-us/library/aa998856(v=exchg.160).aspx . People often confuse the AddressBook views (EG All Rooms) which you see in the GAL by default with RoomLists these aren't not the same thing.
Upvotes: 2