Jump to: navigation, search

Chat API

Warning
Note that the Chat API Version 1 feature has been deprecated. Please see the related deprecation notice for additional details.


Overview

Information.png Prerequisite: Before using the Chat API described on this page, you must configure your Genesys Mobile Services deployment correctly.

The Chat API is used by customer-facing applications to create and manage a chat session associated with contact center-related services. One service is associated with exactly one chat session.

Basic Services (Genesys Mobile Services-Based):

  • allows an application to pass business context data in the service creation request, using the fixed service name request-chat
  • no corresponding Orchestration Server (ORS) session will be created
  • data is going to be preserved by Genesys Mobile Services using the specified time to live parameter (or the configured default value)
  • chat interaction could be initiated by an application at any point
  • routing logic associated with specified interaction endpoint (or the configured by default value) would be responsible for finding an appropriate agent
  • both polling and async (CometD) modes of message delivery are supported
  • both polling and async (CometD) modes of message delivery are supported

Important Note: When using asynchronous messaging with CometD, all HTTP headers must include the gms_user header.

Sequence Diagrams

Structures

The Chat API uses the data structures described in this section (in JSON format) to exchange data. Requests are accepted in 'application/x-www-form-urlencoded' or 'multipart/form-data' formats, and responses are returned in 'application/json' format. If an expected value is missing or incorrect, then a 415 (Unsupported Media Type) error will occur.

Chat Interaction API Resources

The chat interaction is used to represent the current state of the chat session and transcript. This information is returned in the HTTP response of each API request in poll mode or delivered asynchronously in push mode (CometD). Note: you need to create service session before you can create chat interaction.

Create Chat Interaction: /genesys/1/service/{sessionid}/ixn/chat?notify_by=comet&firstName=Buzz&lastName=Brain&subject=French&email=b.b%40gmail.com

{
 "chatIxnState" : "CONNECTED",
 "chatSessionId": "000C2a7VVQRB001U",
 "transcriptPosition" : 1,
 "chatServiceMessage" : "Chat service is available"
}

Create Chat Interaction: /genesys/1/service/{sessionid}/ixn/chat?_verbose=true&notify_by=comet&firstName=Buzz&lastName=Brain&subject=French&email=b.b%40gmail.com

{
   "chatIxnState": "CONNECTED",
   "chatSessionId": "000C2a7VVQRB001U",
   "transcriptPosition": "1",
   "chatServiceMessage": "Chat service is available",
   "userId": "015E4FD3CD890036",
   "secureKey": "b306749dabfa1cf6",
   "checkChatServiceLoadBalancerPath": "/WebAPI812/SimpleSamples812/ChatHA/ChatLBServerInfo.jsp?chatServerLoadBalancerAlias=350",
  "chatServerLoadBalancerAlias": "350",
  "chatServerHost": "135.225.51.225",
  "chatWebApiPort": "4856",
  "isTLSrequired": "false",
  "clientTimeZoneOffset": "-420",
  "_chatIxnAPI_SEND_URL": "/genesys/1/service/9d6c31d3-1121-4ba9-91e1-b93c0fa6e32f/ixn/chat/send",
  "_chatIxnAPI_REFRESH_URL": "/genesys/1/service/9d6c31d3-1121-4ba9-91e1-b93c0fa6e32f/ixn/chat/refresh",
  "_chatIxnAPI_START_TYPING_URL": "/genesys/1/service/9d6c31d3-1121-4ba9-91e1-b93c0fa6e32f/ixn/chat/startTyping",
  "_chatIxnAPI_STOP_TYPING_URL": "/genesys/1/service/9d6c31d3-1121-4ba9-91e1-b93c0fa6e32f/ixn/chat/stopTyping",
  "_chatIxnAPI_DISCONNECT_URL": "/genesys/1/service/9d6c31d3-1121-4ba9-91e1-b93c0fa6e32f/ixn/chat/disconnect",
  "_chatIxnAPI_REFRESH_FROM_START_URL": "/genesys/1/service/9d6c31d3-1121-4ba9-91e1-b93c0fa6e32f/ixn/chat/refresh?transcriptPosition=1"
}

Attribute Descriptions:

  • chatIxnState – The current state of the chat session.
  • chatSessionId – Session ID associated with the chat.
  • transcriptPosition – The current position in the chat dialog or transcript for this user.
  • chatServiceMessage – A diagnostic message used for debugging.

The following are only returned if the _verbose parameter in the API request is true:

  • userId – User ID assigned by the Genesys Chat Server.
  • secureKey – The security key for this chat session.
  • checkChatServiceLoadBalancer – Indicates that we should check the chat load balancer for the appropriate Chat Server to use.
  • PathchatServerLoadBalancerAlias – The alias for the Chat Server that is assigned to this chat session by the Chat Server load balancer.
  • chatServerHost – Host name for the Chat Server assigned to this chat session from the Chat Server load balancer.
  • chatWebApiPort – Port number of the Chat Server load balancer
  • isTLSrequired – Indicates whether a TLS connection is required for the Chat Server.
  • clientTimeZoneOffset - Time zone offset specified by the user client. Could be used to convert UTC time returned by server into user local time.
  • _chatIxnAPI_SEND_URL – URL used to send chat messages for this chat session.
  • _chatIxnAPI_REFRESH_URL – URL used to refresh the chat transcript for this chat session.
  • _chatIxnAPI_START_TYPING_URL – URL used to indicate that the user started typing a chat message for this chat session.
  • _chatIxnAPI_STOP_TYPING_URL – URL used to indicate that the user stopped typing a chat message for this chat session.
  • _chatIxnAPI_DISCONNECT_URL – URL used to disconnect the user from the chat session.
  • _chatIxnAPI_REFRESH_FROM_START_URL – URL used to refresh the chat transcript from the beginning of the session.

Refresh Chat Transcript: /genesys/1/service/{sessionid}/ixn/chat/refresh?message=hello%20agent

{
 "chatIxnState" : "TRANSCRIPT",
 "chatSessionId" :"000BRa84KRFB00BK",
 "transcriptPosition" : 5",
 "chatServiceMessage" : "Chat service is available",
 "transcriptToShow" : [["Notice.Joined","ksippo","has joined the session","35","AGENT"],["Notice.TypingStarted","ksippo","is typing","42","AGENT"],["Message.Text","ksippo","hello customer","48","AGENT"],["Message.Text","VasyaP","hello agent","71","CLIENT"]]",
 "startedAt" : 2012-06-09T06:15:35Z"
}

Refresh chat transcript: /genesys/1/service/{sessionid}/ixn/chat/refresh?_verbose=true&message=hello%20agent

{
   "chatIxnState": "TRANSCRIPT",
   "chatSessionId":"000BRa84KRFB00BK",
   "transcriptPosition": "5",
   "chatServiceMessage": "Chat service is available",
   "transcriptToShow":    [
            [
         "Notice.Joined",
         "ksippo",
         "has joined the session",
         "15",
         "AGENT"
      ],
            [
         "Message.Text",
         "VasyaP",
         "hello agent",
         "26",
         "CLIENT"
      ],
            [
         "Notice.TypingStarted",
         "ksippo",
         "is typing",
         "57",
         "AGENT"
      ],
            [
         "Message.Text",
         "ksippo",
         "hello customer",
         "61",
         "AGENT"
      ]
   ],
   "startedAt": "2012-06-09T22:26:17Z",
   "userId": "015E4FD3CD890036",
   "secureKey": "b306749dabfa1cf6",
   "checkChatServiceLoadBalancerPath": "/WebAPI812/SimpleSamples812/ChatHA/ChatLBServerInfo.jsp?chatServerLoadBalancerAlias=350",
   "chatServerLoadBalancerAlias": "350",
   "chatServerHost": "135.225.51.225",
   "chatWebApiPort": "4856",
   "isTLSrequired": "false",
   "clientTimeZoneOffset": "-420",
   "_chatIxnAPI_SEND_URL": "/genesys/1/service/9d6c31d3-1121-4ba9-91e1-b93c0fa6e32f/ixn/chat/send",
   "_chatIxnAPI_REFRESH_URL": "/genesys/1/service/9d6c31d3-1121-4ba9-91e1-b93c0fa6e32f/ixn/chat/refresh",
   "_chatIxnAPI_START_TYPING_URL": "/genesys/1/service/9d6c31d3-1121-4ba9-91e1-b93c0fa6e32f/ixn/chat/startTyping",
   "_chatIxnAPI_STOP_TYPING_URL": "/genesys/1/service/9d6c31d3-1121-4ba9-91e1-b93c0fa6e32f/ixn/chat/stopTyping",
   "_chatIxnAPI_DISCONNECT_URL": "/genesys/1/service/9d6c31d3-1121-4ba9-91e1-b93c0fa6e32f/ixn/chat/disconnect",
   "_chatIxnAPI_REFRESH_FROM_START_URL": "/genesys/1/service/9d6c31d3-1121-4ba9-91e1-b93c0fa6e32f/ixn/chat/refresh?transcriptPosition=1"
}

Attributes description:

  • startedAt - Chat interaction start time (in UTC).
  • transcriptToShow - An ordered array of transcript events. Each event is represented by another array of the following format:
    [{Event type}, {Agent nickname}, {Chat message}, {Number of seconds from interaction start}, {Type of user}]
    Where:
    • Event type: {"Message.Text", "Notice.Joined", "Notice.Left", "Notice.TypingStart", "Notice.TypingStop", "Notice.PushUrl"}
    • Type of user: {"AGENT", "CLIENT", "EXTERNAL"}

Service API Resources

Basic Chat: genesys/1/service/request-chat

{
   "_id": "a7e6ed0b-0380-4223-97f8-b3c7d93205e8"
}

Basic Chat: genesys/1/service/request-chat?_verbose=true

{
   "_chatIxnAPI-CREATE-URL": "/genesys/1/service/a7e6ed0b-0380-4223-97f8-b3c7d93205e8/ixn/chat",
   "_id": "a7e6ed0b-0380-4223-97f8-b3c7d93205e8"
}


COMETD Based Chat API

CometD Handshake

Request

POST http://localhost:8080/genesys/cometd/handshake
gms_user: b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673
Content-Type: application/json;charset=UTF-8
[{"version":"1.0","minimumVersion":"0.9","channel":"/meta/handshake",
"supportedConnectionType"":["long-polling","callback-polling"],
"advice":{"timeout":60000,"interval":0},"id":"1"}]

Response

Content-Type: application/json;charset=UTF-8
[{"id":"1","minimumVersion":"1.0","supportedConnectionTypes":["callback-polling","long-polling"],
"successful":true,"channel":"/meta/handshake","ext":{"ack":true},
"clientId":"3vym301sjdtc218qabm5w0z8yb","version":"1.0"}]

CometD Subscribe

Request

POST http://localhost:8080/genesys/cometd/
gms_user: b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673
Content-Type: application/json;charset=UTF-8
[{"channel":"/meta/subscribe","subscription":"/_genesys","id":"2",
"clientId":"3vym301sjdtc218qabm5w0z8yb"}]

Response

Content-Type: application/json;charset=UTF-8
[{"id":"2","subscription":"/_genesys","successful":true,"channel":"/meta/subscribe"}]

CometD Connect

Request

POST http://localhost:8080/genesys/cometd/connect
gms_user: b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673
Content-Type: application/json;charset=UTF-8
[{"channel":"/meta/connect","connectionType":"long-polling","advice":{"timeout":0},
"id":"3","clientId":"3vym301sjdtc218qabm5w0z8yb"}]

Response

Content-Type: application/json;charset=UTF-8
[{"id":"3","successful":true,"advice":{"interval":0,"reconnect":"retry","timeout":60000},
"channel":"/meta/connect"}]

Create Service Session

Request

POST http://localhost:8080/genesys/1/service/request-chat
gms_user: b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

_verbose=true

Response

Content-Type: application/json;charset=UTF-8
{ "_chatIxnAPI-CREATE-URL":"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat",
  "_id":"4d1697a9-dda5-4742-8a6f-fbc01c25c640",
  "_data_id":"429-791eaee8-571e-4633-9a73-cc936336f8e2"
}

Create Chat Interaction for Session 4d1697a9-dda5-4742-8a6f-fbc01c25c640

Request

POST
http://localhost:8080/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat
gms_user: b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673
Content-Type:	application/x-www-form-urlencoded; charset=UTF-8

_verbose=true&notify_by=comet&FirstName=John&LastName=Harry&subject=French&EmailAddress=j.h%40gmail.com

Response

Content-Type: application/json;charset=UTF-8
{
"chatServerLoadBalancerAlias":"371",
"_chatIxnAPI_SEND_CUSTOM_URL":"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/customNotice",
"clientTimeZoneOffset":"120",
"transcriptPosition":"1",
"chatWebApiPort":"9002",
"chatIxnState":"CONNECTED",
"comet_channel":"/_genesys",
"secureKey":"1b21478a91a7d1dc",
"checkChatServiceLoadBalancerPath":"/WebAPI812/SimpleSamples812/ChatHA/ChatLBServerInfo.jsp?chatServerLoadBalancerAlias=371",
"_chatIxnAPI_REFRESH_FROM_START_URL":"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/refresh?transcriptPosition=1",
"_chatIxnAPI_REFRESH_URL":"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/refresh",
"chatSessionId":"000E5aA2A40P000Q",
"isTLSrequired":"false",
"_chatIxnAPI_DISCONNECT_URL":"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/disconnect",
"chatServiceMessage":"Chat service is available",
"userId":"0173542518870006",
"_chatIxnAPI_STOP_TYPING_URL":"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/stopTyping",
"_chatIxnAPI_START_TYPING_URL":"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/startTyping",
"_chatIxnAPI_SEND_URL":"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/send",
"chatServerHost":"demosrv.genesyslab.com"
}

Polling Agent 'Joined' Message Through CometD

Request

POST http://localhost:8080/genesys/cometd/connect
gms_user: b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673
Content-Type: application/json;charset=UTF-8

[{"channel":"/meta/connect","connectionType":"long-polling","id":"4","clientId":"3vym301sjdtc218qabm5w0z8yb"}]"

Response

Content-Type: application/json;charset=UTF-8
[
{"data":{"id":"7b239ff0455011e4b31cbb293fafe316",
"message":{"chatSessionId":"000E5aA2A40P000Q",
"transcriptPosition":"2","chatServiceMessage":"Chat service is available",
"startedAt":"2014-09-26T07:40:55Z",
"chatIxnState":"TRANSCRIPT",
"transcriptToShow":[ ["Notice.Joined","Kristi Sippola","has joined the session","14","AGENT"]]},
"tag":"service.chat.refresh.4d1697a9-dda5-4742-8a6f-fbc01c25c640"},
"channel":"/_genesys"},
{"id":"4","successful":true,"channel":"/meta/connect"}
]

Polling Agent 'StartTyping' Message Through CometD

Request

POST http://localhost:8080/genesys/cometd/connect
gms_user: b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673
Content-Type: application/json;charset=UTF-8

[{"channel":"/meta/connect","connectionType":"long-polling","id":"5","clientId":"3vym301sjdtc218qabm5w0z8yb"}]"

Response

Content-Type: application/json;charset=UTF-8
[
{"data":{"id":"802c88e0455011e4b31cbb293fafe316",
"message":{"chatSessionId":"000E5aA2A40P000Q",
"transcriptPosition":"3","chatServiceMessage":"Chat service is available",
"startedAt":"2014-09-26T07:40:55Z",
"chatIxnState":"TRANSCRIPT",
"transcriptToShow":[["Notice.TypingStarted","Kristi Sippola","is 
typing","22","AGENT"]]},
"tag":"service.chat.refresh.4d1697a9-dda5-4742-8a6f-fbc01c25c640"},
"channel":"/_genesys"},{"id":"5","successful":true,"channel":"/meta/connect"}
]

Polling Agent Chat Message Through CometD

Request

POST http://localhost:8080/genesys/cometd/connect
gms_user: b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673
Content-Type: application/json;charset=UTF-8

[{"channel":"/meta/connect","connectionType":"long-polling","id":"6","clientId":"3vym301sjdtc218qabm5w0z8yb"}]"

Response

Content-Type: application/json;charset=UTF-8
[
{"data":{"id":"816f9030455011e4b31cbb293fafe316",
  "message":{"chatSessionId":"000E5aA2A40P000Q",
  "transcriptPosition":"4",
  "chatServiceMessage":"Chat service is available",
  "startedAt":"2014-09-26T07:40:55Z",
  "chatIxnState":"TRANSCRIPT",
  "transcriptToShow":[["Message.Text","Kristi 
Sippola","Hello","23","AGENT"]]},
  "tag":"service.chat.refresh.4d1697a9-dda5-4742-8a6f-fbc01c25c640"},
  "channel":"/_genesys"},
  {"id":"6","successful":true,"channel":"/meta/connect"}
  ]

Send Client Chat Message

Request

POST 
http://localhost:8080/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/refresh
gms_user: "b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673
Content-Type:	application/x-www-form-urlencoded; charset=UTF-8

_verbose=true&message=Hi%20Verbose

Response

Content-Type: application/json;charset=UTF-8
{
"chatServerLoadBalancerAlias":"371",
"_chatIxnAPI_SEND_CUSTOM_URL":"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/customNotice",
"clientTimeZoneOffset":"120",
"transcriptPosition":"5",
"chatWebApiPort":"9002",
"startedAt":"2014-09-26T07:40:55Z",
"chatIxnState":"TRANSCRIPT",
"comet_channel":"/_genesys",
"secureKey":"1b21478a91a7d1dc",
"checkChatServiceLoadBalancerPath":"/WebAPI812/SimpleSamples812/ChatHA/ChatLBServerInfo.jsp?chatServerLoadBalancerAlias=371",
"_chatIxnAPI_REFRESH_FROM_START_URL":"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/refresh?transcriptPosition=1",
"_chatIxnAPI_REFRESH_URL":"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/refresh",
"isTLSrequired":"false",
"chatSessionId":"000E5aA2A40P000Q",
"_chatIxnAPI_DISCONNECT_URL":"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/disconnect",
"chatServiceMessage":"Chat service is available",
"userId":"0173542518870006",
"_chatIxnAPI_STOP_TYPING_URL":"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/stopTyping",
"_chatIxnAPI_START_TYPING_URL":"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/startTyping",
"_chatIxnAPI_SEND_URL":"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/send",
"chatServerHost":"demosrv.genesyslab.com"
}

Client Message is Being Echoed Back Through CometD Channel as a Response to "refresh" or "send" Request

Request

POST http://localhost:8080/genesys/cometd/connect
gms_user: b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673
Content-Type: application/json;charset=UTF-8

[{"channel":"/meta/connect","connectionType":"long-polling","id":"7","clientId":"3vym301sjdtc218qabm5w0z8yb"}]"

Response

Content-Type: application/json;charset=UTF-8
[
{"data":{"id":"867b3840455011e4b31cbb293fafe316",
          "message":{"chatSessionId":"000E5aA2A40P000Q",
		 "transcriptPosition":"5",
		 "chatServiceMessage":"Chat service is available",
		 "startedAt":"2014-09-26T07:40:55Z",
		 "chatIxnState":"TRANSCRIPT",
		 "transcriptToShow":[["Message.Text","127.0.0.1","Hi 
Verbose","32","CLIENT"]]},
  "tag":"service.chat.refresh.4d1697a9-dda5-4742-8a6f-fbc01c25c640"},
  "channel":"/_genesys"},
  {"id":"7","successful":true,"channel":"/meta/connect"}]

CometD Polling

Request

POST http://localhost:8080/genesys/cometd/connect
gms_user: b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673
Content-Type: application/json;charset=UTF-8

[{"channel":"/meta/connect","connectionType":"long-polling","id":"8","clientId":"3vym301sjdtc218qabm5w0z8yb"}]"

Response

Content-Type: application/json;charset=UTF-8
[{"id":"8","successful":true,"advice":{"reconnect":"none"},"channel":"/meta/connect"}]

Disconnect Chat Session

Request

POST 
http://localhost:8080/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/disconnect
gms_user: b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673
Content-Type:	application/x-www-form-urlencoded; charset=UTF-8

_verbose=true

Response

Content-Type: application/json;charset=UTF-8
{
"chatIxnState" : "DISCONNECTED",
"transcriptPosition" : "5",
"chatServiceMessage" : "Chat was finished",
"chatSessionId" : "000E5aA2A40P000Q",
"userId" : "0173542518870006",
"secureKey" : "1b21478a91a7d1dc",
"checkChatServiceLoadBalancerPath" : 
"/WebAPI812/SimpleSamples812/ChatHA/ChatLBServerInfo.jsp?chatServerLoadBalancerAlias=371",
"chatServerLoadBalancerAlias" : "371",
"chatServerHost" : "demosrv.genesyslab.com",
"chatWebApiPort" : "9002",
"isTLSrequired" : "false",
"clientTimeZoneOffset" : "120",
"_chatIxnAPI_SEND_URL" : 
"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/send",
"_chatIxnAPI_REFRESH_URL" : 
"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/refresh",
"_chatIxnAPI_START_TYPING_URL" : 
"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/startTyping", 

"_chatIxnAPI_STOP_TYPING_URL" : 
"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/stopTyping", 

"_chatIxnAPI_DISCONNECT_URL" : 
"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/disconnect",
"_chatIxnAPI_REFRESH_FROM_START_URL":"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/refresh?transcriptPosition=1",
"_chatIxnAPI_SEND_CUSTOM_URL" : 
"/genesys/1/service/4d1697a9-dda5-4742-8a6f-fbc01c25c640/ixn/chat/customNotice"
}

CometD Unsubscribe

Request

POST http://localhost:8080/genesys/cometd/
gms_user: b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673
Content-Type: application/json;charset=UTF-8

[{"channel":"/meta/unsubscribe","subscription":"/_genesys","id":"9","clientId":"3vym301sjdtc218qabm5w0z8yb"}]

Response

Content-Type: application/json;charset=UTF-8
[{"id":"9","subscription":"/_genesys","successful":true,"channel":"/meta/unsubscribe"}]

CometD Disconnect

Request

POST http://localhost:8080/genesys/cometd/disconnect
gms_user: b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673
Content-Type: application/json;charset=UTF-8

[{"channel":"/meta/disconnect","id":"10","clientId":"3vym301sjdtc218qabm5w0z8yb"}]

Response

Content-Type: application/json;charset=UTF-8
[{"id":"10","successful":true,"channel":"/meta/disconnect"}]

Quick Start Examples

The following quick start examples show how you can establish a CometD connection to receive asynchronous notification, and how to create a service.

Using CometD to Receive Event Updates

If you are using CometD to get event updates on the chat session then you need to set up a CometD connection with a subscription for /_genesys. You also need to make sure 'gms_user' header in all cometd related requests is set to the value uniquely representing application end user. Typically this value would be setup (or at least verified) by security gateway located between client application and GMS.

CometD handshake request

POST http://localhost:8080/genesys/cometd
Accept-Encoding: gzip,deflate
Content-Type: application/json;charset=UTF-8
gms_user: BuzzBrain
{"version":"1.0","minimumVersion":"0.9","channel":"/meta/handshake","id":"0"}
HTTP/1.1 200 OK
Date: Sun, 10 Jun 2012 08:30:10 GMT
Content-Type: application/json 
Content-Length: 230
 [{"id":"0","minimumVersion":"1.0","supportedConnectionTypes":["websocket","callback-polling","long-polling"], "successful":true,"channel":"/meta/handshake","ext": "ack":true},"clientId":"44xkkazwfabw73jrvjsvoy4ul","version":"1.0"}]

CometD /meta/connect subscription request

POST  http://localhost:8080/genesys/cometd 
Accept-Encoding: gzip,deflate 
Content-Type: application/json;charset=UTF-8
gms_user: BuzzBrain
{"channel":"/meta/connect","clientId":"44xkkazwfabw73jrvjsvoy4ul","id":"1","connectionType":"long-polling"}
HTTP/1.1 200 OK 
Date: Sun, 10 Jun 2012 08:30:10 GMT
Content-Type: application/json
 Content-Length: 116 
[{"id":"1","successful":true,"advice":{"interval":0,"reconnect":"retry","timeout":60000},"channel":"/meta/connect"}]

CometD /_genesys subscription request

POST  http://localhost:8080/genesys/cometd Accept-Encoding: gzip,deflate
Content-Type: application/json;charset=UTF-8
gms_user: BuzzBrain
[{"channel":"/meta/subscribe","subscription":"/_genesys","clientId":"44xkkazwfabw73jrvjsvoy4ul","id":"2"}]
HTTP/1.1 200 OK 
Date: Sun, 10 Jun 2012 08:30:10 GMT 
Content-Type: application/json
Content-Length: 85 
[{"id":"2","subscription":"/_genesys","successful":true,"channel":"/meta/subscribe"}]

CometD long polling request

POST  http://localhost:8080/genesys/cometd 
Accept-Encoding: gzip,deflate 
Content-Type: application/json;charset=UTF-8
gms_user: BuzzBrain
{"clientId":"44xkkazwfabw73jrvjsvoy4ul","id":"3","channel":"/meta/connect","connectionType":"long-polling"}
HTTP/1.1 200 OK
Date: Sun, 10 Jun 2012 08:30:10 GMT 
Content-Type: application/json 
Content-Length: 85
[{"id":"4","successful":true,"channel":"/meta/connect"}]

Creating a Genesys Mobile Services-Based Service Associated with a Chat Session

The following section illustrates the process of creating and using a service.

Create a Service:

Request:

POST http://localhost:8080/genesys/1/service/request-chat-poll HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/x-www-form-urlencoded
_verbose=false

Response:

HTTP/1.1 200 OK
Date: Sun, 10 Jun 2012 08:23:29 GMT
Content-Type: application/json
{"_id":"EKUJPKAQ197CFA6SJQKTJ03DBG00001M"}

Use the _id field from the response to check service status until it changes to "available":

Request:

POST http://localhost:8080/genesys/1/service/EKUJPKAQ197CFA6SJQKTJ03DBG00001M/status HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/x-www-form-urlencoded

Response:

HTTP/1.1 200 OK
Date: Sun, 10 Jun 2012 08:26:26 GMT
Content-Type: application/json
Content-Length: 185
{
   "message":    {
      "_id": "EKUJPKAQ197CFA6SJQKTJ03DBG00001M",
      "_status": "waiting",
      "_dialog": "waiting_for_agent.html"
   },
   "tag": "a2c.advanced.service.statuschanged.EKUJPKAQ197CFA6SJQKTJ03DBG00001M"
}

Repeat request until status changes:

Request:

POST http://localhost:8080/genesys/1/service/EKUJPKAQ197CFA6SJQKTJ03DBG00001M/status HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/x-www-form-urlencoded

Response:

HTTP/1.1 200 OK
Date: Sun, 10 Jun 2012 08:28:25 GMT
Content-Type: application/json
Content-Length: 186
{
   "message":    {
      "_id": "EKUJPKAQ197CFA6SJQKTJ03DBG00001M",
      "_status": "available",
      "_dialog": "agent_available.html"
   },
   "tag": "a2c.advanced.service.agentavailable.EKUJPKAQ197CFA6SJQKTJ03DBG00001M"
}

Create chat interaction using same sessionid:

To create a chat interaction that is associated with a service, a ixn/chat request is sent with the parameters to initiate the chat session.

Parameter Name Mandatory Description
firstName no First name of the user. If provided will be attached as "fldnFirstName" to the chat interaction.
lastName no Last name of the user. If provided will be attached as "fldnLastName" to the chat interaction.
email no e-Mail address of the subject. If provided will be attached as "fldnEmailAddress" to the chat interaction.
subject yes Subject of the service and chat session.
userDisplayName no Available since GMS 8.1.100.27. Nickname to be displayed in the chat conversation.
notify_by false If using a CometD connection for the asynchronous receiving of chat messages, then supply this parameter with the value "comet".

Request:

POST http://localhost:8080/genesys/1/service/EKUJPKAQ197CFA6SJQKTJ03DBG00001M/ixn/chat HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/x-www-form-urlencoded
notify_by=comet&firstName=Vasya&lastName=Pupkin&email=Vasya.Pupkin@genesyslab.com&subject=test

Response:

HTTP/1.1 200 OK
Date: Sun, 10 Jun 2012 08:30:10 GMT
Content-Type: application/json
Content-Length: 119
{
 "chatIxnState" : "CONNECTED",
 "transcriptPosition" : "1",
 "chatServiceMessage" : "Chat service is available"
}

Refresh chat transcript and show messages to the user:

Request:

POST http://localhost:8080/genesys/1/service/EKUJPKAQ197CFA6SJQKTJ03DBG00001M/ixn/chat/refresh HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/x-www-form-urlencoded

Response:

HTTP/1.1 200 OK
Date: Sun, 10 Jun 2012 08:33:00 GMT
Content-Type: application/json
Content-Length: 367
{"_id":"B2FS3346K151548QMEAFD89TE8000EBJ","comet_channel":"/_genesys"} 

Send user's message:

Request:

POST http://localhost:8080/genesys/1/service/EKUJPKAQ197CFA6SJQKTJ03DBG00001M/ixn/chat/refresh HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/x-www-form-urlencoded
message=hello agent

Response:

HTTP/1.1 200 OK
Date: Sun, 10 Jun 2012 08:34:38 GMT
Content-Type: application/json
Content-Length: 241
{"_id":"B2FS3346K151548QMEAFD89TE8000EBJ","comet_channel":"/_genesys"} 

Disconnect user from chat:

Request:

POST http://localhost:8080/genesys/1/service/EKUJPKAQ197CFA6SJQKTJ03DBG00001M/ixn/chat/disconnect HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/x-www-form-urlencoded

Response:

HTTP/1.1 200 OK
Date: Sun, 10 Jun 2012 07:43:07 GMT
Content-Type: application/json
Content-Length: 114
{
 "chatIxnState" : "DISCONNECTED",
 "transcriptPosition" : "9",
 "chatServiceMessage" : "Chat was finished"
}

Chat Interaction APIs

Start Chat

This API creates and initiates a Chat Session. It works with the service session created through Genesys Mobile Services.

Operation

Method POST
URL /genesys/1/service/{service_id}/ixn/chat
Parameter   Type   Mandatory Description
URI Parameters
{service_id} string yes The identifier of the service that the chat session is suppose to be associated with.
Body: The body will be x-www-form-urlencoded form consisting of different items representing the key/value pairs associated with the request.
Body Properties: The following are the properties:
  • _verbose - This will allow the application to get all the detail attributes associated with the chat session in the corresponding response.
  • notify_by - If specified should be "comet".
  • firstName - User's first name. Optional.
  • lastName - User's last name. Optional.
  • email - User's email address. Optional.
  • subject - Subject of the chat conversation.
  • subscriptionID – ID of the subscription created to receive specific events on Comet channel disconnection.
  • userDisplayName - Nickname displayed in the chat conversation. Optional.

Response

HTTP code 200
HTTP message OK
Body A chat JSON object for details on the properties of the object. See the section on data structures for more details.
Notes The chat session id will be the service ID. The Genesys Mobile Services code for this API will keep track of the service ID to the chat server session.
HTTP code 503
HTTP message Service Unavailable
Body None
Notes Returned if the service has not sent a notification to the application that an agent is available.

Example

Request:

POST http://localhost:8080/genesys/1/service/9d6c31d3-1121-4ba9-91e1-b93c0fa6e32f/ixn/chat?_verbose=true HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/<code>x-www-form-urlencoded</code>
firstName=Vasya&lastName=Pupkin&email=Vasya.Pupkin@genesyslab.com&subject=test

Response (if transcriptPosition input parameter is null):

HTTP/1.1 200 OK
Date: Sat, 09 Jun 2012 22:26:16 GMT
Pragma: no-cache
Cache-Control: no-cache
Cache-Control: no-store
Content-Type: application/json
Content-Length: 1225
Server: Jetty(7.6.0.v20120127)
{
    "chatIxnState": "TRANSCRIPT",
    "chatSessionId":"000BRa84KRFB00BK",
    "transcriptPosition": "5",
    "chatServiceMessage": "Chat service is available",
    "startedAt": "2012-06-09T22:26:17Z",
    "userId": "015E4FD3CD890036",
    "secureKey": "b306749dabfa1cf6",
    "checkChatServiceLoadBalancerPath": 
"/WebAPI812/SimpleSamples812/ChatHA/ChatLBServerInfo.jsp?chatServerLoadBalancerAlias=350",
    "chatServerLoadBalancerAlias": "350",
    "chatServerHost": "localhost",
    "chatWebApiPort": "4856",
    "isTLSrequired": "false",
    "clientTimeZoneOffset": "-420",
    "_chatIxnAPI_SEND_URL": "/genesys/1/service/{service_id}/ixn/chat/send",
    "_chatIxnAPI_REFRESH_URL": 
"/genesys/1/service/{service_id}/ixn/chat/refresh",
    "_chatIxnAPI_START_TYPING_URL": 
"/genesys/1/service/{service_id}/ixn/chat/startTyping",
    "_chatIxnAPI_STOP_TYPING_URL": 
"/genesys/1/service/{service_id}/ixn/chat/stopTyping",
    "_chatIxnAPI_DISCONNECT_URL": 
"/genesys/1/service/{service_id}/ixn/chat/disconnect",
    "_chatIxnAPI_REFRESH_FROM_START_URL": 
"/genesys/1/service/{service_id}/ixn/chat/refresh?transcriptPosition=1"
}

Response (if transcript input parameter is set [transcriptToShow output parameter is set]):

HTTP/1.1 200 OK
Date: Sat, 09 Jun 2012 22:26:16 GMT
Pragma: no-cache
Cache-Control: no-cache
Cache-Control: no-store
Content-Type: application/json
Content-Length: 1225
Server: Jetty(7.6.0.v20120127)
{
    "chatIxnState": "TRANSCRIPT",
    "chatSessionId":"000BRa84KRFB00BK",
    "transcriptPosition": "5",
    "chatServiceMessage": "Chat service is available",
    "transcriptToShow":    [
             [
          "Notice.Joined",
          "ksippo",
          "has joined the session",
          "15",
          "AGENT"
       ],
             [
          "Message.Text",
          "VasyaP",
          "hello agent",
          "26",
          "CLIENT"
       ],
             [
          "Notice.TypingStarted",
          "ksippo",
          "is typing",
          "57",
          "AGENT"
       ],
             [
          "Message.Text",
          "ksippo",
          "hello customer",
          "61",
          "AGENT"
       ]
    ],
    "startedAt": "2012-06-09T22:26:17Z",
    "userId": "015E4FD3CD890036",
    "secureKey": "b306749dabfa1cf6",
    "checkChatServiceLoadBalancerPath": 
"/WebAPI812/SimpleSamples812/ChatHA/ChatLBServerInfo.jsp?chatServerLoadBalancerAlias=350",
    "chatServerLoadBalancerAlias": "350",
    "chatServerHost": "localhost",
    "chatWebApiPort": "4856",
    "isTLSrequired": "false",
    "clientTimeZoneOffset": "-420",
    "_chatIxnAPI_SEND_URL": "/genesys/1/service/{service_id}/ixn/chat/send",
    "_chatIxnAPI_REFRESH_URL": 
"/genesys/1/service/{service_id}/ixn/chat/refresh",
    "_chatIxnAPI_START_TYPING_URL": 
"/genesys/1/service/{service_id}/ixn/chat/startTyping",
    "_chatIxnAPI_STOP_TYPING_URL": 
"/genesys/1/service/{service_id}/ixn/chat/stopTyping",
    "_chatIxnAPI_DISCONNECT_URL": 
"/genesys/1/service/{service_id}/ixn/chat/disconnect",
    "_chatIxnAPI_REFRESH_FROM_START_URL": 
"/genesys/1/service/{service_id}/ixn/chat/refresh?transcriptPosition=1"
}


Refresh Chat

This API refreshes the users view with the latest updates to the Chat session. It can also be used to simultaneously send a user message to the chat session.

Operation

Method POST
URL /genesys/1/service/{service_id}/ixn/chat/refresh
Parameter   Type   Mandatory Description
URI Parameters
{service_id} string yes The identifier of the service that the chat session is associated with.
Body: The body will be x-www-form-urlencoded form consisting of different items representing the key/value pairs associated with the request.
Body Properties: The following are the properties:
  • transcriptPosition – This optional property indicates the current position in the chat session that the current user is in. This property is ignored when notify_by = comet when starting the chat session (ixn/chat)
  • message – This optional property is a chat message that will be added to the chat session/transcript.
  • _verbose - This optional property will allow the application to get all the detail attributes associated with the chat session in the corresponding response.

Response

HTTP code 200
HTTP message OK
Body A chat JSON object for details on the properties of the object. See the section on data structures for more details.
Notes The main property is the list of chat message that have been communicated (transcriptToShow).
HTTP code 503
HTTP message Service Unavailable
Body None
Notes This is returned if the service has not sent a notification to the application that an agent is available.

Example Request:

POST http://localhost:8080/genesys/1/service/EKUJPKAQ197CFA6SJQKTJ03DBG00001H/ixn/chat/refresh?_verbose=true HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/<code>x-www-form-urlencoded</code>
message=aaa

Response (if transcriptPosition input parameter is null):

HTTP/1.1 200 OK
Date: Sat, 09 Jun 2012 22:26:16 GMT
Pragma: no-cache
Cache-Control: no-cache
Cache-Control: no-store
Content-Type: application/json
Content-Length: 1225
Server: Jetty(7.6.0.v20120127)
{
    "chatIxnState": "TRANSCRIPT",
    "chatSessionId":"000BRa84KRFB00BK",
    "transcriptPosition": "5",
    "chatServiceMessage": "Chat service is available",
    "startedAt": "2012-06-09T22:26:17Z",
    "userId": "015E4FD3CD890036",
    "secureKey": "b306749dabfa1cf6",
    "checkChatServiceLoadBalancerPath": 
"/WebAPI812/SimpleSamples812/ChatHA/ChatLBServerInfo.jsp?chatServerLoadBalancerAlias=350",
    "chatServerLoadBalancerAlias": "350",
    "chatServerHost": "localhost",
    "chatWebApiPort": "4856",
    "isTLSrequired": "false",
    "clientTimeZoneOffset": "-420",
    "_chatIxnAPI_SEND_URL": "/genesys/1/service/{service_id}/ixn/chat/send",
    "_chatIxnAPI_REFRESH_URL": 
"/genesys/1/service/{service_id}/ixn/chat/refresh",
    "_chatIxnAPI_START_TYPING_URL": 
"/genesys/1/service/{service_id}/ixn/chat/startTyping",
    "_chatIxnAPI_STOP_TYPING_URL": 
"/genesys/1/service/{service_id}/ixn/chat/stopTyping",
    "_chatIxnAPI_DISCONNECT_URL": 
"/genesys/1/service/{service_id}/ixn/chat/disconnect",
    "_chatIxnAPI_REFRESH_FROM_START_URL": 
"/genesys/1/service/{service_id}/ixn/chat/refresh?transcriptPosition=1"
}

Response (if transcript input parameter is set [transcriptToShow output parameter is set]):

HTTP/1.1 200 OK
Date: Sat, 09 Jun 2012 22:26:16 GMT
Pragma: no-cache
Cache-Control: no-cache
Cache-Control: no-store
Content-Type: application/json
Content-Length: 1225
Server: Jetty(7.6.0.v20120127)
{
    "chatIxnState": "TRANSCRIPT",
    "chatSessionId":"000BRa84KRFB00BK",
    "transcriptPosition": "5",
    "chatServiceMessage": "Chat service is available",
    "transcriptToShow":    [
             [
          "Notice.Joined",
          "ksippo",
          "has joined the session",
          "15",
          "AGENT"
       ],
             [
          "Message.Text",
          "VasyaP",
          "hello agent",
          "26",
          "CLIENT"
       ],
             [
          "Notice.TypingStarted",
          "ksippo",
          "is typing",
          "57",
          "AGENT"
       ],
             [
          "Message.Text",
          "ksippo",
          "hello customer",
          "61",
          "AGENT"
       ]
    ],
    "startedAt": "2012-06-09T22:26:17Z",
    "userId": "015E4FD3CD890036",
    "secureKey": "b306749dabfa1cf6",
    "checkChatServiceLoadBalancerPath": 
"/WebAPI812/SimpleSamples812/ChatHA/ChatLBServerInfo.jsp?chatServerLoadBalancerAlias=350",
    "chatServerLoadBalancerAlias": "350",
    "chatServerHost": "localhost",
    "chatWebApiPort": "4856",
    "isTLSrequired": "false",
    "clientTimeZoneOffset": "-420",
    "_chatIxnAPI_SEND_URL": "/genesys/1/service/{service_id}/ixn/chat/send",
    "_chatIxnAPI_REFRESH_URL": 
"/genesys/1/service/{service_id}/ixn/chat/refresh",
    "_chatIxnAPI_START_TYPING_URL": 
"/genesys/1/service/{service_id}/ixn/chat/startTyping",
    "_chatIxnAPI_STOP_TYPING_URL": 
"/genesys/1/service/{service_id}/ixn/chat/stopTyping",
    "_chatIxnAPI_DISCONNECT_URL": 
"/genesys/1/service/{service_id}/ixn/chat/disconnect",
    "_chatIxnAPI_REFRESH_FROM_START_URL": 
"/genesys/1/service/{service_id}/ixn/chat/refresh?transcriptPosition=1"
}


Start Typing

This API allows the application to indicate that the user started typing a chat message for the session.

Operation

Method POST
URL /genesys/1/service/{service_id}/ixn/chat/startTyping
Parameter   Type   Mandatory Description
URI Parameters
{service_id} string yes The identifier of the service that the chat session is suppose to be associated with.
Body: The body will be x-www-form-urlencoded form consisting of different items representing the key/value pairs associated with the request.
Body Properties: The following are the properties:
  • _verbose - This will allow the application to get all the detail attributes associated with the chat session in the correspondingresponse.

Response

HTTP code 200
HTTP message OK
Body A chat JSON object for details on the properties of the object. See the section on data structures for more details.
Notes None
HTTP code 503
HTTP message Service Unavailable
Body None
Notes This is returned if the service has not sent a notification to the application that an agent is available.

Example Request:

POST http://localhost:8080/genesys/1/service/EKUJPKAQ197CFA6SJQKTJ03DBG00001J/ixn/chat/startTyping HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/<code>x-www-form-urlencoded</code>

Response:

HTTP/1.1 200 OK
Date: Sun, 10 Jun 2012 07:38:38 GMT
Pragma: no-cache
Cache-Control: no-cache
Cache-Control: no-store
Content-Type: application/json
Content-Length: 246
Server: Jetty(7.6.0.v20120127)
{
   "chatIxnState": "TRANSCRIPT",
   "transcriptPosition": "8",
   "chatServiceMessage": "Chat service is available",
   "transcriptToShow": [   [
      "Notice.TypingStarted",
      "VasyaP",
      "is typing",
      "57",
      "CLIENT"
   ]],
   "startedAt": "2012-06-10T07:37:42Z"
}

Stop Typing

This API allows the application to indicate that the user has stopped typing a chat message for the session.

Operation

Method POST
URL /genesys/1/service/{service_id}/ixn/chat/stopTyping
Parameter   Type   Mandatory Description
URI Parameters
{service_id} string yes The identifier of the service that the chat session is suppose to be associated with.
Body: The body will be x-www-form-urlencoded form consisting of different items representing the key/value pairs associated with the request.
Body Properties: The following are the properties:
  • _verbose - This will allow the application to get all the detail attributes associated with the chat session in the correspondingresponse.

Response

HTTP code 200
HTTP message OK
Body A chat JSON object for details on the properties of the object. See the section on data structures for more details.
Notes None
HTTP code 503
HTTP message Service Unavailable
Body None
Notes This is returned if the service has not sent a notification to the application that an agent is available.

Example Request:

POST http://localhost:8080/genesys/1/service/EKUJPKAQ197CFA6SJQKTJ03DBG00001J/ixn/chat/stopTyping HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/<code>x-www-form-urlencoded</code>

Response:

HTTP/1.1 200 OK
Date: Sun, 10 Jun 2012 07:38:58 GMT
Pragma: no-cache
Cache-Control: no-cache
Cache-Control: no-store
Content-Type: application/json
Content-Length: 251
Server: Jetty(7.6.0.v20120127)
{
   "chatIxnState": "TRANSCRIPT",
   "transcriptPosition": "9",
   "chatServiceMessage": "Chat service is available",
   "transcriptToShow": [   [
      "Notice.TypingStopped",
      "VasyaP",
      "stopped typing",
      "77",
      "CLIENT"
   ]],
   "startedAt": "2012-06-10T07:37:42Z"
}

Disconnect from chat session

This API allows the application to disconnect user from the chat session.

Operation

Method POST
URL /genesys/1/service/{service_id}/ixn/chat/disconnect
Parameter   Type   Mandatory Description
URI Parameters
{service_id} string yes The identifier of the service that the chat session is suppose to be associated with.
Body: The body will be x-www-form-urlencoded form consisting of different items representing the key/value pairs associated with the request.
Body Properties: The following are the properties:
  • _verbose - This will allow the application to get all the detail attributes associated with the chat session in the correspondingresponse.

Response

HTTP code 200
HTTP message OK
Body A chat JSON object for details on the properties of the object. See the section on data structures for more details.
Notes None
HTTP code 503
HTTP message Service Unavailable
Body None
Notes This is returned if the service has not sent a notification to the application that an agent is available.

Example Request:

POST http://localhost:8080/genesys/1/service/EKUJPKAQ197CFA6SJQKTJ03DBG00001J/ixn/chat/disconnect HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/<code>x-www-form-urlencoded</code>

Response:

HTTP/1.1 200 OK
Date: Sun, 10 Jun 2012 07:43:07 GMT
Pragma: no-cache
Cache-Control: no-cache
Cache-Control: no-store
Content-Type: application/json
Content-Length: 114
Server: Jetty(7.6.0.v20120127)
{
 "chatIxnState" : "DISCONNECTED",
 "transcriptPosition" : "9",
 "chatServiceMessage" : "Chat was finished"
}

Basic Chat Service API

Create basic chat service

This API allows the application to create basic chat service session and then initiate chat interaction immediately or when user is ready. Note: If agent availability need to be checked before chat interaction is started - use one of the advanced sessions (for example: request-chat-poll)

Operation

Method POST
URL /genesys/1/service/request-chat
Parameter   Type   Mandatory Description
URI Parameters
'request-chat' String yes Name of the preconfigured basic chat service
Body: The body will be x-www-form-urlencoded form consisting of different items representing the key/value pairs associated with the request.
Body Properties: The following are the properties:
  • _verbose - This will allow the application to get all the detail attributes associated with the chat session in the corresponding response.
  • ... - Any other business data attributes can also be passed.

Response

HTTP code 200
HTTP message OK
Body A chat JSON object for details on the properties of the object. See the section on data structures for more details.
Notes None
HTTP code 503
HTTP message Service Unavailable
Body None
Notes This is send if the service has not sent a notification to the application that an agent is available.

Example Request:

POST http://localhost:8080/genesys/1/service/request-chat HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/x-www-form-urlencoded
_verbose=true

Response:

HTTP/1.1 200 OK
Date: Sun, 10 Jun 2012 07:49:46 GMT
Pragma: no-cache
Cache-Control: no-cache
Cache-Control: no-store
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(7.6.0.v20120127)
{
"_chatIxnAPI-CREATE-URL":"/genesys/1/service/81f0ef4e-99dd-43ea-8366-8d27a2cbd605/ixn/chat",
"_id":"81f0ef4e-99dd-43ea-8366-8d27a2cbd605"
}
This page was last edited on May 18, 2023, at 04:24.
Comments or questions about this documentation? Contact us for support!