我遇到問題了解如何通過EWS Api獲取資源(房間)的日曆。作爲一個PHP包裝/庫我使用了以下內容:https://github.com/jamesiarmes/php-ewsPHP-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 = "[email protected]";
$response = $ews->FindItem($request);
我試圖將郵箱 - > EmailAddress的添加請求,但我得到了以下錯誤:
[MessageText] => The SMTP address has no mailbox associated with it. [ResponseCode] => ErrorNonExistentMailbox
我猜這裏的問題是,房間沒有與自身相關的具體郵箱,所以無法找到它。有沒有這方面的工作? 我可以直接訪問文件夾嗎?但是,如何找到房間日曆的ID?
你有沒有嘗試過使用像EWSEditor這樣的工具來查看房間資源?我可以連接到EWS,在Other下使用「查找約會」並輸入郵箱並取消約會。這樣,如果您可以連接並獲得約會,您可以查看約會,並查看您可能需要的文件夾ID和大多數其他信息。它可以提供線索,看是否一切正確。它在檢查後使編程更容易。我已經遠離PHP版本,因爲據我瞭解,它可能有問題獲得房間資源。我可以幫助更多,但我使用C#。 – donlaur