User Tools

Site Tools


api:pbx:phonebook:update

API : PBX : Phonebook Update

Request

This request will update a contact in the phonebook.

Shared contacts can be updated by everybody, personal contacts can be updated by the user for the employee self or by another employee who has the group right 'writePhonebook' on the employee.

URL https://api.telecomx.dk/pbx/phonebook/CONTACT_ID
Method POST
Access level PERSONAL if contact is personal or has group right 'writePhonebook' on the employee or contact is shared
VIEWER, MANAGER, OWNER if contact is personal and user has group right 'writePhonebook' or contact is shared
RESELLER, RESELLER_ADMIN or ADMIN if contact is shared.
Params CONTACT_ID Id Id of contact to update.
Body 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.
externalId String External ID, can be used to reference phonebook contacts from another system

Only the properties that shall be updated are required. Arrays must be provided in full to be updated.

Request body example

{
  "title": "The boss",
  "emailAddresses": [
    {
      "type": "HOME",
      "address": "myself@gmail.com"
    },
    {
      "type": "WORK",
      "address": "theboss@acmesoapandrope.com"
    }
  ]
}

Response

The response will be the newly created contact, if no errors occurred.

JSON object
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.

Example

{
  "_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
422 Type Type is missing or invalid
404 givenName Given name or Company is required
422 addresses[x].type Invalid type
422 addresses[x].street Missing or invalid street
422 addresses[x].zip Missing or invalid zip
422 addresses[x].country Missing or invalid country
422 phoneNumbers[].type Invalid type
422 phoneNumbers[].number Missing or invalid phone number
422 emailAddresses[].type Invalid type
422 emailAddresses[].address Missing or invalid e-mail address
422 shortNumber Short number is invalid
409 shortNumber Short number is already in use
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/pbx/phonebook/update.txt · Last modified: 2025/01/10 11:09 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki