User Tools

Site Tools


api:pbx:phonebook:list

API : PBX : Phonebook list

Request

This request returns an employees phonebook with personal and/or company wide contacts.

Personal contacts can only be seen by the employee who owns them or another employee with group permission readPhonebook.

URL https://api.telecomx.dk/pbx/phonebook
Method GET
Access level PERSONAL, VIEWER, MANAGE, OWNER, RESELLER or ADMIN.
Query offset [optional] Index of the first item to return, default 0.
limit [optional] The number of items to return, default 50, min 1, max 50000.
filter [optional] Search query that will match against searchable fields.
customer [optional] Id of customer, defaults to users own customer. RESELLER, RESELLER_ADMIN or ADMIN only.
employee [optional] Id of employee, defaults to the user self.
type [optional] Type of contacts to return:
ALL - all contacts (default)
PERSONAL - employees personal contacts
SHARED - customers shared contacts.

Query examples

https://api.telecomx.dk/pbx/phonebook
https://api.telecomx.dk/pbx/phonebook?limit=20&offset=100
https://api.telecomx.dk/pbx/phonebook?filter=70305050
https://api.telecomx.dk/pbx/phonebook?type=PERSONAL&filter=hans

Response

JSON object
offset Index of the first contact returned.
limit Number of contacts to return. Note that the actual number of returned contacts may be lower.
total Number of contacts that can be returned when offset and limit is not considered. This is to be used for paging through the data.
contacts Array of contacts, see definition below.
Contact object
_id Id Unique id of the phonebook entry.
customer Id Id of the customer the entry belongs to.
employee Id If the entry belongs to a single employee, this is the id of the employee, otherwise null for shared.
type String Type of contact: PERSON, COMPANY.
givenName String Given name.
familyName String Family name.
company String Company name.
title String Title of person.
department String Department of person.
addresses Array List of addresses.
addresses[].type String Type of address: HOME, WORK.
addresses[].street String Street, housenumber, floor, door.
addresses[].zip String Zip code.
addresses[].city String City.
addresses[].state String State.
adressses[].country String ISO3166-2 country code.
phoneNumbers Array Phone numbers
phoneNumbers[].type String Number type: HOME, WORK, MOBILE, MAIN, OTHER.
phoneNumbers[].number String Phone number in E.164 format.
emailAddresses Array E-mail addresses
emailAddresses[].type String Type: HOME, WORK, MAIN, OTHER.
emailAddresses[].address String E-mail address.
shortNumber String Optional short number, 1-7 digits, that will call this contact. Only available on shared contacts.
notes String Notes about the contact.
picture Id Id of picture of contact, null if none.
externalId String External ID, can be used to reference phonebook contacts from another system

Example - normal

{
  offset: 0,
  limit: 50,
  total: 25,
  contacts: [
    {
      "_id": "12345678901234567890ABCD",
      "customer": "12345678901234567890AAAA",
      "employee": "12345678901234567890BBBB",
      "type": "PERSON",
      "givenName": "Peter",
      "familyName": "Hansen",
      "company": "Acme Soap & Rope ApS",
      "title": "Generel manager",
      "department": "Sales",
      "addresses": [
        {
          "type": "WORK",
          "street": "Paradise Apple Road 23",
          "zip": "2450",
          "city": "Copenhagen",
          "country": "DK"
        }
      ],
      "phoneNumbers": [
        {
          "type": "WORK",
          "number": "+4588888888"
        },
        {
          "type": "MOBILE",
          "number": "+4580808080"
        }
      ],
      "emailAddresses": [
        {
          "type": "HOME",
          "address": "myself@gmail.com"
        },
        {
          "type": "WORK",
          "address": "ph@acmesoapandrope.com"
        }
      ],
      "notes": "Some note about the contact",
      "picture": null
    }
  ]
}

Errors

Error code Message Description
404 customer Customer not found
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/pbx/phonebook/list.txt · Last modified: 2025/07/03 15:23 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki