Maintenance Notice - PDF Generation
Dynamic PDF generation for web-based content is temporarily unavailable. This maintenance affects dynamic PDF files that are generated from either the HTML-based page or manual that you are viewing. Links that normally allow this functionality have been hidden, and will reappear as soon as the feature is restored.


Note: Access to static files, including PDF files that are not dynamically generated from our web-based content, is unaffected.

Jump to: navigation, search

Chat Resource

This operation is part of the Chat API section of the Web Services API.

Overview

The chat resource includes properties that describe the current state of the chat and the available operations given the current state. A full description of the properties included on the chat resource and their possible values can be found here.


Request URL /api/v2/me/chats?fields=*
HTTP Method GET
Required Features api-multimedia-chat

Sample Data

Request

GET /api/v2/me/chats?fields=*

CometD Notification

{
            "state": "Chatting",
            "id": "0000Na9B26EF002G",
            "uri": "http://localhost:8080/api/v2/chats/0000Na9B26EF002G",
            "participants": [
                {
                    "type": "Agent",
                    "nickname": "Agent1",
                    "participantId": "009052BDEE4A003E"
                },
                {
                    "type": "Customer",
                    "nickname": "PersonP",
                    "participantId": "009052BDEE39003C"
                }
            ],
           "capabilities": [
              "AttachUserData",
              "UpdateUserData",
              "DeleteUserData",
              "Leave",
              "LeaveAndComplete",
              "Transfer",
              "Invite",
              "Consult"
           ],
          "userData": {
          }
 
}

Messages

You can also receive messages for a particular chat.

Request URL /api/v2/me/chats/{chatId}/messages
HTTP Method GET
Required Features api-multimedia-chat

Optional URL parameters are startIndex and count.

Message Types

Type Description
Text Message text is placed into the text field.
ParticipantJoined A participant joined the chat. The participant's information is placed into the from field.
ParticipantLeft The participant left the chat. The participant's information is placed into the from field.
ParticipantRejoined The participant rejoined the chat. The participant's information is placed into the from field.
TypingStarted The participant started typing. If typing preview is enabled, the message text is placed into the text field.
TypingStopped The participant stopped typing.
PushUrl The participant sent a URL. The URL is placed into the url field.
Notice The notice text is placed into the text field (optional).
TranscriptSaveDone The service message type. The index field always equals -1.

Sample Data

Request

GET /api/v2/me/chats/009052BDEE39003A/messages?startIndex=1&count=10

CometD Notification

{
"messages": [
        {
            "index": 1,
            "type": "ParticipantJoined",
            "from": {
                "type": "Customer",
                "nickname": "PersonP",
                "participantId": "009052BDEE39003C"
            },
            "visibility": "All",
            "timestamp": "2013-12-27T13:16:41.000-0800"
        },
        {
            "index": 2,
            "type": "ParticipantJoined",
            "from": {
                "type": "Agent",
                "nickname": "Agent1",
                "participantId": "009052BDEE4A003E"
            },
            "visibility": "All",
            "timestamp": "2013-12-27T13:16:41.018-0800"
        },
        {
            "index": 3,
            "type": "TypingStarted",
            "from": {
                "type": "Customer",
                "nickname": "PersonP",
                "participantId": "009052BDEE39003C"
            },
            "visibility": "All",
            "timestamp": "2013-12-27T13:16:41.186-0800"
        },
        {
            "index": 4,
            "type": "Text",
            "from": {
                "type": "Customer",
                "nickname": "PersonP",
                "participantId": "009052BDEE39003C"
            },
            "text": "dddd",
            "visibility": "All",
            "timestamp": "2013-12-27T13:16:41.187-0800"
        }
    ]
}
This page was last edited on January 22, 2016, at 19:56.

Feedback

Comment on this article:

blog comments powered by Disqus