# Agent Logout


# Usage

Fired when the agent logs out of the CTI Adaptor.

# Syntax

webClient.onAgentLogout(listener: Function);

# Arguments

Name Type Description
listener function JavaScript method executed when the API method call is completed

# Sample Javascript

const callback = (response) => {
    if (response.error) console.error(response.error);
    if (response.result)

# Response

This method is asynchronous. The response is returned in an object passed to a callback method. The response object contains the following fields.

Example success Response

Returns this object if the API method call was invoked successfully, false otherwise.

  result: {
    message: string;
    timestamp: number; // unix timestamp
Example error Response

If the logout was successful, this variable is not returned. If the logout failed or was the result of an external event (i.e. expired session) , this variable returns an array of error messages.

  error: ErrorResponse[];