I have import 1000 contacts via VCard 3.0 import to nc.
Now I want to mass add a group, but I don’t want to click each contact by contact and set the group manually.
Is it possible to set the group in bulk?
If is not possible by the GUI, perhaps it is possible with UPDATE command in the database?
You can do it using the CardDAV interface. Details here: https://sabre.io/dav/building-a-carddav-client/. The hardest part is constructing the query properly. Here’s a near sample (it’s taken from working code, but I’ve manually trimmed it down a bit and removed language-specific constructs, and so it may have errors). In my requirement, I was pulling data from NC, whereas you want to do updates, so you’ll have to read some to convert my example to match your need.
First, you need a URL for the NC server you want to reach. Here’s an example of what I used:
You’ll need some headers in there. When I send the HTTP request, I include headers declaring the content type as “application/x-www-form-urlencoded” and the depth as 1. You’ll also need to pass user credentials. In my case, I created a new user in NC just for this, and shared my contacts with that user.
Finally, for retrieval at least, I needed to send XML to describe what I needed. Here’s the XML I sent: