Create an automated agent session

post

/engagement/api/agent/{fqSiteName}/v1/createAutomatedAgentSession

This operation is used by the agent client to create a session on the chat server for an automated agent (bot). The Authorization header must include the 'Bearer ' prefix before the JSON web token (JWT).
The following is the list of exception codes that can be returned from this operation:
  • UNKNOWN_EXCEPTION - An unknown error has occurred.
  • BAD_REQUEST - A field in the request is invalid.
  • INTERNAL_SERVER_ERROR - An error occurred within the core server.
  • ACCESS_DENIED - Authentication failed.
  • DEPENDENCY_APPLICATION_TIMEOUT - The defined period for retrieving data from a dependency application has expired.

Request

Supported Media Types
Path Parameters
Header Parameters
Body ()
The object containing the request information.
Root Schema : com.rightnow.chat.rest.agent_api.model.requests.v1.CreateAgentSessionRequest
Type: object
Show Source
  • Indicates whether a logon override is required. If true, then all current subscriptions are cancelled and a new servlet session ID, console session ID and IP address are associated with the current agent session and the engagement channel sequences are reset to 0. The default value is: false.
  • messageDataMap
    An optional map of key/value String pairs associated with this agent session.
  • The client application defined transaction sequence number.
  • The time the request was created in milliseconds.
Nested Schema : messageDataMap
Type: object
An optional map of key/value String pairs associated with this agent session.
Back to Top

Response

Supported Media Types

200 Response

The agent session was successfully created.
Body ()
Root Schema : com.rightnow.chat.rest.agent_api.model.responses.v1.CreateAgentSessionResponse
Type: object
Show Source
Nested Schema : com.rightnow.chat.rest.agent_api.model.types.v1.ChatLogonResult
Type: object
Show Source
Nested Schema : com.rightnow.chat.rest.agent_api.model.types.v1.ChatSystemError
Type: object
Show Source
Nested Schema : engagements
Type: array
The list of engagements associated with this agent session.
Show Source
Nested Schema : com.rightnow.chat.rest.common.model.types.v1.RestApiEngagementDetail
Type: object
Show Source
Nested Schema : participants
Type: array
The list of engagement participants.
Show Source
Nested Schema : com.rightnow.chat.rest.common.model.types.v1.RestApiEngagementParticipantDetail
Type: object
Show Source
Nested Schema : com.rightnow.chat.rest.common.model.types.v1.RestApiContactInfo
Type: object
Show Source
Nested Schema : customFields
Type: array
The list of custom fields.
Show Source
Nested Schema : mediaList
Type: array
The media list.
Show Source
Nested Schema : com.rightnow.chat.rest.common.model.types.v1.RestApiCustomField
Type: object
Show Source
Nested Schema : com.rightnow.chat.rest.common.model.types.v1.MediaInfo
Type: object
Show Source
Nested Schema : environmentErrorList
Type: array
The media environment error list.
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

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 an agent session after the initial call to the Connect REST AgentTokens endpoint. The Authorization header must include the 'Bearer' prefix before the JSON web token (JWT).

cURL Command Example

curl -X POST https://chat_rest_server_domain.com/engagement/api/agent/day001_221100_sql_001h/v1/createAutomatedAgentSession?pool=297:1 -H 'Content-Type: application/json; charset=UTF-8' -H 'X-Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik9TdkMtNjc0MzYxNC1STiRJRFBfQ0VSVF9LRVkiLCJ4NXQjUzI1NiI6InhHcjdkaURheGRnT0Y3d2E2ZU1xVGFycDRXUENxd0Z1VlgzVmZrV0pnSTQifQGTbsIFurJhusvOsNbjUjUZ_C2cD9jT_PsBGSNVMwWvtXDDO8xADE' -d ' {"timeCreated" :1618317020415, "sequenceNumber" : 0,  "logonOverride": false}'

Request Body Example

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

{
	"logonOverride": false,
	"sequenceNumber": 0,
	"timeCreated": 1564598688444
}

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.

{
  "chatLogonResult": {
  "engagements": [],
  "activityStatus": "UNAVAILABLE",
  "subTypeId": 22,
  "chatServerVersion": "22.2.0.0-b123h"
  },
  "chatSystemError": null,
  "clientSendTime": 1564598688444,
  "serviceStartTime": 1653492901569,
  "serviceFinishTime": 1653492901701,
  "sessionId": "node01hyuckn70y6nm1g2hco4hrwlqq0",
  "clientId": 47,
  "clientIdString": "47",
  "sequenceNumber": 0,
  "sequenceNumberString": "0"
}
Back to Top