Search code examples
microsoft-graph-apimicrosoft-graph-calendar

How to get full location from Microsoft Graph CalendarView Delta API request?


We found two different behaviours creating an event using Outlook Desktop and Outlook Web (OWA).

Consider create an event A with Outlook Desktop and event B with Outlook Web (OWA) with two "rooms" (location).

Result of event created with Outlook Desktop:

"locations": [
    {
      "displayName": "Room 1; Room 2",
      "locationType": "default",
      "uniqueId": "Room 1; Room 2",
      "uniqueIdType": "private"
    }
],

Result of event created with Outlook Web OWA:

"locations": [
    {
      "displayName": "Room 1",
      "locationType": "conferenceRoom",
      "uniqueId": "room1@xxx.onmicrosoft.com",
      "uniqueIdType": "directory",
      "locationUri": "room1@xxx.onmicrosoft.com",
      "address": {
        "street": "",
        "city": "",
        "state": "",
        "countryOrRegion": "",
        "postalCode": ""
      },
      "coordinates": {}
    },
    {
      "displayName": "Room 2",
      "locationUri": "room2@xxx.onmicrosoft.com",
      "locationType": "conferenceRoom",
      "uniqueId": "room2@xxx.onmicrosoft.com",
      "uniqueIdType": "directory",
      "address": {
        "street": "",
        "city": "",
        "state": "",
        "countryOrRegion": "",
        "postalCode": ""
      },
      "coordinates": {}
    }
],

Why when the event is created with Outlook Desktop the "locations" field comes shorten? Is it a bug?

How to always get the full "locations" (like Outlook Web OWA result), no matter with what Outlook version?

Thank you.


Solution

  • The location resource will on return populated properties. So if the application that created the Event doesn't specify an address, coordinates, or locationUri, then the API won't return them.