Ви можете отримати всі деталі одного чату за його ID.
➡️ Запит
URL | https://api.helpcrunch.com/v1/chats/<chat_id> |
Метод | GET |
Headers | Authorization: Bearer <your_api_key> |
<chat_id> – це ідентифікатор чату, наданий HelpCrunch. Він обов’язковий для цього методу і виглядає як комбінація чисел (наприклад, 1568834).
✅ Відповідь на успішний запит
Якщо ваш запит пройшов успішно, ви отримаєте код успішного статусу 200 OK разом із наведеним нижче тілом відповіді.
{
"id": 1568834,
"closedBy": null,
"lastCustomerMessageAt": 1601477718,
"status": "opened",
"closedAt": null,
"rating": null,
"createdAt": 1594322706,
"lastMessageAt": 1601477718,
"snoozedUntil": null,
"lastMessageText": "Hello World",
"lastMessageId": 8793611,
"lastCommunicatedAgentId": 4188,
"agents": [],
"customer": {
"id": 6930456,
"name": "Mike",
"email": "mike@example.com",
"userId": "company_4180"
},
"assignee": {
"id": 4180,
"name": "Sarah",
"email": "sarah@compeny.com",
"role": "admin"
},
"department": null
}
🛑 Відповіді з помилками
Ви можете отримати один із наведених нижче кодів статусу помилки та відповіді.
401 Unauthorized
{
"errors": [
{
"code": "invalid_token",
"message": "Invalid token"
}
]
}
404 Not Found
{
"errors": [
{
"code": "chat_not_found",
"message": "Chat not found"
}
]
}
429 Too Many Requests
{
"errors": [
{
"code": "too_many_requests",
"message": "You have exceeded your requests limit"
}
]
}