none
Best way of identifing calendar items via permanent id using EWS via SOAP RRS feed

  • Question

  • Hi!

    I am currently working on a simple tool to "create", "change" and "delete" calendar items over EWS (Exchange 2010).

    Creating an calendar item i get an "ITEMID" in the response of the webservice. While reading in different forums it is not recommended to use this ITEMID due to the problem that it can change over time (exchange security patches, moving a calendar item,...).

    Does anyone have a simple and valid solution for the problem e.g. using an other id like the "GlobalObjectId" and if yes how would this work?

    how do i get the "globalObjectId" of the created calendaritem and how can i find my calendaritem via SOAP using the "globalObjectId".

    I read a lot about this on different forums but couldn't find a solution that works. Thanks in advance for samples GETTING the "globalObjectId" and FINDING via "globalObjectId"

    cheers,

    bastian


    • Edited by bdrug Tuesday, September 2, 2014 2:58 PM
    Tuesday, September 2, 2014 2:56 PM

Answers

  • I'd suggest using the PidLidCleanGlobalObjectId instead of the GlobalObjectId  to get this you just need to use the GetItem operation after the appointment has been created and request that property be returned via the Extended Properties eg

      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="
    http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://sc
    hemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xml
    soap.org/soap/envelope/">
        <soap:Header>
          <t:RequestServerVersion Version="Exchange2013_SP1" />
        </soap:Header>
        <soap:Body>
          <m:GetItem>
            <m:ItemShape>
              <t:BaseShape>AllProperties</t:BaseShape>
              <t:AdditionalProperties>
                <t:ExtendedFieldURI DistinguishedPropertySetId="Meeting" PropertyId=
    "35" PropertyType="Binary" />
              </t:AdditionalProperties>
            </m:ItemShape>
            <m:ItemIds>
              <t:ItemId Id="AAMkADk0OTQ3NjhhLTUzM2UtNDliMi1iYzM4LWQ5Y2JhMmMyYTkxZgBG
    AAAAAABpy48RairITJtRzpjfXjnTBwAOv8A6wS4pSZxXkD7GUo9PAAAAiYaWAAB8PtJwmH78TaGH6N/g
    d2ToAACfo3z2AAA=" ChangeKey="DwAAABYAAAB8PtJwmH78TaGH6N/gd2ToAACfrwfM" />
            </m:ItemIds>
          </m:GetItem>
        </soap:Body>
      </soap:Envelope>

    To Find the Appointment use a FindItem request with a restriction on this property eg

      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="
    http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://sc
    hemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xml
    soap.org/soap/envelope/">
        <soap:Header>
          <t:RequestServerVersion Version="Exchange2013_SP1" />
        </soap:Header>
        <soap:Body>
          <m:FindItem Traversal="Shallow">
            <m:ItemShape>
              <t:BaseShape>AllProperties</t:BaseShape>
            </m:ItemShape>
            <m:IndexedPageItemView MaxEntriesReturned="10" Offset="0" BasePoint="Beg
    inning" />
            <m:Restriction>
              <t:IsEqualTo>
                <t:ExtendedFieldURI DistinguishedPropertySetId="Meeting" PropertyId=
    "35" PropertyType="Binary" />
                <t:FieldURIOrConstant>
                  <t:Constant Value="BAAAAIIA4AB0xbcQGoLgCAAAAABge03LMsfPAQAAAAAAAAA
    AEAAAAD5nx8jygldIp/Xmj4Y1fXk=" />
                </t:FieldURIOrConstant>
              </t:IsEqualTo>
            </m:Restriction>
            <m:ParentFolderIds>
              <t:DistinguishedFolderId Id="calendar" />
            </m:ParentFolderIds>
          </m:FindItem>
        </soap:Body>
      </soap:Envelope>

    That will return the EWSId of the calendar item that matches

    Cheers
    Glen

    • Marked as answer by bdrug Friday, September 12, 2014 9:58 AM
    Wednesday, September 3, 2014 4:54 AM

All replies

  • I'd suggest using the PidLidCleanGlobalObjectId instead of the GlobalObjectId  to get this you just need to use the GetItem operation after the appointment has been created and request that property be returned via the Extended Properties eg

      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="
    http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://sc
    hemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xml
    soap.org/soap/envelope/">
        <soap:Header>
          <t:RequestServerVersion Version="Exchange2013_SP1" />
        </soap:Header>
        <soap:Body>
          <m:GetItem>
            <m:ItemShape>
              <t:BaseShape>AllProperties</t:BaseShape>
              <t:AdditionalProperties>
                <t:ExtendedFieldURI DistinguishedPropertySetId="Meeting" PropertyId=
    "35" PropertyType="Binary" />
              </t:AdditionalProperties>
            </m:ItemShape>
            <m:ItemIds>
              <t:ItemId Id="AAMkADk0OTQ3NjhhLTUzM2UtNDliMi1iYzM4LWQ5Y2JhMmMyYTkxZgBG
    AAAAAABpy48RairITJtRzpjfXjnTBwAOv8A6wS4pSZxXkD7GUo9PAAAAiYaWAAB8PtJwmH78TaGH6N/g
    d2ToAACfo3z2AAA=" ChangeKey="DwAAABYAAAB8PtJwmH78TaGH6N/gd2ToAACfrwfM" />
            </m:ItemIds>
          </m:GetItem>
        </soap:Body>
      </soap:Envelope>

    To Find the Appointment use a FindItem request with a restriction on this property eg

      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="
    http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://sc
    hemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xml
    soap.org/soap/envelope/">
        <soap:Header>
          <t:RequestServerVersion Version="Exchange2013_SP1" />
        </soap:Header>
        <soap:Body>
          <m:FindItem Traversal="Shallow">
            <m:ItemShape>
              <t:BaseShape>AllProperties</t:BaseShape>
            </m:ItemShape>
            <m:IndexedPageItemView MaxEntriesReturned="10" Offset="0" BasePoint="Beg
    inning" />
            <m:Restriction>
              <t:IsEqualTo>
                <t:ExtendedFieldURI DistinguishedPropertySetId="Meeting" PropertyId=
    "35" PropertyType="Binary" />
                <t:FieldURIOrConstant>
                  <t:Constant Value="BAAAAIIA4AB0xbcQGoLgCAAAAABge03LMsfPAQAAAAAAAAA
    AEAAAAD5nx8jygldIp/Xmj4Y1fXk=" />
                </t:FieldURIOrConstant>
              </t:IsEqualTo>
            </m:Restriction>
            <m:ParentFolderIds>
              <t:DistinguishedFolderId Id="calendar" />
            </m:ParentFolderIds>
          </m:FindItem>
        </soap:Body>
      </soap:Envelope>

    That will return the EWSId of the calendar item that matches

    Cheers
    Glen

    • Marked as answer by bdrug Friday, September 12, 2014 9:58 AM
    Wednesday, September 3, 2014 4:54 AM
  • Hi Glen!

    Thanks a lot for the advice with the "PidLidCleanGlobalObjectId" and the given sample!

    Cheers, Bastian

    Thursday, September 11, 2014 8:29 AM