Phonebook
Company phonebook and personal phonebooks of extensions. Contacts provide the name shown on phone displays for incoming calls, and can be marked as VIP (priority) or blocked. Scopes contacts:read / contacts:write.
Contacts
curl -s -X POST https://centralino.exovoip.it/api/v1/contacts \
-H "X-API-Key: $EXOPBX_API_KEY" -H "Content-Type: application/json" \
-d '{"name":"Laura Neri","company":"Neri Impianti","vip":true,
"numbers":[{"number":"+393471234567","label":"mobile"}]}'
curl -s "https://centralino.exovoip.it/api/v1/contacts/lookup?number=%2B393471234567" -H "X-API-Key: $EXOPBX_API_KEY"await pbx.contacts.create({
name: 'Laura Neri',
company: 'Neri Impianti',
vip: true,
numbers: [{ number: '+393471234567', label: 'mobile' }],
});
const { match } = await pbx.contacts.lookup({ number: '+393471234567' }); // nome mostrato sul display$pbx->contacts->create([
'name' => 'Laura Neri',
'company' => 'Neri Impianti',
'vip' => true,
'numbers' => [['number' => '+393471234567', 'label' => 'mobile']],
]);
$match = $pbx->contacts->lookup(number: '+393471234567')['match'];pbx.contacts.create({
"name": "Laura Neri",
"company": "Neri Impianti",
"vip": True,
"numbers": [{"number": "+393471234567", "label": "mobile"}],
})
match = pbx.contacts.lookup(number="+393471234567")["match"]ownerExtensionId: omitted for company contacts, set for an extension's personal contacts.numbers[]: one or more numbers with a label.vip,blocked: priority contact / blocked calls (action defined in the settings).- Search:
q,tag,vip,blocked,scope(all,company,personal).
GET /v1/contacts/lookup?number= returns the contact associated with a number, using the same rules the phone system applies for the display name.
Import and export
curl -s -X POST https://centralino.exovoip.it/api/v1/contacts/import \
-H "X-API-Key: $EXOPBX_API_KEY" -H "Content-Type: application/json" \
-d '{"format":"csv","onDuplicate":"update","data":"nome;telefono\nLaura Neri;+393471234567"}'
curl -s "https://centralino.exovoip.it/api/v1/contacts/export?format=vcard" -H "X-API-Key: $EXOPBX_API_KEY" -o rubrica.vcfawait pbx.contacts.import({
format: 'csv',
onDuplicate: 'update',
data: 'nome;telefono\nLaura Neri;+393471234567',
});
const vcf = await pbx.contacts.export({ format: 'vcard' });$pbx->contacts->import(['format' => 'csv', 'onDuplicate' => 'update', 'data' => "nome;telefono\nLaura Neri;+393471234567"]);
$vcf = $pbx->contacts->export(format: 'vcard');pbx.contacts.import_({"format": "csv", "onDuplicate": "update", "data": "nome;telefono\nLaura Neri;+393471234567"})
vcf = pbx.contacts.export(format="vcard")Import accepts CSV and vCard; onDuplicate chooses whether to update (update, default) or skip (skip) existing contacts. Export produces CSV or vCard.
Settings
PUT /v1/contacts/settings: name lookup enabled, lookup order, VIP prefix, company name on the display, action for blocked numbers.
Endpoints
| Request | Scope | SDK method |
|---|---|---|
GET /v1/contacts | contacts:read | contacts.list() |
POST /v1/contacts | contacts:write | contacts.create() |
GET /v1/contacts/lookup | contacts:read | contacts.lookup() |
POST /v1/contacts/import | contacts:write | contacts.import() |
GET /v1/contacts/export | contacts:read | contacts.export() |
GET /v1/contacts/settings | contacts:read | contacts.getSettings() · py: contacts.get_settings() |
PUT /v1/contacts/settings | contacts:write | contacts.setSettings() · py: contacts.set_settings() |
GET /v1/contacts/:id | contacts:read | contacts.get() |
PATCH /v1/contacts/:id | contacts:write | contacts.update() |
DELETE /v1/contacts/:id | contacts:write | contacts.delete() |
