Question

I'm having issues figuring out how to fetch the calendar of a resource (room) via the EWS Api. As a PHP Wrapper/Library I'm using the following: https://github.com/jamesiarmes/php-ews

$ews = new ExchangeWebServices('server', 'user', 'pw');
$request = new EWSType_FindItemType();
$request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW;
$request->ItemShape = new EWSType_ItemResponseShapeType();
$request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::DEFAULT_PROPERTIES;
$request->CalendarView = new EWSType_CalendarViewType();
$request->CalendarView->StartDate = '2014-02-05T15:18:34+03:00'; 
$request->CalendarView->EndDate = '2014-06-12T15:18:34+03:00'; 
$request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();
$request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();
$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;
$request->ParentFolderIds->DistinguishedFolderId->Mailbox->EmailAddress = "roomname@adress.xxx";
$response = $ews->FindItem($request);

I tried to add the Mailbox->EmailAddress to the request, but I get the following error:

[MessageText] => The SMTP address has no mailbox associated with it. [ResponseCode] => ErrorNonExistentMailbox

I guess the issue here is, that the room does not have an concrete mailbox associated with itself, so it cannot find it. Is there some kind of work around for this? Can I access the folder directly? But how do I find the ID of that rooms calendar?

Était-ce utile?

La solution

Is this room resource newly created? When you define a new room in Exchange it does not immediately create all the objects associated with it. In my experience it has to be "visited" first, e.g. via OWA. After that, there should be an actual mailbox associated with the SMTP. So try to look at this room in Outlook or OWA and then see if you still get that error.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top