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:
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
- application/json; charset=utf-8
Path Parameters
-
fqSiteName(required): string
The name of the site to establish a session.
Header Parameters
-
Authorization(required): string
The HTTP request header that contains the JWT for authenticating the request.
The object containing the request information.
Root Schema : com.rightnow.chat.rest.agent_api.model.requests.v1.CreateAgentSessionRequest
Type:
Show Source
object
-
logonOverride:
boolean
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:
object messageDataMap
An optional map of key/value String pairs associated with this agent session.
-
sequenceNumber:
integer(int64)
The client application defined transaction sequence number.
-
timeCreated:
integer(int64)
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.
Response
Supported Media Types
- application/json; charset=utf-8
200 Response
The agent session was successfully created.
Root Schema : com.rightnow.chat.rest.agent_api.model.responses.v1.CreateAgentSessionResponse
Type:
Show Source
object
-
chatLogonResult:
object com.rightnow.chat.rest.agent_api.model.types.v1.ChatLogonResult
-
chatSystemError:
object com.rightnow.chat.rest.agent_api.model.types.v1.ChatSystemError
-
clientId:
integer(int64)
The unique identifier of the agent client, created to identify the agent during this agent session.
-
clientIdString:
string
The unique identifier of the agent client in string format, created to identify the agent during this agent session.
-
clientSendTime:
integer(int64)
The time when the client request was received in yyyy-MM-dd'T'HH:mm:ssXXX format.
-
sequenceNumber:
integer(int64)
The client application defined transaction sequence number.
-
sequenceNumberString:
string
The client application defined transaction sequence number as a string.
-
serviceFinishTime:
integer(int64)
The time when the chat server completed processing the client request in yyyy-MM-dd'T'HH:mm:ssXXX format.
-
serviceStartTime:
integer(int64)
The time when the chat server began processing the client request in yyyy-MM-dd'T'HH:mm:ssXXX format.
-
sessionId:
string
The unique identifier of the agent session.
Nested Schema : com.rightnow.chat.rest.agent_api.model.types.v1.ChatLogonResult
Type:
Show Source
object
-
accountId(required):
integer(int64)
The account identifier.
-
accountIdString(required):
string
The account identifier as a string.
-
activityStatus(required):
string
The activity status of the agent.
-
chatServerVersion:
string
The chat server version identifier.
-
engagements:
array engagements
The list of engagements associated with this agent session.
-
subTypeId(required):
integer(int32)
The sub type identifier.
Nested Schema : com.rightnow.chat.rest.agent_api.model.types.v1.ChatSystemError
Type:
Show Source
object
-
errorCondition:
string
The error condition.
-
text:
string
The error text.
-
type:
string
The error type.
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:
Show Source
object
-
engagementCreateTime:
integer(int64)
The time the engagement was created.
-
engagementCreateTimeString:
string
The time the engagement was created as a string.
-
engagementFirstEngagedTime:
integer(int64)
The time the agent first engaged the end user.
-
engagementFirstEngagedTimeString:
string
The time the agent first engaged the end user as a string.
-
engagementId:
integer(int64)
The unique engagement identifier.
-
engagementIdString:
string
The unique engagement identifier as a string.
-
incidentId:
integer(int64)
The incident identifier associated with the engagement.
-
incidentIdString:
string
The incident identifier associated with the engagement as a string.
-
participants:
array participants
The list of engagement participants.
-
queueId:
integer(int64)
The engagement queue identifier.
-
queueIdString:
string
The engagement queue identifier as a string.
-
requestSource:
string
The source of the engagement request.
-
secondsEngaged:
integer(int64)
The number of seconds the end user has been engaged.
-
secondsEngagedString:
string
The number of seconds the end user has been engaged as a string.
-
state:
string
The state of the engagement.
Nested Schema : com.rightnow.chat.rest.common.model.types.v1.RestApiEngagementParticipantDetail
Type:
Show Source
object
-
clientId(required):
integer(int64)
The unique client identifier associated with the engagement.
-
clientIdString(required):
string
The unique client identifier associated with the engagement as a string.
-
connectionState(required):
string
The connection state of the participant. Value may be ABSENT, ACTIVE or DISCONNECTED.
-
contactInfo(required):
object com.rightnow.chat.rest.common.model.types.v1.RestApiContactInfo
-
invitationType:
string
The invitation type if the role is TRANSIENT. Value may be CONFERENCE, TRANSFER or null.
-
name:
string
The name of the participant.
-
role(required):
string
The engagement role of the participant. Value may be END_USER, CONFEREE, LEAD, MONITOR or TRANSIENT.
-
type(required):
string
The client type identifier. Value may be ADMINISTRATOR, AGENT, END_USER, SUPERVISOR or UNKNOWN.
Nested Schema : com.rightnow.chat.rest.common.model.types.v1.RestApiContactInfo
Type:
Show Source
object
-
browser:
string
The browser identifier.
-
categoryId:
integer(int64)
The category identifier.
-
categoryIdString:
string
The category identifier as a string.
-
coBrowseEnabled(required):
boolean
The co-browse enabled indicator.
-
coBrowsePremiumSupported:
integer(int32)
The co-browse enabled indicator.
-
contactId(required):
integer(int64)
The contact identifier.
-
contactIdString(required):
string
The contact identifier as a string.
-
customFields:
array customFields
The list of custom fields.
-
emailAddress:
string
The contact email address.
-
engagementEngineId:
string
The engagement engine identifier.
-
engagementEngineSessionId:
string
The engagement engine session identifier.
-
eStaraFsguid:
string
The eStaraFsg identifier.
-
firstName:
string
The contact first name.
-
interfaceId(required):
integer(int32)
The interface identifier.
-
interfaceLanguageCode:
string
The interface language code.
-
ipAddress:
string
The IP address.
-
lastName:
string
The contact last name.
-
mediaList:
array mediaList
The media list.
-
operatingSystem:
string
The operating system.
-
orgId(required):
integer(int64)
The organization identifier.
-
orgIdString(required):
string
The organization identifier as a string.
-
productId:
integer(int64)
The product identifier.
-
productIdString:
string
The product identifier as a string.
-
question:
string
The question posed by the contact.
-
queueId:
integer(int64)
The queue identifier.
-
queueIdString:
string
The queue identifier as a string
-
referrerUrl:
string
The referrer URL.
-
sessionId:
string
The unique session identifier.
-
userAgent:
string
The user agent string.
-
visitorId:
string
The visitor identifier.
Nested Schema : com.rightnow.chat.rest.common.model.types.v1.RestApiCustomField
Type:
Show Source
object
-
id:
integer(int64)
The custom field identifier
-
name:
string
Name of the custom field
-
type:
string
Allowed Values:
[ "BOOLEAN", "DATE", "DATETIME", "INTEGER", "integer", "STRING", "DECIMAL" ]
Type of custom field -
value:
string
Value of the custom field
Nested Schema : com.rightnow.chat.rest.common.model.types.v1.MediaInfo
Type:
Show Source
object
-
autoInitiate:
boolean
The indicator that the media info should be auto initiated. Default value is FALSE.
-
environmentErrorList:
array environmentErrorList
The media environment error list.
-
type(required):
string
Allowed Values:
[ "NONE", "CHAT", "COBROWSE", "VIDEO" ]
The media type.
400 Response
The validation of the request object failed.
Root Schema : schema
Type:
object
403 Response
The validation on the JWT failed.
Root Schema : schema
Type:
object
404 Response
The resource was not found.
Root Schema : schema
Type:
object
408 Response
The request timed out.
Root Schema : schema
Type:
object
500 Response
An error occurred in the chat server while processing the request.
Root Schema : schema
Type:
object
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" }