How do I get to the base URL for the CardDAV protocol?

2.6k Views Asked by At

I want to get the vCards that exist for an account. The server is google.com and I know the username/password. What I dont know is what the correct base url is. Doing a PROPFIND on google.com yields service not available. I had a similar problem with the icloud CardDAV (which I hacked by hardcoding the full address) which leads me to believe that there must be a proper way to discover the base url. Searching the RFC's i could not find it though. Furthermore, CardDAV apps seem to be able to find the data without any problem. Anyone have any ideas?

2

There are 2 best solutions below

0
On

Use https://google.com/.well-known/carddav as a starting point. This should work for iCloud as well.

0
On

I tried to use this github projet (for .NET). The README tells us to use this url (with a proper username) : https://google.com/m8/carddav/principals/__uids__/[email protected]/lists/

But I didn't achive to see my contacts or create new ones with this code, google just respond HTML 200 OK or 400 Bad Request.

This article indicate : https://google.com/m8/carddav/principals/__uids__/[email protected]/lists/default/

You can find the results of our research here. But some sources says that the CardDAV URL of google is no longer available.