#
Agent Login
#
Usage
Fired after a successful agent login.
#
Syntax
webClient.onAgentLogin(listener: Function);
#
Arguments
#
Sample Javascript
const callback = (response) => {
if (response.error) console.error(response.error);
if (response.result)
alert(response.result);
}
webClient.onAgentLogin(callback);
#
Response
This method is asynchronous. The response is returned in an object passed to a callback method. The response object contains the following fields.
Result
Example
success
Response
Returns this object if the API method call was invoked successfully, false otherwise.
{
result: {
agentId: number;
agentConnection: AgentVoiceConnection;
agentDisplayName: string;
agentFirstName: string;
agentLastName: atring;
agentPermission: AgentPermissions
agentTimezone: string; // ie: "Australia/Sydney"
countryCode: string
email: string;
username: string
timestamp: number; // unix timestamp
}
}
Error
Example
error
Response
If the login was successful, this variable is not returned. If the login failed, this variable returns an array of error messages.
{
error: ErrorResponse[];
}