Rate this page:

ACDRequest

Represents request that is put to the ACD queue. Add the following line to your scenario code to use the class:

require(Modules.ACD);

Methods

addEventListener

Copy URL
addEventListener(event: 

ACDEvents

,
callback:

Function

):

void

Adds a handler for the specified ACDEvents event. Use only functions as handlers; anything except a function leads to the error and scenario termination when a handler will be called

Parameters

  • event:

    ACDEvents

    Event class (i.e., ACDEvents.Offline)

  • callback:

    Function

    Handler function. A single parameter is passed - object with event information

Returns

  • type:

    void

cancel

Copy URL
cancel(): 

void

Cancel pending request and remove it from queue

Returns

  • type:

    void

getStatus

Copy URL
getStatus(): 

void

Gets status of the current request. Mustn't be called before the request is successfully queued (the ACDEvents.Queued event). This method's call triggers the ACDEvents.Waiting event; it is possible to retrieve an estimated wait time in minutes via the ewt property of the event.

Returns

  • type:

    void

id

Copy URL
id(): 

string

Returns request id. It can be used as the acd_request_id parameter in the GetACDHistory method to search in ACD history.

Returns

  • type:

    string

removeEventListener

Copy URL
removeEventListener(event: 

ACDEvents

,
callback:

Function

):

void

Removes a handler for the specified ACDEvents event

Parameters

  • event:

    ACDEvents

    Event class (i.e., ACDEvents.Offline)

  • callback:

    Function

    Optional

    Handler function. If not specified, all event listeners are removed

Returns

  • type:

    void