Get details about contacts
Added by IBM contributorAnna G O'Neal | Edited by Claudia R Elbourn on June 26, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Get details about individual contacts.

Table 1. API details

Method Request URL
REPORT http://www.domain.com/carddav/users/user%3Aemail.com/Contacts/


The following code provides a sample implementation of the API. For details about using the API in your own development environment, see the Internet Engineering Task Force (IETF) Request for Comments (RFC) resources at the end of this topic.

Sample request


XML Body:

<?xml version="1.0" encoding="UTF-8"?>

<B:addressbook-multiget xmlns:B="urn:ietf:params:xml:ns:carddav">

<A:prop xmlns:A="DAV:">

<A:getetag/>

<B:address-data/>

</A:prop>

<A:href xmlns:A="DAV:">/carddav/users/user%3Aemail.com/Contacts/10737</A:href>

<A:href xmlns:A="DAV:">/carddav/users/user%3Aemail.com/Contacts/11920</A:href>

<A:href xmlns:A="DAV:">/carddav/users/user%3Aemail.com/Contacts/11088</A:href>

</B:addressbook-multiget> 


Sample response


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<multistatus xmlns="DAV:" xmlns:ns2="urn:ietf:params:xml:ns:carddav" xmlns:ns3="http://calendarserver.org/ns/">

<response>

<href>/carddav/users/user:email.com/Contacts/10737</href>

<propstat>

<prop>

<getetag>2011-11-22 04:17:24.0</getetag>

<ns2:address-data>BEGIN:VCARD&#xD;

VERSION:3.0&#xD;

UID:10733&#xD;

N:Chan;Sarah;&#xD;

FN:Sarah Chan &#xD;

ORG:;&#xD;

EMAIL;TYPE=work:yy@email.com&#xD;

TEL;TYPE=work:852-21225678&#xD;

TEL;TYPE=WORK,FAX:852-2822-5678&#xD;

ADR;TYPE=work;TYPE=pref:;;;;;;ch;&#xD;

END:VCARD&#xD;

</ns2:address-data>

</prop>

<status>HTTP/1.1 200 OK</status>

</propstat>

</response>

<response>

<href>/carddav/users/user:email.com/Contacts/11920</href>

<propstat>

<prop>

<getetag>2011-11-22 04:17:43.0</getetag>

<ns2:address-data>BEGIN:VCARD&#xD;

VERSION:3.0&#xD;

UID:11281&#xD;

N:Lo;Raymond;&#xD;

FN:Raymond Lo &#xD;

ORG:;&#xD;

EMAIL;TYPE=work:rl@email.com&#xD;

ADR;TYPE=work;TYPE=pref:;;;;;;ch;&#xD;

END:VCARD&#xD;

</ns2:address-data>

</prop>

<status>HTTP/1.1 200 OK</status>

</propstat>

</response>

<response>

<href>/carddav/users/user:email.com/Contacts/11088</href>

<propstat>

<prop>

<getetag>2011-11-22 04:17:30.0</getetag>

<ns2:address-data>BEGIN:VCARD&#xD;

VERSION:3.0&#xD;

UID:10924&#xD;

N:Wong;Rosie;&#xD;

FN:Rosie Wong &#xD;

ORG:;&#xD;

EMAIL;TYPE=work:rw@email.com&#xD;

TEL;TYPE=work:852-2812-3456&#xD;

TEL;TYPE=WORK,FAX:852-2822-3456&#xD;

ADR;TYPE=work;TYPE=pref:;;;;;;ch;&#xD;

END:VCARD&#xD;

</ns2:address-data>

</prop>

<status>HTTP/1.1 200 OK</status>

</propstat>

</response>

</multistatus>

 

Related Resources

HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)