Skip to main content

Last updated: 2024-06-07


GetHouseholdMember Method


In this topic:


Overview


Using a contact's object ID, you can retrieve a list of all members of the contact's household. If the household or contact does not exist, this method returns a status of OK.


The GetHouseholdMember method is invoked as part of the method operation.


Parameters


Parameter NameTypeRequired?Description
ContactIDStringYesThis is the object ID of the contact linked to the household.

Example


The following example request retrieves household member information for a contact with the object ID Contact.1.145:


XML
<request version='1.0'>
  <header>...</header>
  <method>
    <GetHouseholdMember>
      <ContactID>Contact.1.145</ContactID>
    </GetHouseholdMember>
  </method>
</request>

The response includes the object IDs and names of each household member:


XML
<response version="1.0">
  <header>
    <sessionClosed/>
  </header>
  <method>
    <GetHouseholdMember>
      <HouseHold id="HouseHold.1.292" _type="obj">
        <Name>Chen Family</Name>
        <HouseHoldMembers _type="objs">
          <HouseHoldMember id="HouseHoldMember.1.687" _type="obj">
            <Member>Head</Member>
            <Contact id="Contact.1.14561" _type="obj">
              <FirstName>Andrew</FirstName>
              <LastName>Chen</LastName>
            </Contact>
          </HouseHoldMember>
          <HouseHoldMember id="HouseHoldMember.1.688" _type="obj">
            <Member>Spouse</Member>
            <Contact id="Contact.1.14580" _type="obj">
              <FirstName>MJ</FirstName>
              <LastName>Chen</LastName>
            </Contact>
          </HouseHoldMember>
        </HouseHoldMembers>
      </HouseHold>
    </GetHouseholdMember>
  </method>
  <_status>OK</_status>
  <!--Cost 21 mill seconds.-->
</response>