Ви можете змінити відповідального за чат за його ID. Відповідальний — це оператор, на якого призначено чат.
➡️ Запит
URL | https://api.helpcrunch.com/v1/chats/assignee |
Метод | PUT |
Headers | Authorization: Bearer <your_api_key> |
Ви повинні вказати ID чату (обов’язково) та ID відповідального (обов’язково) у тілі запиту PUT.
{
"id": 5214000,
"assignee": 4188
}
✅ Відповідь на успішний запит
Якщо ваш запит пройшов успішно, ви отримаєте код статусу успішного виконання 200 OK разом із наведеним нижче тілом відповіді.
{
"id": 5214000,
"closedBy": null,
"lastCustomerMessageAt": 1592332354,
"status": "pending",
"closedAt": null,
"rating": null,
"createdAt": 1592332351,
"lastMessageAt": 1592332354,
"snoozedUntil": null,
"lastMessageText": "HelpCrunch is the best! Thank you guys.",
"lastMessageId": 8579581,
"lastCommunicatedAgentId": null,
"agents": [],
"customer": {
"id": 8740457,
"name": "Noah",
"email": "Noah@example.com",
"userId": null
},
"assignee": {
"id": 4188,
"name": "John Doe",
"email": "john@company.com",
"role": "admin"
},
"department": null
}
🛑 Відповіді з помилками
Ви можете отримати один із наведених нижче кодів статусу помилки та відповіді.
400 Bad Request
{
"errors": [
{
"code": "invalid_chat_value",
"message": "assignee 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"
}
]
}