- Contents
Interaction Web Tools Developer's Guide
Common Response Format
The common response format is for responses to requests to:
-
Start a Chat
-
Poll for New Events
-
Send a Message
-
Update Typing Indicator
-
Exit a Chat
This format controls how the system displays these types of information:
-
How many milliseconds (always the same) to wait before polling again
-
Events to indicate that someone joined or left the conversation
-
Someone started or stopped typing
-
Someone sent a message, file, or URL
-
The participant ID of the web user joining the chat
-
The status of the response
-
Sequence numbers for overall events and for conversation events only:
-
sequenceNumber: the overall sequence number for events, including text and changes in participate state
-
-
conversationSequenceNumber: the sequence number for only received text, URLs, and files
The listings illustrate all possible fields in this format. Not all fields are present in every response. Specifically:
-
In responses to requests to start a chat, the WebProcessorBridge assigns a new participant ID to the web user (see the listings that follow, between the final event and the status). The WebProcessorBridge does not assign a new participant ID in any other response types.
-
In responses to chat exit requests, a subset of the format is used.
status,pollWaitSuggestionand descendants are present, butparticipantIDand its descendents are not present.eventsis ignored. -
Responses can include zero or more events.
-
For events of type
participantStateChanged:-
indicates that the specified participant has joined the conversation.state
:active
-
indicates that the specified participant has left the conversation.state
:disconnected
-
| Message | Code |
|---|---|
|
JSON Response |
{
"chat":
{
"pollWaitSuggestion": 1000,
"events":
[
{
"type": "participantStateChanged",
"participantID": "f9580ef2-1270-4182-a429-c3c0d957bf2a",
"sequenceNumber": 0,
"state": "active",
"participantName": "John Doe"
},
{
"type": "text",
"participantID": "55b0e3cf-cecf-4f33-a6f7-cb1295fc9912",
"sequenceNumber": 1,
"conversationSequenceNumber": 0,
"contentType": "text\/plain",
"value": "Hello, how may I help you?",
"displayName": "Alan Agent"
},
{
"type": "typingIndicator",
"participantID": "55b0e3cf-cecf-4f33-a6f7-cb1295fc9912",
"sequenceNumber": 2,
"value": true
},
{
"type": "url",
"participantID": "55b0e3cf-cecf-4f33-a6f7-cb1295fc9912",
"sequenceNumber": 3,
"conversationSequenceNumber": 1,
"value": "http:\/\/www.inin.com\/",
"displayName": "Alan Agent"
},
{
"type": "file",
"participantID": "55b0e3cf-cecf-4f33-a6f7-cb1295fc9912",
"sequenceNumber": 4,
"conversationSequenceNumber": 2,
"value": "\/WebSvcs\/chat\/getFile\/e6edc474-19c5-42ea-9ea3-a4824e13cc7f\/73bd11cb1af54f7f9481cd7dba5c8e34\/Sample0.txt",
"displayName": "Alan Agent"
}
],
"participantID": "f9580ef2-1270-4182-a429-c3c0d957bf2a",
"status":
{
"type": "success"
}
}
}
|
|
JSON Response Indicating Failure |
{
"chat":
{
"pollWaitSuggestion": 1000,
"status":
{
"type": "failure",
"reason": "error.websvc.content.invalid.missingData"
}
}
}
|

