Class

IncomingEngagementRequest

IncomingEngagementRequest

IncomingEngagementRequest

Classes

IncomingEngagementRequest

Members

Promise

# engagementPromise

Fulfilled with Engagement

If the request is successful and the engagement is properly established then this promise will be fulfilled with the resulting Engagement.

Rejected with Error.

If the request is unsuccessful for any reason then this promise will be rejected with an Error. The Error may have one of the following causes:

  • DECLINE - When the request is declined by the visitor.
  • CANCEL - When the request is canceled by the operator.
  • TIMEOUT - When the visitor has failed to respond to the request in time.
  • INTERNAL_ERROR
  • NETWORK_TIMEOUT
Object

A logo included in this request. Provided to be displayed to the visitor during the request. The object has the following fields:

  • `url` - The URL to the image.
string

# message

A message from the operator included in this request.

Operator

# operator

The operator who initiated the request.

number

# timeout

The amount of time in milliseconds the visitor has to either accept or decline this engagement request. If the visitor fails to respond in time the engagementPromise will be rejected with a TIMEOUT cause.

Methods

# accept() → {Promise}

Accepts this incoming engagement request. After the request has been accepted, the timeout will be ignored and selectMedia can be called without any time pressure.

Fulfilled with an empty object or rejected with an Error if the process fails for any reason. The Error may have one of the following causes:

  • INTERNAL_ERROR
  • NETWORK_TIMEOUT
  • CONFLICT
Promise

# decline() → {Promise}

Declines this incoming engagement request.

Fulfilled with an empty object or rejected with an Error if the process fails for any reason. The Error may have one of the following causes:

  • INTERNAL_ERROR
  • NETWORK_TIMEOUT
Promise

# selectMedia(media, options) → {Promise}

Specifies the visitor's media selection, after the incoming engagement request has been accepted.

Parameters:
Name Type Attributes Description
media string The media to use for this engagement. Must be one of the following: 'text', 'phone', 'audio', 'video'.
options object Further options
phoneNumber string <nullable>
The visitor's phone number in E.164 format to use when media to upgrade to is 'phone'.
phoneExtension string <nullable>
The visitor's phone number extension, which can contain commas and up to 7 digits. The commas represent a two second wait between digits. This will be used when media to upgrade to is 'phone'.

Fulfilled with an empty object or rejected with an Error if the process fails for any reason. The Error may have one of the following causes:

  • INVALID_INPUT
  • INTERNAL_ERROR
  • NOT_SUPPORTED
  • NETWORK_TIMEOUT
Promise