(Created target blank page For Version: PSAAS:Julie) |
(Automated save: adding PEC_Migrated template.) |
||
Line 1: | Line 1: | ||
− | <!-- | + | = Genesys Co-browse Realtime API (CometD and REST) = |
+ | |||
+ | {{Template:PEC_Migrated}} | ||
+ | |||
+ | |||
+ | |||
+ | This content is restricted. Please contact your Genesys representative for access permissions. | ||
+ | |||
+ | {{ClosedProductNote}} | ||
+ | |||
+ | [[Documentation:PSAAS:Administrator:GCBCobrowseRealtimeAPI:Closed|Click here to access this content (login required).]] | ||
+ | |||
+ | <!-- | ||
+ | The Genesys Co-browse Realtime API enables you to integrate Co-browse functionality with custom agent desktops. Read this article if you're not using Genesys Agent Desktop. | ||
+ | |||
+ | Typically, Co-browse functionality is integrated with an agent application through the following steps: | ||
+ | # Get the session token (or "live id") from the user who has started the session. How this is achieved depends on the application. For example, it can be passed automatically via a chat message, or manually over a voice call. | ||
+ | #Use the session token to issue a Get Session REST Request. | ||
+ | #Use the <tt>sessionServerUrl</tt> from the response to initiate a CometD connection. | ||
+ | #Join the session over CometD. | ||
+ | #Open the Co-browse agent web UI (slave.html) inside your agent application UI. This is typically done via an iframe for web applications. For desktop applications, an embedded browser might be used. When embedded, this UI automatically joins the session and displays the user web page and Co-browse agent UI controls. | ||
+ | #The agent application may then use the CometD connection to: | ||
+ | #*Subscribe to session events. | ||
+ | #*Control the co-browse session (for example, stop it when the chat or voice interaction ends). | ||
+ | |||
+ | {{AnchorDiv|rrf}} | ||
+ | |||
+ | ==RESTful Functions== | ||
+ | |||
+ | The RESTful resources that manage live co-browse sessions are sub-resources of <tt><nowiki>https://api.genesyscloud.com/gcb/cobrowse/rest/live</nowiki></tt>. | ||
+ | ===Create Session=== | ||
+ | {| | ||
+ | ! Request URL | ||
+ | | /sessions | ||
+ | |- | ||
+ | ! HTTP Method | ||
+ | | POST | ||
+ | |- | ||
+ | ! Description | ||
+ | | Creates a new Co-browse session. Note that session is always created by the end user so generally you don't need to use this method for agent desktop integration. | ||
+ | |} | ||
+ | OR: | ||
+ | {| | ||
+ | ! Request URL | ||
+ | | /sessions/create | ||
+ | |- | ||
+ | ! HTTP Method | ||
+ | | GET | ||
+ | |- | ||
+ | ! Description | ||
+ | | Creates a new Co-browse session. Note that session is always created by the end user so generally you don't need to use this method for agent desktop integration. | ||
+ | |} | ||
+ | ====Response:==== | ||
+ | <source lang="text"> | ||
+ | { | ||
+ | "sessionToken": "845800826", | ||
+ | "sessionServerName": "Co-browse_Server" | ||
+ | } | ||
+ | </source> | ||
+ | The HTTP response has a cookie, <tt>gcbSessionServer</tt>, which should stick further HTTP requests to the server hosting the created session. | ||
+ | |||
+ | ===Get Session=== | ||
+ | {| | ||
+ | ! Request URL | ||
+ | | /sessions/{id} | ||
+ | |- | ||
+ | ! HTTP Method | ||
+ | | GET | ||
+ | |- | ||
+ | ! Description | ||
+ | | Returns live session public data. The main purpose is to determine which server the session is hosted on (this is needed to integrate the agent Co-browse plug-in with the Co-browse cluster). The <tt>id</tt> is the live session ID. | ||
+ | |} | ||
+ | ====Response:==== | ||
+ | <source lang="text"> | ||
+ | { | ||
+ | "sessionToken": "845800826", | ||
+ | "sessionServerName": "Co-browse_Server", | ||
+ | "sessionServerUrl": "https://api.genesyscloud.com/gcb/cobrowse?cobrowsenodeid=<node_internal_id>" // example node id: b73e368e5313 | ||
+ | } | ||
+ | </source> | ||
+ | <tt>sessionServerUrl</tt> is the URL your agent application must use for all subsequent requests to ensure proper load balancing. Don't forget to pass the API key as well. So, for example, the final URL for requests to the CometD API may look like: <tt><nowiki>https://api.genesyscloud.com/gcb/cobrowse/cometd?cobrowsenodeid=b73e368e5313&apikey=t6blRA2HbPi4dbbzdjI02K0KJH4IOzOa</nowiki></tt> | ||
+ | |||
+ | ===Stop Session=== | ||
+ | {| | ||
+ | ! Request URL | ||
+ | | /users/{userToken}/session/stop | ||
+ | |- | ||
+ | ! HTTP Method | ||
+ | | GET | ||
+ | |- | ||
+ | ! Description | ||
+ | | Initiates Co-browse session deactivation for the Controller's session. <tt>userToken</tt> is the Controller's <tt>userToken</tt>. | ||
+ | |} | ||
+ | ====Response==== | ||
+ | <source lang="text"> | ||
+ | { | ||
+ | "activationTime": 1368722791040, // UTC time stamp in ms | ||
+ | "deactivationTime": 1368722820929 // UTC time stamp in ms | ||
+ | } | ||
+ | </source> | ||
+ | |||
+ | |||
+ | {{AnchorDiv|csp}} | ||
+ | |||
+ | ==Co-browse slave page== | ||
+ | The slave page is the agent side of the co-browse functionality. The slave page is opened in a browser with a dynamically built URL in the following format: | ||
+ | |||
+ | <tt><nowiki>https://api.genesyscloud.com/gcb/cobrowse/slave.html?apikey=<apikey>&auth=<token>#nosidinput=1&sid=<sessionToken></nowiki></tt> | ||
+ | |||
+ | :<tt><apikey></tt> — Your Co-browse API Key. | ||
+ | :<tt><authtoken></tt> — Your Co-browse agent application authentication token. | ||
+ | :<tt><sessionToken></tt> — Co-browse session token. This token is transferred from user to agent by any communication channel. | ||
+ | :<tt>nosidinput=1</tt> — Specify this parameter if the plug-in UI provides its own session ID input field. | ||
+ | |||
+ | {{AnchorDiv|cicdc}} | ||
+ | |||
+ | == Client-initiated CometD channels== | ||
+ | |||
+ | ===Join Session=== | ||
+ | {| | ||
+ | ! CometD Channel | ||
+ | | /service/session/join | ||
+ | |- | ||
+ | ! Description | ||
+ | | Allows the user to join the session. | ||
+ | |} | ||
+ | ====Request:==== | ||
+ | <source lang="text"> | ||
+ | { | ||
+ | "sessionToken": "123", | ||
+ | "authToken": <authtoken>, | ||
+ | "role": 2 // 1 - master, 2 - slave, 3 - controller | ||
+ | } | ||
+ | </source> | ||
+ | |||
+ | ====Response:==== | ||
+ | <source lang="text"> | ||
+ | { | ||
+ | "userToken": "abc789", | ||
+ | "userId": 2, | ||
+ | "users": [ | ||
+ | { | ||
+ | "userId": "1", | ||
+ | "role": 1 | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </source> | ||
+ | Every connected user receives a <tt>userToken</tt> providing personalized session access. | ||
+ | |||
+ | ===Exit Session=== | ||
+ | {| | ||
+ | ! CometD Channel | ||
+ | | /service/session/exit | ||
+ | |- | ||
+ | ! Description | ||
+ | | Allows the user to exit the session explicitly. The CometD disconnection should be handled via session deactivated notification. | ||
+ | |} | ||
+ | ====Request:==== | ||
+ | <source lang="text"> | ||
+ | { | ||
+ | userToken: "abc123" | ||
+ | } | ||
+ | </source> | ||
+ | ====Response:==== | ||
+ | <source lang="text"> | ||
+ | {} | ||
+ | </source> | ||
+ | |||
+ | ===Stop Session=== | ||
+ | {| | ||
+ | ! CometD Channel | ||
+ | | /service/session/stop | ||
+ | |- | ||
+ | ! Description | ||
+ | | Stops the co-browse session. This is available for the Controller only. The session is deactivated and all users receive the session deactivated notification. | ||
+ | |} | ||
+ | ====Request:==== | ||
+ | <source lang="text"> | ||
+ | { | ||
+ | userToken: "abc123" | ||
+ | } | ||
+ | </source> | ||
+ | ====Response:==== | ||
+ | <source lang="text"> | ||
+ | {} | ||
+ | </source> | ||
+ | {{AnchorDiv|sicdcn}} | ||
+ | |||
+ | ==Server-initiated CometD channels (notifications)== | ||
+ | ===Joined Session=== | ||
+ | {| | ||
+ | ! CometD Channel | ||
+ | | /service/session/joined | ||
+ | |- | ||
+ | ! Description | ||
+ | | Notification to all users who are already in the session about a new joined user. | ||
+ | |} | ||
+ | ====Notification:==== | ||
+ | <source lang="text"> | ||
+ | { | ||
+ | "userId": "2", | ||
+ | "role": 2 | ||
+ | } | ||
+ | </source> | ||
+ | |||
+ | ===Activated Session === | ||
+ | {| | ||
+ | ! CometD Channel | ||
+ | | /service/session/activated | ||
+ | |- | ||
+ | ! Description | ||
+ | | Notification to all clients about session activation. | ||
+ | |} | ||
+ | ====Notification:==== | ||
+ | <source lang="text"> | ||
+ | { | ||
+ | "activationTime": 1368722791040 // UTC time in ms | ||
+ | } | ||
+ | </source> | ||
+ | === Deactivated Session === | ||
+ | {| | ||
+ | ! CometD Channel | ||
+ | | /service/session/deactivated | ||
+ | |- | ||
+ | ! Description | ||
+ | | Notification to all clients about session deactivation. When the client receives a session deactivated notification, it should disconnect from CometD. Sending the exit session command is not needed. | ||
+ | |} | ||
+ | ====Notification:==== | ||
+ | <source lang="text"> | ||
+ | { | ||
+ | "activationTime": 1368722791040 // UTC time in ms | ||
+ | "deactivationTime": 1368722820929 // UTC time in ms | ||
+ | } | ||
+ | </source> | ||
+ | --> | ||
+ | [[Category:V:PSAAS:Julie]] |
Latest revision as of 22:51, June 21, 2020
Genesys Co-browse Realtime API (CometD and REST)
Important
This content may not be the latest Genesys Engage cloud content. To find the latest content, go to Genesys Engage cloud for Administrators.
This content is restricted. Please contact your Genesys representative for access permissions.
Important
To access this content:
- Customers: Log in to My Support and select Documentation.
- Partners: Log in to Partner Portal and select Genesys Technical Docs.
- Employees: Go to the internal access point.
This page was last edited on June 21, 2020, at 22:51.
Comments or questions about this documentation? Contact us for support!