GetImItems operation

Find information about the GetImItems EWS operation.

The GetImItems operation retrieves information about instant messaging (IM) groups and IM contact personas.

This operation was introduced in Exchange Server 2013.

Using the GetImItems operation

The GetImItems operation accepts group and contact item identifiers and returns a set of information about the groups and contacts. The property sets returned in the response are identified by extended properties, multiple contact identifiers, group identifiers, and extended property definitions as arguments.

GetImItems operation SOAP headers

The GetImItems operation can use the SOAP headers that are listed in the following table.

Header name Element Description
Identifies the user whom the client application is impersonating. This header is applicable to a request.
Identifies the culture, as defined in RFC 3066, "Tags for the Identification of Languages", to be used to access the mailbox. This header is applicable to a request.
Identifies the schema version for the operation request. This header is applicable to a request.
Identifies the version of the server that responded to the request. This header is applicable to a response.

GetImItems operation request example: Get detailed information about IM contacts and groups

The following example of a GetImItems operation request shows how to request detailed information about IM contacts and groups. A GetImItems operation can request one or more contact or group details. You can also use extended properties to get custom properties on groups and contacts. If a requested extended property does not exist on an item, the response will ignore the requested property and return the response for the default property set. This example shows you how to get the display name by using extended properties.


All item identifiers and change keys in this article have been shortened to preserve readability. Note that change keys are ignored by the service for this operation.

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap=""
      <t:RequestServerVersion Version="Exchange2013" />
   <soap:Body >
            <t:ItemId Id="AAMkADEzOTExYACABmEhpSAAA=" ChangeKey="EQAAABBmNDjF"/>
            <t:ItemId Id="AAMkADEzOTExYjJkBY7+0EAAA=" ChangeKey="EgAAAA=="/>
            <t:ExtendedProperty PropertyTag="0x3001" PropertyType="String"/>

The request SOAP body contains the following elements:

Successful GetImItems operation response

The following example shows a successful response to a GetImItems request to get an IM contact and group. The display name is requested in an extended property. IM contacts are returned in the form of a persona.

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="">
      <h:ServerVersionInfo MajorVersion="15" 
   <s:Body xmlns:xsi="" 
      <GetImItemsResponse ResponseClass="Success" 
            <Groups xmlns="">
                  <DisplayName>Exchange SDK Team</DisplayName>
                  <ExchangeStoreId Id="AAMkADEzQrAABY7+0EAAA=" ChangeKey="EgAAAA=="/>
                     <ItemId Id="AAMkADEzOTExYjeGgGqm4QrAABmEhpSAAA=" ChangeKey="EQAAAA=="/>
                        <ExtendedFieldURI PropertyTag="0x3001" PropertyType="String"/>
                        <Value>Exchange SDK Team</Value>
            <Personas xmlns="">
                  <PersonaId Id="AAQkADEzOTBZImBzN5J/uHXc="/>
                  <DisplayName>Tony Smith</DisplayName>
                  <DisplayNameFirstLast>Tony Smith</DisplayNameFirstLast>
                  <DisplayNameLastFirst>Tony Smith</DisplayNameLastFirst>
                        <SourceId Id="AAMkADEzhQaoeGgGqm4QrAABmEhpSAAA=" ChangeKey="EQArAABmNDjF"/>
                        <DisplayName>Lync Contacts</DisplayName>
                        <Value>Tony Smith</Value>
                           <ExtendedFieldURI PropertyTag="0x3001" PropertyType="String"/>
                           <Value>Tony Smith</Value>

The response SOAP body contains the following elements:

GetImItems operation error response

The GetImItems operation does not validate identifiers and will not return the expected ErrorInvalidImContactId or ErrorInvalidImGroupId error response if an invalid contact or group identifier is provided to the service.

See also