Contact

Required product: Switch or Mobile

Contacts are used to show information on the other party in a call and are shared with the entire company.

  1. Properties
  2. Get all contacts
  3. Create a contact
  4. Get a single contact by ID
  5. Get a single contact by its phone number
  6. Update a contact
  7. Delete a contact

Contact properties

Name Description
id
{"id":1}
Contact ID.
name
{"name":"Firmafon ApS"}
Contact name.
number
{"number":"4571999999"}
Contact number.
number_formatted
{"number_formatted":"71 99 99 99"}
Contact number formatted for readability.
email
{"email":"kundeservice@firmafon.dk"}
Contact email.

Get all contacts

List all contacts in the authenticated company.

URL parameters

Name Description Example
number Show contacts with the specified number. 4571999999
limit Number of contacts to fetch.
default: 10, maximum: 100
30
id_gt_or_eq Show contacts where the id is greater than or equal to the specified value. 1234

Request

GET /api/v2/contacts

Response

Status: 200 OK
{
  "contacts": [
    {
      "id": 1,
      "name": "Firmafon ApS",
      "number": "4571999999",
      "number_formatted": "71 99 99 99",
      "email": "kundeservice@firmafon.dk"
    }
  ]
}

Create a contact

Create a contact in the authencitated company.

Properties

Name Description
name
{"name":"Firmafon ApS"}
Contact name.
number
{"number":"4571999999"}
Contact number.
email
{"email":"kundeservice@firmafon.dk"}
Contact email.

Request

POST /api/v2/contacts
{
  "contact": {
    "name": "Firmafon ApS",
    "number": "4571999999",
    "email": "kundeservice@firmafon.dk"
  }
}

Response

Status: 200 OK
{
  "contact": {
    "id": 1,
    "name": "Firmafon ApS",
    "number": "4571999999",
    "number_formatted": "71 99 99 99",
    "email": "kundeservice@firmafon.dk"
  }
}

Get a single contact by ID

Get a single contact by its ID.

GET /api/v2/contacts/:id

Response

Status: 200 OK
{
  "contact": {
    "id": 1,
    "name": "Firmafon ApS",
    "number": "4571999999",
    "number_formatted": "71 99 99 99",
    "email": "kundeservice@firmafon.dk"
  }
}

Get a single contact by its phone number

Get a single contact by its phone number.

Request

GET /api/v2/contacts/by_number/:number

Response

Status: 200 OK
{
  "contact": {
    "id": 1,
    "name": "Firmafon ApS",
    "number": "4571999999",
    "number_formatted": "71 99 99 99",
    "email": "kundeservice@firmafon.dk"
  }
}

Update a contact

Properties

Name Description
name
{"name":"Firmafon ApS"}
Contact name.
number
{"number":"4571999999"}
Contact number.
email
{"email":"kundeservice@firmafon.dk"}
Contact email.

Request

PUT /api/v2/contacts/:id
{
  "contact": {
    "name": "Firmafon ApS",
    "number": "4571999999",
    "email": "kundeservice@firmafon.dk"
  }
}

Response

Status: 200 OK
{
  "contact": {
    "id": 1,
    "name": "Firmafon ApS",
    "number": "4571999999",
    "number_formatted": "71 99 99 99",
    "email": "kundeservice@firmafon.dk"
  }
}

Delete a contact

Delete a contact.

Request

DELETE /api/v2/contacts/:id

Response

Status: 200 OK