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":"Relatel A/S"}
Contact name.
number
{"number":"4571999999"}
Contact number.
number_formatted
{"number_formatted":"71 99 99 99"}
Contact number formatted for readability.
email
{"email":"kundeservice@relatel.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": "Relatel A/S",
      "number": "4571999999",
      "number_formatted": "71 99 99 99",
      "email": "kundeservice@relatel.dk"
    }
  ]
}

Create a contact

Create a contact in the authencitated company.

Properties

Name Description
name
{"name":"Relatel A/S"}
Contact name.
number
{"number":"4571999999"}
Contact number.
email
{"email":"kundeservice@relatel.dk"}
Contact email.

Request

POST /api/v2/contacts
{
  "contact": {
    "name": "Relatel A/S",
    "number": "4571999999",
    "email": "kundeservice@relatel.dk"
  }
}

Response

Status: 200 OK
{
  "contact": {
    "id": 1,
    "name": "Relatel A/S",
    "number": "4571999999",
    "number_formatted": "71 99 99 99",
    "email": "kundeservice@relatel.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": "Relatel A/S",
    "number": "4571999999",
    "number_formatted": "71 99 99 99",
    "email": "kundeservice@relatel.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": "Relatel A/S",
    "number": "4571999999",
    "number_formatted": "71 99 99 99",
    "email": "kundeservice@relatel.dk"
  }
}

Update a contact

Properties

Name Description
name
{"name":"Relatel A/S"}
Contact name.
number
{"number":"4571999999"}
Contact number.
email
{"email":"kundeservice@relatel.dk"}
Contact email.

Request

PUT /api/v2/contacts/:id
{
  "contact": {
    "name": "Relatel A/S",
    "number": "4571999999",
    "email": "kundeservice@relatel.dk"
  }
}

Response

Status: 200 OK
{
  "contact": {
    "id": 1,
    "name": "Relatel A/S",
    "number": "4571999999",
    "number_formatted": "71 99 99 99",
    "email": "kundeservice@relatel.dk"
  }
}

Delete a contact

Delete a contact.

Request

DELETE /api/v2/contacts/:id

Response

Status: 200 OK