You can get all the details of a single chat by its id. Use Get all chats method if you want to retrieve all chats from your account. You can also search for a specific chat or a bunch of chats with the Search for chats method.
➡️ Request
URL | https://api.helpcrunch.com/v1/chats/<chat_id> |
Method | GET |
Headers | Authorization: Bearer <your_api_key> |
<chat_id> is the identifier for the chat as given by HelpCrunch. It is required for this method and looks like a combination of numbers, for example 1568834.
Read more about authorization header here.
✅ Successful Response
If your request has succeeded, you'll get a 200 OK success status code together with the following response body.
{
"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
}
You can get details on every Chat Object field in the Chat model article.
🛑 Error Responses
You may get one of the following error status codes and responses. More info on the errors is available here.
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"
}
]
}
If you have any questions regarding the REST API, feel free to chat us any time.
👩💻 Happy Coding! 👨💻