locked
EWS Managed API: Creating contact item and getting the Item Id of it RRS feed

  • Question

  • Hi,
    I would like to use the EWS managed API to create contact items in users' mailboxes, however, I immediately want to get the Item Id of the item I just created to store it in an SQL database (actually I'm converting it to the HexEntryID format). Is this possible in a simple way?
    Thank you!
    Friday, January 29, 2010 12:09 PM

Answers

  • After you create your contact by callling yourContact.Save(), you can access its Id by reading yourContact.Id.

    The Id property is of type ItemId, which holds a UniqueId property and a ChangeKey property which is necessary when updating an existing item.

    To convert the contact's Id into an HexEntryId, use the ExchangeService.ConvertId method.

    I hope this is simple enough :)


    David Claux | Program Manager - Exchange Web Services
    • Proposed as answer by David Claux - MSFT Saturday, January 30, 2010 12:05 AM
    • Marked as answer by Hoetz Saturday, January 30, 2010 7:47 AM
    Saturday, January 30, 2010 12:05 AM

All replies

  • After you create your contact by callling yourContact.Save(), you can access its Id by reading yourContact.Id.

    The Id property is of type ItemId, which holds a UniqueId property and a ChangeKey property which is necessary when updating an existing item.

    To convert the contact's Id into an HexEntryId, use the ExchangeService.ConvertId method.

    I hope this is simple enough :)


    David Claux | Program Manager - Exchange Web Services
    • Proposed as answer by David Claux - MSFT Saturday, January 30, 2010 12:05 AM
    • Marked as answer by Hoetz Saturday, January 30, 2010 7:47 AM
    Saturday, January 30, 2010 12:05 AM
  • Yes it is! Thank you!
    Saturday, January 30, 2010 7:47 AM