Get the principal URI of a contact
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 the principal Uniform Resource Locator (URI) of users.

Table 1. API details

Method Request URL
PROPFIND https://www.domain.com/.well-known/carddav

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 version=”1.0” encoding=”UTF-8”>

<A:propfind xmlns:A=”DAV:”>

<A:prop>

<A:current-user-principal/>

<A:principal-URL/>

<A:resourcetype/>

</A:prop>

</A:propfind>


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/</href>

<propstat>

<prop>

<current-user-principal>

<href>/carddav/principals/user:email.com/</href>

</current-user-principal>

<resourcetype>

<principal></principal>

</resourcetype>

</prop>

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

</propstat>

<propstat>

<prop>

<principal-URL/>

</prop>

<status>HTTP/1.1 404 Not Found</status>

</propstat>

</response>

</multistatus>

 

Related Resources

HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)