Create an engagement

post

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

This operation is used by the end user to create a chat engagement. Once a session is started and an engagement ID is generated by the chat server, the chat engagement is created and the end user is ready to conduct a chat session. The Authorization header must include the 'Bearer ' prefix before the JSON web token (JWT).

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.RequestEngagementRequest
Type: object
Show Source
Back to Top

Response

Supported Media Types

200 Response

The chat session was created successfully.
Body ()
Root Schema : com.rightnow.chat.rest.consumer_api.model.responses.v1.RequestEngagementResponse
Type: object
Show Source
  • The unique authentication parameter of the survey that appears when a chat is abandoned or cancelled by the consumer. For the survey to appear when a chat is abandoned or cancelled, you will need both the cancelledSurveyAuth and cancelledSurveyId parameters.
  • The unique identifier of the survey that appears when a chat is abandoned or cancelled by the consumer. For the survey to appear when a chat is abandoned or cancelled, you will need both the cancelledSurveyAuth and cancelledSurveyId parameters.
  • The unique identifier of the cancelled survey as a String.
  • The unique identifier of the client.
  • The unique identifier of the client as a String.
  • The local time of the requesting client in yyyy-MM-dd'T'HH:mm:ssXXX format.
  • The unique identifier of the client transaction. The value specified in this field is echoed back in the response object. It is used to link requests to responses.
  • The unique identifier of the client transaction as a String.
  • The unique authentication parameter of the survey that appears when a chat is completed by either the consumer or the agent. For the survey to appear upon completion of a chat, you will need both the completedSurveyAuth and completedSurveyId parameters.
  • The unique identifier of the survey that appears when a chat is completed by either the consumer or the agent. For the survey to appear upon completion of a chat, you will need both the completedSurveyAuth and completedSurveyId parameters.
  • The unique identifier of the completed survey as a String.
  • The unique identifier of the chat engagement.
  • The unique identifier of the chat engagement as a String.
  • The type of the result. For example, 'SUCCESS'.
  • The time when the request processing completed in yyyy-MM-dd'T'HH:mm:ssXXX format.
  • The time when the request processing started in yyyy-MM-dd'T'HH:mm:ssXXX format.
  • The unique identifier of the session.
  • The number of milliseconds that the end user is required to wait between sending sneak preview messages.
  • Allowed Values: [ "NONE", "ENABLED", "DISABLED", "SITE_UNAVAILABLE", "SERVICE_UNAVAILABLE" ]

    The current state of the sneak preview functionality from the end user's perspective.

    • NONE: Sneak preview state not set (or undefined)
    • ENABLED: Sneak preview is enabled on the end user interface.
    • DISABLED: Sneak preview is disabled on the end user interface.
    • SITE_UNAVAILABLE: Sneak preview is enabled on the end user interface but is disabled for the site.
    • SERVICE_UNAVAILABLE: Sneak preview is enabled on the end user interface but is disabled globally.

400 Response

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

403 Response

The validation on the JWT failed.
Body ()
Root Schema : schema
Type: object

404 Response

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

408 Response

The request timed out.
Body ()
Root Schema : schema
Type: object

409 Response

The engagement was dequeued via the routing rules.
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 create a chat engagement by submitting a POST request using cURL.

cURL Command Example

curl -X POST "https://chat_rest_server_domain.com/engagement/api/consumer/sdi_11_20_18_2022_21-3586727808788512-Fusion/v1/requestEngagement?pool=353:2" -H "Accept: application/json;charset=utf-8" -H "Authorization: Bearer eyJhbGciOiJSUz...tr0Cw5qyvZMd64fyCA" -H "Content-Type: application/json;charset=utf-8" -d "{\"clientRequestTime\" : \"2019-01-14T14:35:14.226Z\",\"clientTransactionId\" : 1}"

Request Body Example

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

{
   "clientRequestTime" : "2019-01-14T14:35:14.226Z",
   "clientTransactionId" : 1
}

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.

{
    "engagementId": 226,
    "engagementIdString": "226",
    "cancelledSurveyId": 0,
    "cancelledSurveyIdString": "0",
    "completedSurveyId": 0,
    "completedSurveyIdString": "0",
    "cancelledSurveyAuth": "",
    "completedSurveyAuth": "",
    "resultType": "SUCCESS",
    "sessionId": "170c233dfi4gy1vkwyw6yxdq1a",
    "sneakPreviewState": "DISABLED",
    "sneakPreviewInterval": 3000,
    "clientRequestTime": "2019-01-14T14:35:14.226Z",
    "clientTransactionId": 1,
    "clientTransactionIdString": "1",
    "serviceStartTime": "2019-01-11T10:12:13.175Z",
    "serviceFinishTime": "2019-01-11T10:12:13.298Z",
    "clientId": 246,
    "clientIdString": "246"
}
Back to Top