К содержанию
Esc
Получить контакт

Contacts

Получить контакт

GET /v1/contacts/{id}

Контакт по id: как с ним связаться, в какой канал он писал последним и до какого времени там можно ответить свободным текстом, согласился ли он на шаблоны и не просил ли ему не писать.

Path parameters

id string required
The contact's id, as ⁠GET /v1/contacts or a message's contact_id gives it.

Errors

CodeHTTPWhat it means
not_found404Ничего не найдено. Ключ видит только сообщения своей организации и своего режима, боевого или тестового.

Any request can also get the codes on Errors, such as unauthenticated and rate_limited.

Язык кода
// npm install @airboxhq/api
// AIRBOX_API_KEY=YOUR_API_KEY node get_contact.mjs
import { Airbox } from "@airboxhq/api";

const client = new Airbox(process.env.AIRBOX_API_KEY);

const { data, error } = await client.contacts.get("0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10");

if (error) {
  throw new Error(`${error.code}: ${error.message} (${error.requestId})`);
}

console.log(data);
Response 200
{
    "id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
    "name": "Асель",
    "phone": "+77011234567",
    "instagram_id": null,
    "channel": "whatsapp",
    "free_text_until": "2026-10-10T09:28:00+00:00",
    "consent": true,
    "opted_out": false,
    "last_message_at": "2026-10-09T09:30:00+00:00",
    "created_at": "2026-09-14T11:05:00+00:00"
}