Will there be a CardDAV-API?

Nextcloud version: 18.0.1
Operating system and version: Linux (hosted on ISP)
PHP version: 7.3

The issue you are facing:

  1. Is or will there be any way to interact with the NextCloud-CardDAV-Server via an API?
  2. If not yet: Is this planned?
  3. If not yet: Can there be a BugBounty to help get it done?

P.S. Same goes to CalDAV

The question makes no sense to me. Mind to explain what you are trying to do?

I want to have access to the data from an other app.

NC is offering connectivity for/integration into all main systems. All you have to set is the link, username and password. The rest is handled from these very apps, right?

Basically I want to build my own app to connect to NC-CardDAV-server.

That’s possible. Use any library that speaks CardDAV.

They both act as clients for CardDAV. Actually you need a http client to request the resources from the CardDAV provider.

Well, I do not want to use an other library which again uses a library etc.etc.
That also detours slightly from my original question!

I’m looking for a CardDAV-API similar to the WebDAV-API, https://docs.nextcloud.com/server/15/developer_manual/client_apis/WebDAV/index.html

Is there any chance to get exactly that?

Just access the CardDAV or CalDAV endpoint in the same way. Contacts or DavX5 might be a example how to implement a CardDAV or CalDAV client.

I’m looking for a CardDAV-API similar to the WebDAV-API, Webdav — Nextcloud 15 Developer Manual 15 documentation

CalDAV, like WebDAV, is already an API. Nextcloud didn’t invent these. The whole thing is described in this RFC: RFC 4791 - Calendaring Extensions to WebDAV (CalDAV) :wink:

1 Like

@marcelklehr I was asking for CardDAV, not CalDAV, althought this might become handy too!
While I’ve found the CardDAV description, https://tools.ietf.org/html/rfc6352, this does also not explain how to talk to the NC-Server.

@kesselb: Thank you for your ongoing responses here! Unfortunately this still doesn’t answer my question.
The hints you mentioned ("… access the CardDAV or CalDAV endpoint in the same way. Contacts or DavX5 might…") does not help here! Contacts is php and JS and DavX5… Java?

I plain and simple need an API (to be used with http-calls). To make it more clear: something like this: https://www.meetup.com/de-DE/meetup_api/

Assuming my Q 1) above is “No”, I’d like to repeat my Q 3)! How much would that be?

The answer to Q1 is yes. It’s already there and used by Contacts, DavX5 and any other client able to work with CardDAV.

Sorry, my bad.
CardDAV, like CalDAV, is an extension of the WebDAV protocol, itself based on HTTP.
CardDAV is described here: https://tools.ietf.org/html/rfc6352
The software mentioned by @kesselb implements this protocol and thus would be a good starting point if you like to implement it too, regardless of which language you are planning to do that in.

Try the following to speak to the cardDAV server:

curl -u "user:password" -X PROPFIND https://<nextcloud>/remote.php/carddav/

The question “Will there be a cardDAV API?” is like asking, “will there be an API to talk to my http server?” – There already is. It’s called HTTP – or cardDAV in your case.

3 Likes

Hi Pixi,

you can easily access all Card and Cal data by simple http calls (GET, POST, DELETE, PROPFIND, …) – it just not REST but this should not be a problem.

This helped me a lot: Building a CardDAV client - sabre/dav

You could also keep an eye on our FC Dav project which connects any FileMaker solution to a groupware server (like Nextcloud). As of now it only supports calendars and we are in private beta but CardDAV is next up on the roadmap.