Last updated: 2024-06-07
GetContactDOB Method
In this topic:
Overview
The GetContactDOB method returns all contacts whose birth dates fall within a specified date range and who are assigned to a particular SmartOffice user. The response includes each contact's first name, last name, contact ID and birth date.
The GetContactDOB method is invoked as part of the method operation.
Parameters
| Parameter Name | Type | Required? | Description |
|---|---|---|---|
UserID | String | Yes | This is the object ID of the user account assigned to contacts. |
FromDate | String | Yes | This is the first date in the date range. Use the format year-month-day. Example: 1950-01-01. |
ToDate | String | Yes | This is the last date in the date range. Use the format year-month-day. Example: 1960-01-01. |
Example
The following example request retrieves all contacts born between January 1, 1950, and December 31, 1955, to which the user with object ID User.1.2 has been assigned:
XML
<request version='1.0'>
<header>...</header>
<method>
<GetContactDOB>
<UserID>User.1.2</UserID>
<FromDate>1950-01-01</FromDate>
<ToDate>1955-12-31</ToDate>
</GetContactDOB>
</method>
</request>The response includes each contact's name, date of birth and object ID:
XML
<response version="1.0">
<header>
<sessionClosed/>
</header>
<method>
<GetContactDOB>
<Contact id="Contact.1.12" _type="obj">
<FirstName>Paulette</FirstName>
<LastName>Garner</LastName>
<Person id="Person.1.12" _type="obj">
<Dob>1952-07-03</Dob>
</Person>
</Contact>
<Contact id="Contact.1.14" _type="obj">
<FirstName>Genevieve</FirstName>
<LastName>Bates</LastName>
<Person id="Person.1.14" _type="obj">
<Dob>1954-10-16</Dob>
</Person>
</Contact>
</GetContactDOB>
</method>
<_status>OK</_status>
<_systime>2015-06-04T22:38:49</_systime>
<!--Cost 36 mill seconds.-->
</response>