Use this API to send different types of messages to the Conversation Hub. Conversation Hub delivers messages on a callback URL of registered client applications of recipient. Recipient client applications should discard messages of various types, if it doesn't support them.
Following table tells which client app can send which type of message
Message Type | customer | egain_agent | custom_agent | egain_bot | custom_bot |
---|---|---|---|---|---|
text | Y | Y | Y | Y | Y |
typing.start | Y | Y | Y | Y | Y |
typing.end | Y | Y | Y | Y | Y |
escalation.transfer | N | Y | Y | Y | Y |
pagePush | N | Y | Y | Y | Y |
conversation.state | N | Y | Y | N | N |
agent.join | N | Y | Y | N | N |
agent.available | N | Y | Y | N | N |
agent.unavailable | N | Y | Y | N | N |
agent.transfer | N | Y | Y | N | N |
queue.transfer | N | Y | Y | N | N |
richMessage.listpicker | N | Y | Y | Y | Y |
richMessage.quickreply | N | Y | Y | Y | Y |
richMessage.template | N | Y | Y | Y | Y |
richMessage.timepicker | N | Y | Y | Y | Y |
richMessage.richlink | N | Y | Y | Y | Y |
richMessage.form | N | Y | Y | Y | Y |
richMessage.payment | N | Y | Y | Y | Y |
richMessage.app | N | Y | Y | Y | Y |
richMessage.authentication | N | Y | Y | Y | Y |
authentication.success | Y | N | N | N | N |
authentication.failure | Y | N | N | N | N |
customer.info | Y | Y | Y | Y | Y |
customer.active | Y | N | N | N | N |
customer.inactive | Y | N | N | N | N |
error | Y | Y | Y | Y | Y |
delete.soft | Y | N | N | N | N |
delete.permanent | Y | N | N | N | N |
undo | Y | N | N | N | N |
conversation.end | Y | Y | Y | Y | Y |
Client application must have 'app.conversation.conversationmgr.interaction.manage' assigned to call this API
Send Message
object | |
required | object (RequestMessages) |
Accepted
Bad Request
Unauthorized
Forbidden
Internal server error
This example shows how customer client app can start conversation.
{- "metadata": {
- "attributes": [
- {
- "name": "k1",
- "value": "v1"
}
]
}, - "messages": {
- "message": [
- {
- "messageId": "96ea3afb-b462-2ea4-7aed-500020a648f3",
- "type": {
- "value": "text"
}, - "content": {
- "text": "I have a question related to my recent order."
}, - "conversation": {
- "account": {
- "channel": {
- "type": "custom.teams"
}, - "address": "1000"
}, - "lookupContact": "phone.mobile",
- "conversationContact": "phone.mobile",
- "customer": {
- "name": "John smith",
- "type": "individual",
- "attributes": [
- {
- "name": "group",
- "value": "eGain"
}
], - "contacts": {
- "contact": [
- {
- "type": "phone",
- "subType": "mobile",
- "address": "123456788"
}, - {
- "type": "email",
- "address": "johnsmith@example.com"
}
]
}
}
}, - "sender": {
- "type": "customer",
- "participant": {
- "name": "customer_name"
}
}, - "attributes": {
- "attribute": [
- {
- "external": true,
- "name": "k1",
- "value": "v1"
}
]
}
}
]
}
}
{- "messages": {
- "message": [
- {
- "id": "c3bd352c-68ca-43ed-a328-89e125332f5d",
- "messageId": "96ea3afb-b462-2ea4-7aed-500020a648f3",
- "conversation": {
- "id": "a78cfcc0-2182-4fff-91e2-67bad444df13"
}
}
]
}
}
{- "metadata": {
- "attributes": [
- {
- "name": "version",
- "value": "v1"
}
], - "messages": {
- "message": [
- {
- "id": "262839d2-7cb3-4b38-90cd-5989a56e5d44",
- "messageId": "96ea3afb-b462-2ea4-7aed-500020a648f3",
- "type": {
- "value": "text"
}, - "conversation": {
- "id": "7251b0be-7662-4ed8-838d-ac0860106cc3"
}, - "content": {
- "text": "hi",
- "redact": false
}, - "sender": {
- "type": "customer",
- "participant": {
- "name": "John smith"
}
}, - "recipients": {
- "recipient": [
- {
- "type": "custom_bot",
- "participant": {
- "name": "custom_bot_participant"
}
}
]
}, - "created": "2021-04-02T19:59:07.654Z"
}
]
}
}
}