Interface IChatAgent
Namespace: SuperOffice.WebApi.AgentsAssembly: SuperOffice.WebApi.dll Chat functions. Manage chat channels, sessions and messages.
Implements
IAgentBase, IDisposableMethods
AcceptChatSessionTransferAsync(int, RequestOptions)
Accept the transfer: assign the session to the user. If the session is not being transferred, nothing happens.Parameters
chatSessionId int
id of the chat session to send
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatSessionEntity> The updated chat sessionAddChatMessageAsync(int, ChatMessage, RequestOptions)
Add a new message to a chat sessionParameters
chatSessionId int
id of the chat session to add message to
message ChatMessage
Message to add
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatMessage> The chat message added to the sessionAddChatTopicUserAgentAsync(int, ChatTopicAgent, RequestOptions)
Add a user to a chat topicParameters
chatTopicId int
Id of the chat topic
useragent ChatTopicAgent
User’s role within the chat topic to add to topic.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatTopicAgent> The user’s role within the chat topic.ChatSessionsForUserAsync(RequestOptions)
Get all chat sessions which this user is a member of. Members means that you have at least one of: Can Respond, Notifications, Listen or ManagerParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatSessionEntity[]> Array of chat sessions the current user can accessChatTopicsForUserAsync(RequestOptions)
Get all chat topics which this user is a member of. Members means that you have at least one of: Can Respond, Notifications, Listen or ManagerParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatTopicEntity[]> Array of chat topics the current user can accessCreateChatSessionForTopicAsync(int, RequestOptions)
Create a new session on a chat topicParameters
chatTopicId int
Id of the chat topic
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatSessionEntity> The new chat session.CreateDefaultChatSessionEntityAsync(RequestOptions)
Set default values into a new ChatSessionEntity. NetServer calculates default values on the entity, which is required when creating/storing a new instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatSessionEntity> A blank ChatSessionEntityCreateDefaultChatTopicAgentAsync(RequestOptions)
Set default values into a new ChatTopicAgent. NetServer calculates default values on the entity, which is required when creating/storing a new instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatTopicAgent> A blank ChatTopicAgentCreateDefaultChatTopicEntityAsync(RequestOptions)
Set default values into a new ChatTopicEntity. NetServer calculates default values on the entity, which is required when creating/storing a new instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatTopicEntity> A blank ChatTopicEntityDeleteChatSessionEntityAsync(int, RequestOptions)
Deletes the ChatSessionEntityParameters
chatSessionEntityId int
The identity of the ChatSessionEntity
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
TaskDeleteChatTopicEntityAsync(int, RequestOptions)
Deletes the ChatTopicEntityParameters
chatTopicEntityId int
The identity of the ChatTopicEntity
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
TaskDeleteChatTopicUserAgentAsync(int, string, RequestOptions)
Remove a user from a topicParameters
chatTopicId int
Id of the chat topic
username string
Associate username or associate id to delete.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task This method has no return valueGetChatMessagesAsync(int, int, RequestOptions)
Get all or some of the messages in a chat sessionParameters
chatSessionId int
id of the chat session to reset
after int
Return messages after this message id
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatMessage[]> Array of chat messages in the sessionGetChatPresenceAsync(RequestOptions)
Get the chat presence status for all chat usersParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatPresence[]> An array with ChatPresence objects for each userGetChatSessionEntityAsync(int, RequestOptions)
Gets a specific ChatSessionEntity object.Parameters
chatSessionEntityId int
The identifier of the ChatSessionEntity object
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatSessionEntity> ChatSessionEntityGetChatTopicEntityAsync(int, RequestOptions)
Gets a specific ChatTopicEntity object.Parameters
chatTopicEntityId int
The identifier of the ChatTopicEntity object
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatTopicEntity> ChatTopicEntityGetChatTopicUserAgentAsync(int, string, RequestOptions)
Get a user assigned to a topicParameters
chatTopicId int
Id of the chat topic
username string
Associate username or associate id to get.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatTopicAgent> The user’s role within the chat topic.GetChatTopicUserAgentListAsync(int, RequestOptions)
Get list of users assigned to a chat topicParameters
chatTopicId int
Id of the chat topic
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatTopicAgent[]> List of user agents assigned to chat topic.GetChatTranscriptAsync(int, bool, RequestOptions)
Get the chat transcript, formatted as plain text or htmlParameters
chatSessionId int
id of the chat session to get the transcript for
html bool
Get transcript as HTML
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<string> The transcript in text or HTMLGetUserAgentListAsync(bool, bool, RequestOptions)
Get list of users that can be assigned to chat topics. Users with Chat-CALs from the MDO list ‘chatuser’Parameters
flat bool
Return flat list instead of grouping by usergroup.
onlyPresent bool
Only show users who are present
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<MDOListItem[]> List of user agents that can be assigned to chat topics, possibly grouped by usergroup.IsWithinOpeningHoursAsync(int, RequestOptions)
Check if we are right now within the opening hours of the given topic. Will use timezones to calculate if configured.Parameters
chatTopicId int
The id of the topic to check
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<bool> True if we are within opening hours, or if the topic does not use opening hoursPickUpChatSessionAsync(int, RequestOptions)
‘answer’ the session: assign the session to the user. The welcome message is sent to the customer. Returns NULL if session was not in queue.Parameters
chatSessionId int
id of the chat session to answer
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatSessionEntity> The chat sessionPickUpFirstChatSessionAsync(RequestOptions)
‘answer’ the first available session from the queue: assign the session to the user. The welcome message is sent to the customer.Parameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatSessionEntity> The picked-up chat sessionRejectChatSessionTransferAsync(int, RequestOptions)
Do not want. Deny the transfer to the user. If the session is not being transferred, nothing happens.Parameters
chatSessionId int
id of the chat session to send back
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatSessionEntity> The updated chat sessionResetChatSessionAsync(int, RequestOptions)
Reset chat session, put it back on the queue for pickup. Used by bots to hand off a session to humanParameters
chatSessionId int
id of the chat session to reset
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatSessionEntity> The updated chat sessionSaveChatPresenceAsync(ChatPresence[], RequestOptions)
Save the chat presence for specified usersParameters
chatPresence ChatPresence[]
An array with ChatPresence objects. Only the UserId and Present information is used while saving
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task voidSaveChatSessionEntityAsync(ChatSessionEntity, RequestOptions)
Updates the existing ChatSessionEntity or creates a new ChatSessionEntity if the id parameter is 0.Parameters
chatSessionEntity ChatSessionEntity
The ChatSessionEntity that is saved.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatSessionEntity> New or updated ChatSessionEntitySaveChatTopicEntityAsync(ChatTopicEntity, RequestOptions)
Updates the existing ChatTopicEntity or creates a new ChatTopicEntity if the id parameter is 0.Parameters
chatTopicEntity ChatTopicEntity
The ChatTopicEntity that is saved.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatTopicEntity> New or updated ChatTopicEntityTransferChatSessionAsync(int, string, RequestOptions)
Request to send the session to another user. If the session does not belong to the user, nothing happens.Parameters
chatSessionId int
id of the chat session to send
toAssociate string
Associate username or associate id to send session to.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatSessionEntity> The updated chat sessionUpdateChatTopicUserAgentAsync(int, string, ChatTopicAgent, RequestOptions)
Update a user’s role in a chat topicParameters
chatTopicId int
Id of the chat topic
username string
Associate username or associate id to get.
useragent ChatTopicAgent
User’s updated role within the chat topic.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<ChatTopicAgent> The user’s role within the chat topic.UpdateChatTopicUserAgentsAsync(int, ChatTopicAgent[], RequestOptions)
Update users roles in a chat topicParameters
chatTopicId int
Id of the chat topic
useragents ChatTopicAgent[]
Users new/updated roles within the chat topic. Replaces existing roles
requestOptions RequestOptions
Override language/culture codes on this request.