1

I am subscribing to EWS push notifications for calendar events and to log notifications.

I am using PHP-EWS: jamesiarmes/php-ews and Symfony 4.1

To subscribe, I'm using this code:

    $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;

At te present time, when I book a meeting I receive this notification:

{
      "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": ""
        }
      ]
    }

My problem is that I don't receive the ´ItemId´ or the ´ParentFolderId´. How can I receive these on the notification or how can I get the meeting that has been created?

  • How are you testing notifications? If you manually create, edit, or delete and item do you get an item id with it? Perhaps the events you're seeing without IDs are on the folder itself. – Richard Fuller Aug 13 '18 at 16:55
  • I try to create and update manually in exchange calendar and using ews to create in exchange calendar, and both case don't have ItemId! But if is in same folder should i least get "ItemId" to fetch that meeting? – Christophe Soares Aug 13 '18 at 17:35
  • Yes, my expectation is that for any notification you should get the ItemId. In the response you posted it's there but blank. I'm not sure why. Are you working on Office365 or on-prem? If you're in the cloud, your best bet would be to use [Microsoft Graph](https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/subscription_post_subscriptions) as that has the most investment. – Richard Fuller Aug 13 '18 at 17:57
  • I am working on-prem,at the meoment using Microsoft Exchange Server 2016! i am already using microsoft graph for the cloud part! Have you some ideia what i can try to fix my issue? – Christophe Soares Aug 13 '18 at 18:43

0 Answers0