# new BrandWebsocketConnection()
Methods
# async _getMessageStatistics()
Getting message statistics about current account Provided getForUserId equal to true will take into the account that user is agent Not providing params means that the account owner is manager he will see all the msg statistics
# async _getWebsocketUrl()
Gets the websocket URL
# protected _onAuthInvalidError()
Forces a reauth in TokenMaintainer when ._connect() is called again
# async _subscribeRoutingTasks(accountId, agentId)
Makes the websocket call to Agent Matching to subscribe for rings.
Parameters:
Name | Type | Description |
---|---|---|
accountId |
||
agentId |
# async _updateRingState(ringId, ringState)
Updates the state of a ring. If state is accepted, the agent will be assigned to the conversation.
Parameters:
Name | Type | Description |
---|---|---|
ringId |
||
ringState |
# async getToken() → {Promise.<string>}
Returns the token from this connection. Throws an error if ConnectionState is not connected
token maintainer not started
Agent bearer token
# async setAgentState(agentId, agentState)
Changes the availability of an agent
Parameters:
Name | Type | Description |
---|---|---|
agentId |
string | {accountId.userId}. Defaults to the agentId for the current connection |
agentState |
string | represents availability states of the agent: ONLINE, OFFLINE, AWAY, BACK_SOON |
void