1

我正在订阅日历事件的 EWS 推送通知并记录通知。

我正在使用 PHP-EWS:jamesiarmes/php-ews 和 Symfony 4.1

要订阅,我正在使用以下代码:

    $eventTypes = new NonEmptyArrayOfNotificationEventTypesType();
    $eventTypes->EventType[] = NotificationEventTypeType::CREATED_EVENT;
    $eventTypes->EventType[] = NotificationEventTypeType::MODIFIED_EVENT;
    $eventTypes->EventType[] = NotificationEventTypeType::DELETED_EVENT;
    $eventTypes->EventType[] = NotificationEventTypeType::COPIED_EVENT;
    $eventTypes->EventType[] = NotificationEventTypeType::MOVED_EVENT;

    $folderIDs = new NonEmptyArrayOfBaseFolderIdsType();
    $folderIDs->DistinguishedFolderId = new DistinguishedFolderIdType();
    $folderIDs->DistinguishedFolderId->Id = DistinguishedFolderIdNameType::CALENDAR;

    $pushSubscription = new PushSubscriptionRequestType();
    $pushSubscription->FolderIds = $folderIDs;
    $pushSubscription->EventTypes = $eventTypes;
    $pushSubscription->StatusFrequency = $this->statusFrequency;
    $pushSubscription->URL = $this->subscriptionUrl;


    $subscribe_request = new SubscribeType();
    $subscribe_request->PushSubscriptionRequest = $pushSubscription;

目前,当我预订会议时,我会收到以下通知:

{
      "SubscriptionId": "xxxxxxxx",
      "PreviousWatermark": "xxxxxxxx",
      "MoreEvents": "false",
      "CreatedEvent": {
        "Watermark": "xxxxx",
        "TimeStamp": "2018-08-13T13:18:12Z",
        "ItemId": "",
        "ParentFolderId": ""
      },
      "ModifiedEvent": [
        {
          "Watermark": "xxxxxxx",
          "TimeStamp": "2018-08-13T13:18:13Z",
          "ItemId": "",
          "ParentFolderId": ""
        },
        {
          "Watermark": "xxxxxxx",
          "TimeStamp": "2018-08-13T13:18:13Z",
          "FolderId": "",
          "ParentFolderId": ""
        }
      ]
    }

我的问题是我没有收到“ItemId”或“ParentFolderId”。如何在通知中接收这些信息,或者如何获取已创建的会议?

4

0 回答 0