GetItem (Contact)
Last modified: May 15, 2009
Applies to: Exchange Server 2007 | Exchange Server 2010
In this article
GetItem (Contact) Request Example
Successful GetItem (Contact) Response
Invalid GetItem (Contact) Request Example
GetItem (Contact) Error Response
The GetItem operation is used to get contact items from the Exchange store.
GetItem (Contact) Request Example
Description
The following example shows how to get an item from the Exchange store.
Code
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="https://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
<soap:Body>
<GetItem xmlns='https://schemas.microsoft.com/exchange/services/2006/messages'>
<ItemShape>
<t:BaseShape>AllProperties</t:BaseShape>
</ItemShape>
<ItemIds>
<t:ItemId Id="AAAtAE=" ChangeKey="EQAAABY" />
</ItemIds>
</GetItem>
</soap:Body>
</soap:Envelope>
Comments
The request to get an item from the Exchange store takes the same form for all item types. The responses to requests for different items will be different because different items return different information based on the response shapes.
Note
The item identifier has been shortened to preserve readability.
Request Elements
Successful GetItem (Contact) Response
Description
The following code example shows a successful GetItem response for the AllPropertiesBaseShape.
Code
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="https://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<t:ServerVersionInfo MajorVersion="8" MinorVersion="0" MajorBuildNumber="602" MinorBuildNumber="0"
xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" />
</soap:Header>
<soap:Body>
<GetItemResponse xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types"
xmlns="https://schemas.microsoft.com/exchange/services/2006/messages">
<m:ResponseMessages>
<m:GetItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Items>
<t:Contact>
<t:ItemId Id="AAAtAEA=" ChangeKey="EQAAABYq" />
<t:ParentFolderId Id="AQAtAEFk==" ChangeKey="AQAAAA==" />
<t:ItemClass>IPM.Contact</t:ItemClass>
<t:Sensitivity>Normal</t:Sensitivity>
<t:Body BodyType="Text" />
<t:DateTimeReceived>2006-08-18T17:31:18Z</t:DateTimeReceived>
<t:Size>382</t:Size>
<t:Importance>Normal</t:Importance>
<t:IsSubmitted>false</t:IsSubmitted>
<t:IsDraft>true</t:IsDraft>
<t:IsFromMe>false</t:IsFromMe>
<t:IsResend>false</t:IsResend>
<t:IsUnmodified>false</t:IsUnmodified>
<t:DateTimeSent>2006-08-18T17:31:18Z</t:DateTimeSent>
<t:DateTimeCreated>2006-08-18T17:31:18Z</t:DateTimeCreated>
<t:HasAttachments>false</t:HasAttachments>
<t:Culture>en</t:Culture>
<t:FileAs>SampleContact</t:FileAs>
<t:FileAsMapping>None</t:FileAsMapping>
<t:DisplayName>Tanja Plate</t:DisplayName>
<t:GivenName>Tanja</t:GivenName>
<t:Initials>T.P.</t:Initials>
<t:CompleteName>
<t:FirstName>Tanja</t:FirstName>
<t:LastName>Plate</t:LastName>
<t:Initials>T.P.</t:Initials>
<t:FullName>Tanja Plate</t:FullName>
</t:CompleteName>
<t:CompanyName>Northwind Traders</t:CompanyName>
<t:EmailAddresses>
<t:Entry Key="EmailAddress1">tplate@example.com</t:Entry>
<t:Entry Key="EmailAddress2">tplate@example.com</t:Entry>
</t:EmailAddresses>
<t:PhysicalAddresses>
<t:Entry Key="Business">
<t:Street>12345 67th Ave</t:Street>
<t:City>Whittier</t:City>
<t:State>CA</t:State>
<t:Country>USA</t:Country>
</t:Entry>
</t:PhysicalAddresses>
<t:PhoneNumbers>
<t:Entry Key="BusinessPhone">5625550199</t:Entry>
</t:PhoneNumbers>
<t:JobTitle>Project Manager</t:JobTitle>
<t:Surname>Plate</t:Surname>
</t:Contact>
</m:Items>
</m:GetItemResponseMessage>
</m:ResponseMessages>
</GetItemResponse>
</soap:Body>
</soap:Envelope>
Comments
The item identifier has been shortened to preserve readability.
Successful Response Elements
The following elements are used in the response for a GetItem request with a response shape of AllProperties for a contact item.
Invalid GetItem (Contact) Request Example
Description
The following code example shows an invalid request.
Code
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="https://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
<soap:Body>
<GetItem xmlns='https://schemas.microsoft.com/exchange/services/2006/messages'>
<ItemShape>
<t:BaseShape>AllProperties</t:BaseShape>
<t:IncludeMimeContent>true</t:IncludeMimeContent>
</ItemShape>
<ItemIds>
<t:ItemId Id="AAAtAEF=" ChangeKey="EQAAABq" />
</ItemIds>
</GetItem>
</soap:Body>
</soap:Envelope>
Comments
Item identifiers have been shortened to preserve readability.
GetItem (Contact) Error Response
Description
The following code example shows an error response to a GetItem (Contact) request.
Code
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="https://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<t:ServerVersionInfo MajorVersion="8" MinorVersion="0" MajorBuildNumber="602" MinorBuildNumber="0"
xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" />
</soap:Header>
<soap:Body>
<GetItemResponse xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types"
xmlns="https://schemas.microsoft.com/exchange/services/2006/messages">
<m:ResponseMessages>
<m:GetItemResponseMessage ResponseClass="Error">
<m:MessageText>Mime conversion is not supported for this item type.</m:MessageText>
<m:ResponseCode>ErrorUnsupportedMimeConversion</m:ResponseCode>
<m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
<m:Items />
</m:GetItemResponseMessage>
</m:ResponseMessages>
</GetItemResponse>
</soap:Body>
</soap:Envelope>
Error Response Elements
The following elements are used in the error response: