Methods and Properties

The methods and properties listed below can be accessed using the Co-browse object:

Methods and Properties

N

Method

Required Application States

Description

1

Cobrowse.ready([callback])

Any state

This asynchronous function signals to the caller when Co-browse API is fully loaded and ready to use. If callback function is provided, it is called when the API is ready. Otherwise, this method returns a Promise which is resolved when the API is ready.

2

Cobrowse.API.checkEnvironment() INIT, READY

Performs an environment check and returns a JSON object identifying whether the environment supports Co-browse.

The following are the properties of the returned object:

ICB(boolean)Indicates whether the environment supports HTML-based Co-browse (instant mode)

ACB(boolean) Indicates whether the environment supports advanced Co-browse

If both properties have the value as false, the environment will not support Co-browse, and an attempt to start a Co-browse session will not succeed.

3

Cobrowse.API.setReportingId(params) INIT, READY

Identifies non-mandatory parameters for Co-browse reporting.

params is a JSON object. Supported properties:

extKey (unique alphanumeric value which will be associated with the Co-browse session and propagated to Co-browse reporting).

This function must be called before starting the Co-browsing session.

Example:

Cobrowse.API.setReportingId({”extKey”:”xZ097Ab”});

4

Cobrowse.API.Session.start([params]) READY

Sends a request to the Oracle servers to start a Co-browse session. Success or failure of the request can be further tracked through the events mechanism.

params is an optional parameter containing a JSON object.

Supported properties:

SID(alphanumeric value which will be used as a Co-browse session identifier)

return value: JSON object with two properties:

result(Boolean type) indicates whether the session start was successfully initiated

description contains error description (if any) which occurred when session was attempted to start

Example:Cobrowse.Session.start({"SID": "107343:ABC9877"});

5

Cobrowse.API.Session.stop([params]) STARTING, ACTIVE

Initiates a request to stop the Co-browse session.

params is an optional parameter containing a JSON object. Supported properties: reason (string value describing a disconnect reason).

return value: JSON object with two properties.

result (Boolean type) indicates whether the termination of the active session was successfully initiated

description contains error description (if any) which occurred when session was attempted to stop

6

Cobrowse.API.Session.getState() INIT,

READY,

STARTING,

ACTIVE,

DISCONNECTING

Returns string describing current state of the Co-browse application. Please refer to Application States section for the description of possible return values.

7 Cobrowse.API.Session.accessCode ACTIVE A read-only property which returns Co-browse access code as a string value when the Co-browse session is in progress, or undefined if there is no active session
8 Cobrowse.API.Session.mode ACTIVE A read-only property which returns a string with the mode for the active Co-browse session, or undefined if there is no session in progress. "ICB": HTML-based Co-browse (instant mode);"ACB": advanced screen-sharing mode
9 Cobrowse.API.Session.startAdvancedMode() ACTIVE Switches ongoing session to the advanced mode. This function call may require opening a new browser window or downloading an application file.

Unless it is triggered from a user-initiated event handler (like onclick or onkeydown), the new window (and thus the advanced mode) may be blocked by the browser.

return value: JSON object with two properties.

result (Boolean type) indicates whether the switch to advanced mode was successfully initiated

description contains error description (if any) which occurred during this attempt.

10 Cobrowse.API.Session.SID ACTIVE A read-only property which returns a session identifier.

If SID value is specified at session start, it has to be an alphanumeric value and upto 200 characters long; if the SID value is not specified, it will be undefined.