Ga naar hoofdinhoud

Contacts Integration

PropertyValue
StatusImplemented (routes not yet registered)
StandardsGEMMA Klantcontactcomponent, CardDAV (RFC 6352)
AppOpenRegister

Overview

OpenRegister provides a contacts integration that links Nextcloud CardDAV contacts to register objects. It offers fuzzy matching by email, name, and organization, enriches matches with deep link URLs, and integrates with the Nextcloud Contacts Menu via a provider interface.

Current state: The backend services (ContactMatchingService, ContactsController, ContactsMenuProvider) are fully implemented, but the API routes for ContactsController are not yet registered in appinfo/routes.php. The ContactsMenuProvider (which hooks into the Nextcloud contacts menu) is functional and does not require API routes.

Key Components

ComponentFilePurpose
ContactMatchingServicelib/Service/ContactMatchingService.phpCore matching engine with email/name/org scoring
ContactsControllerlib/Controller/ContactsController.phpREST API for contact matching and object linking
ContactsMenuProviderlib/Contacts/ContactsMenuProvider.phpNextcloud IProvider integration for contacts menu
ContactServicelib/Service/ContactService.phpCardDAV contact CRUD operations
ContactLinklib/Db/ContactLink.phpEntity for contact-to-object links
ContactLinkMapperlib/Db/ContactLinkMapper.phpDatabase mapper for contact links

Matching Scores

The ContactMatchingService uses a weighted confidence scoring system:

Match TypeConfidenceDetails
Email (exact)1.0Primary identifier, highest confidence
Name (full match)0.7All name parts match
Name (partial match)0.4Some name parts match
Organization0.5Organization name match

Matching results are cached in APCu with a TTL of 60 seconds.

API Endpoints (Not Yet Routed)

The following endpoints exist in ContactsController but are not registered in routes.php:

MethodIntended URLController MethodDescription
GET/api/contacts/matchmatch()Fuzzy match contacts by email/name/org
GET/api/objects/{register}/{schema}/{id}/contactsindex()List contacts linked to an object
POST/api/objects/{register}/{schema}/{id}/contactscreate()Link a contact to an object
PUT/api/objects/{register}/{schema}/{id}/contacts/{contactId}update()Update a contact link
DELETE/api/objects/{register}/{schema}/{id}/contacts/{contactId}destroy()Remove a contact link
GET/api/contacts/{contactUid}/objectsobjects()List objects linked to a contact

Match Endpoint Parameters

ParameterTypeRequiredDescription
emailstringOne of email/name requiredEmail address to match
namestringOne of email/name requiredDisplay name to match
organizationstringNoOrganization name for additional scoring

Match Response

{
"matches": [
{
"contactUid": "abc-123",
"displayName": "John Doe",
"email": "john@example.com",
"confidence": 1.0,
"deepLinks": [...]
}
],
"total": 1
}

ContactsMenuProvider

The ContactsMenuProvider implements OCP\Contacts\ContactsMenu\IProvider and is registered automatically with Nextcloud. When a user clicks a contact in the Nextcloud header contacts menu, the provider enriches the contact entry with links to related OpenRegister objects.

API Test Results (2026-03-25)

EndpointHTTP StatusResult
GET /api/contacts/match?email=admin@example.com404Routes not registered
GET /api/contacts/match?name=Admin404Routes not registered

The 404 responses confirm that the ContactsController routes need to be added to appinfo/routes.php before the API is usable.