Send a message

post

/engagement/api/consumer/{fqSiteName}/v1/postMessage

This operation is used by the end user to send messages to the agent. The collection of these messages comprises a chat engagement.
The user can start sending messages as soon as the chat engagement is created and does not have to wait until the chat engagement is accepted by the agent.

Request

Supported Media Types
Path Parameters
Query Parameters
  • The pool ID specified in the Establish Sessions response or provided in an RNEngagementConfigurationChangedMessage system message.
Header Parameters
Body ()
The object containing the request information.
Root Schema : com.rightnow.chat.rest.consumer_api.model.requests.v1.PostEngagementMessageRequest
Type: object
Show Source
Nested Schema : messageDataMap
Type: object
An optional map of client supplied key/value String pairs associated with this message.
Back to Top

Response

Supported Media Types

200 Response

The request completed successfully.
Body ()
Root Schema : com.rightnow.chat.rest.consumer_api.model.responses.v1.PostEngagementMessageResponse
Type: object
Show Source

400 Response

The validation of the request object failed.
Body ()
Root Schema : schema
Type: object

403 Response

The consumer session identifier is unknown.
Body ()
Root Schema : schema
Type: object

404 Response

The resource was not found.
Body ()
Root Schema : schema
Type: object

409 Response

The lead agent participant has left the engagement.
Body ()
Root Schema : schema
Type: object

500 Response

An error occurred in the chat server while processing the request.
Body ()
Root Schema : schema
Type: object
Back to Top

Examples

The following example shows how to a send message to an agent by submitting a POST request using cURL:

cURL Command Example

curl -X POST https://chat_rest_server_domain.com/engagement/api/consumer/day119_181100_sql_238h/v1/postMessage?pool=297:1 -H 'Content-Type: application/json; charset=UTF-8' -H 'SessionId: 192hyto5qomm8r8rpzzmuzsa6' -d '{"body":"Hello I need help with my refund, it has been very long time."}'

Request Body Example

The following shows an example of the request body in JSON format.

{
   "body":"Hello I need help with my refund, it has been very long time."
}

Response Header Example

The following shows an example of the response header.

Status: 200 OK
Content-Type: application/json;charset=utf-8

Response Body Example

The following shows an example of the response body in JSON format.

{
    "clientRequestTime": null,
    "serviceStartTime": "2018-10-23T14:00:38.205Z",
    "serviceFinishTime": "2018-10-23T14:00:38.218Z",
    "clientId": 34,
    "clientIdString": "34",
    "clientTransactionId": 0,
    "clientTransactionIdString": "0"
}
Back to Top