Contacts

Manage contact people. A contact can be attached to clients, to vendors, or to both.

Use cases: Use the Contacts API to keep the people you deal with in sync, and to attach the right recipient to a client before issuing documents.
GET/contacts

List contacts with optional filtering and pagination.

Query Parameters

NameTypeDescription
search
stringFree-text search across relevant fields.
firstName
stringFilter by first name.
lastName
stringFilter by last name.
email
stringFilter by email.
phoneNumber
stringFilter by phone number.
hasClients
booleanOnly contacts attached to at least one client.
hasVendors
booleanOnly contacts attached to at least one vendor.
clientId
numberOnly contacts attached to this client (internal id).
vendorId
numberOnly contacts attached to this vendor (internal id).
sortBy
stringColumn to sort by.
sortOrder
string"asc" or "desc".
limit
numberItems per page. Default 50, clamped to 1-200.
offset
numberRow offset to start from (default 0).
page
number1-based page number (default 1). Converted to an offset; an explicit `offset` wins over it.
pageSize
numberAlias of `limit`. Wins over `limit` when both are sent.

Request

curl -X GET "https://api.glance.co.il/contacts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response

Response
{
  "data": [
    {
      "id": 71,
      "visibleId": "3f9c1b20-8d4e-4a17-9b52-6e0c8d1a4f73",
      "firstName": "Efi",
      "lastName": "Levi",
      "email": "efi@acme.com",
      "phoneNumber": "050-5550000",
      "clients": [
        {
          "id": 5531,
          "name": "Acme Corp"
        }
      ],
      "vendors": []
    }
  ],
  "pagination": {
    "total": 12,
    "limit": 50,
    "offset": 0,
    "hasMore": false,
    "page": 1,
    "pageSize": 50,
    "totalPages": 1
  }
}
GET/contacts/id/:visibleId

Get a single contact with the clients and vendors it is attached to.

Returned flat, not wrapped in `data`. A visibleId that matches nothing returns `null` with status 200.

Path Parameters

NameTypeDescription
visibleId
stringrequiredThe contact's visibleId.

Request

curl -X GET "https://api.glance.co.il/contacts/id/:visibleId" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response

Response
{
  "id": 71,
  "visibleId": "3f9c1b20-8d4e-4a17-9b52-6e0c8d1a4f73",
  "firstName": "Efi",
  "lastName": "Levi",
  "email": "efi@acme.com",
  "phoneNumber": "050-5550000",
  "address": {
    "id": 88,
    "city": "תל אביב"
  },
  "clients": [
    {
      "id": 5531,
      "name": "Acme Corp"
    }
  ],
  "vendors": []
}
POST/contacts/create

Create a contact, optionally attached to a client or vendor.

The internal id of a client is the `id` field on GET /clients — the same value `GET /clients/entity/:entityId` takes. `visibleId` is not accepted here.

Body Parameters

NameTypeDescription
firstName
stringrequiredContact first name.
lastName
stringContact last name.
phoneNumber
stringPhone number.
email
stringEmail address.
addressId
numberId of an existing address to attach.
clientId
numberAttach the contact to this client. The client's **internal numeric id** — not its visibleId.
vendorId
numberAttach the contact to this vendor. Internal numeric id, as above.

Request

curl -X POST "https://api.glance.co.il/contacts/create" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "firstName": "example_firstName",
  "lastName": "example_lastName",
  "phoneNumber": "example_phoneNumber",
  "email": "example_email",
  "addressId": 0,
  "clientId": 0,
  "vendorId": 0
}'

Response

Response
{
  "success": true,
  "contactId": 71,
  "visibleId": "3f9c1b20-8d4e-4a17-9b52-6e0c8d1a4f73"
}
PUT/contacts/edit/:visibleId

Update a contact's own details. All fields are optional.

Attachments cannot be changed here: `clientId` and `vendorId` are accepted only on creation.

Path Parameters

NameTypeDescription
visibleId
stringrequiredThe contact's visibleId.

Body Parameters

NameTypeDescription
firstName
stringContact first name.
lastName
stringContact last name.
phoneNumber
stringPhone number.
email
stringEmail address.
addressId
numberId of an existing address to attach.

Request

curl -X PUT "https://api.glance.co.il/contacts/edit/:visibleId" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "firstName": "example_firstName",
  "lastName": "example_lastName",
  "phoneNumber": "example_phoneNumber",
  "email": "example_email",
  "addressId": 0
}'

Response

Response
{
  "success": true,
  "visibleId": "3f9c1b20-8d4e-4a17-9b52-6e0c8d1a4f73"
}
DELETE/contacts/delete/:visibleId

Delete a contact.

Path Parameters

NameTypeDescription
visibleId
stringrequiredThe contact's visibleId.

Request

curl -X DELETE "https://api.glance.co.il/contacts/delete/:visibleId" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response

Response
{
  "success": true
}

Last updated