Messages API allows you to get and create messages on behalf of your customers or agents.
Here's the example response for the Messages API methods:
{
"id": 542335,
"agent": {
"id": 542335,
"name": "string",
"email": "string",
"role": "string"
},
"type": "tech",
"text": "string",
"read": true,
"createdAt": "1603885746",
"updatedAt": "1603885746",
"edited": true,
"broadcastType": "trigger",
"chat": 542335,
"from": "agent"
}
Below you can find details on each of the Message Object fields.
Field | Type | Description |
id | Integer | Unique id of the message provided by HelpCrunch |
agent | Object |
If the message was sent from agent, this object will contain id, name, email and role of that agent |
type | String | "tech" - system message (e.g. about status update) "email" - email message "knowledgeBase" - link to Knowledge Base article "message" - regular message "private" - private note (agents only) |
text | String | Text of the message |
read | Boolean | true - message was read. false - message has not been read |
createdAt | Date (UNIX timestamp) | Date and time the message was created |
updatedAt | Date (UNIX timestamp) | Date and time the message was updated |
edited | Boolean | true - message was edited. false - message was not edited |
broadcastType | String | "trigger" - proactive chat "auto chat" - targeted chat auto message "auto email" - email auto message "manual chat" - manual chat message "manual email" - manual email message Read more about Auto and manual messages |
chat | Integer | Unique id of the chat provided by HelpCrunch |
from | String | "agent" or "customer". Who sent the message. * note that in case of Chatbot message, it will still show up as sent from agent |
Example of the ChatBot response :
{
"id": 48943,
"type": "message",
"text": "Message from bot",
"read": false,
"edited": false,
"createdAt": "1712053945",
"updatedAt": "1712053945",
"broadcastType": null,
"agent": {
"id": 2,
"name": "HelpBot",
"email": "[email protected]",
"role": "admin"
},
"chat": 42068,
"from": "agent"
}
If you have any questions regarding the REST API, feel free to chat us any time.
👩💻 Happy Coding! 👨💻