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

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/day119_181100_sql_238h/v1/requestEngagement?pool=297:1 -H 'Content-Type: application/json; charset=utf-8' -d '{}' -H 'Authorization: Bearer eyJhbGciOiJSU...Wst7gbQ6Nqs'

Request Body Example

The following shows an example of the request body in JSON format. For this operation it is an empty payload.

{}

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":34,
"engagementIdString":"34",
"cancelledSurveyId":0,
"cancelledSurveyIdString":"0",
"completedSurveyId":0,
"completedSurveyIdString":"0",
"cancelledSurveyAuth":"",
"completedSurveyAuth":"",
"resultType":"SUCCESS",
"sessionId":"192hyto5qomm8r8rpzzmuzsa6",
"sneakPreviewState":"DISABLED",
"sneakPreviewInterval":3000,
"clientRequestTime":null,
"clientTransactionId":0,
"clientTransactionIdString":"0",
"serviceStartTime":"2018-10-16T12:28:46.544Z",
"serviceFinishTime":"2018-10-16T12:28:46.688Z",
"clientId":34,
"clientIdString":"34"
}
Back to Top