/api/qmail/db/contacts/list-popular

GET

Return up to limit contacts from the local contacts directory.

Description

Returns the first limit contacts from the local SQLite contacts table. The endpoint name reflects the intent — eventually this will rank by recent / frequent contact — but today the popularity fields (contact_count, popularity, days_since_last_contact) are returned as 0.

Use this for "Suggested Contacts"

Even with placeholder popularity, this endpoint is a useful "give me a few contacts to put in the autocomplete" call.

Parameters

ParamTypeRequiredDescription
limitintNoDefault 10, clamped to 1..100.

Response

{
  "command": "contacts-popular",
  "success": true,
  "count": 2,
  "limit": 10,
  "contacts": [
    {
      "serial_number": 8189,
      "denomination": 1,
      "user_id": "JANE.SMITH.kilo@8189",
      "first_name": "Jane",
      "middle_name": "",
      "last_name": "Smith",
      "auto_address": "JANE.SMITH.kilo@8189",
      "description": "co-worker",
      "trust_level": 0,
      "user_notes": "",
      "contact_count": 0,
      "popularity": 0,
      "days_since_last_contact": 0
    }
  ]
}

Errors

HTTPMessage
500Failed to list contacts

Example

curl "http://localhost:8081/api/qmail/db/contacts/list-popular?limit=5"

Related