Ви можете змінити відповідальний відділ для будь-якого чату за їхніми ID.
➡️ Запит
URL | https://api.helpcrunch.com/v1/chats/department |
Метод | PUT |
Headers | Authorization: Bearer <your_api_key> |
Ви повинні вказати ID чату (обов’язково) та ID відділу (обов’язково) у тілі запиту PUT:
{
"id": 5215752,
"department": 233048
}
✅ Відповідь на успішний запит
Якщо ваш запит пройшов успішно, ви отримаєте код статусу успішного виконання 200 OK разом із наведеним нижче тілом відповіді.
{
"id": 5215752,
"closedBy": null,
"lastCustomerMessageAt": null,
"status": "pending",
"closedAt": null,
"rating": null,
"createdAt": 1597758468,
"lastMessageAt": 1597762389,
"snoozedUntil": null,
"lastMessageText": "That was quick. Thanks.",
"lastMessageId": 9577621,
"lastCommunicatedAgentId": 4188,
"agents": [],
"customer": {
"id": 8738438,
"name": "Mike Storm",
"email": "mike@example.com",
"userId": "myusers_4188"
},
"assignee": null,
"department": {
"id": 233048,
"name": "Test Department"
}
}
🛑 Відповіді з помилками
Ви можете отримати один із наведених нижче кодів статусу помилки та відповіді.
400 Bad Request
{
"errors": [
{
"code": "invalid_chat_value",
"message": "department value is invalid"
}
]
}
401 Unauthorized
{
"errors": [
{
"code": "invalid_token",
"message": "Invalid token"
}
]
}
404 Not Found
{
"errors": [
{
"code": "chat_not_found",
"message": "Chat is missing"
}
]
}
429 Too Many Requests
{
"errors": [
{
"code": "too_many_requests",
"message": "You have exceeded your requests limit"
}
]
}