Skip to main content
Chat functions. Manage chat channels, sessions, and messages.

Constructors

NSChatAgent()

Chat functions. Manage chat channels, sessions, and messages.

Methods

AcceptChatSessionTransfer(Integer)

Accept the transfer: assign the session to the user. If the session is not being transferred, nothing happens.
Returns: CRMScript.NetServer.NSChatSessionEntity Example:

AddChatMessage(Integer,NSChatMessage)

Adds a new message to a chat session
Returns: CRMScript.NetServer.NSChatMessage Example:

AddChatTopicUserAgent(Integer,NSChatTopicAgent)

Adds a user to a chat topic
Returns: CRMScript.NetServer.NSChatTopicAgent Example:

ChatSessionsForUser()

Gets all chat sessions which this user is a member of.
Returns: CRMScript.NetServer.NSChatSessionEntity[]
Members means that you have at least one of: Can Respond, Notifications, Listen or Manager
Example:

ChatTopicsForUser()

Gets all chat topics which this user is a member of.nd, Notifications, Listen or Manager.
Returns: CRMScript.NetServer.NSChatTopicEntity[]
Members means that you have at least one of: Can Respond, Notifications, Listen or Manager
Example:

CreateChatSessionForTopic(Integer)

Creates a new session on a chat topic
Returns: CRMScript.NetServer.NSChatSessionEntity Example:

CreateDefaultChatSessionEntity()

Sets default values into a new NSChatSessionEntity.
Returns: CRMScript.NetServer.NSChatSessionEntity
NetServer calculates default values (for example Country) on the entity, which is required when creating/storing a new instance
Example:

CreateDefaultChatTopicAgent()

Sets default values into a new NSChatTopicAgent.
Returns: CRMScript.NetServer.NSChatTopicAgent
NetServer calculates default values (for example Country) on the entity, which is required when creating/storing a new instance
Example:

CreateDefaultChatTopicEntity()

Sets default values into a new NSChatTopicEntity.
Returns: CRMScript.NetServer.NSChatTopicEntity
NetServer calculates default values (for example Country) on the entity, which is required when creating/storing a new instance
Example:

DeleteChatSessionEntity(Integer)

Deletes the NSChatSessionEntity
Returns: CRMScript.Global.Void Example:

DeleteChatTopicEntity(Integer)

Deletes the NSChatTopicEntity
Returns: CRMScript.Global.Void Example:

DeleteChatTopicUserAgent(Integer,String)

Removes a user from a topic
Returns: CRMScript.Global.Void Example:

GetChatMessages(Integer,Integer)

Gets all or some of the messages in a chat session
Returns: CRMScript.NetServer.NSChatMessage[] Example:

GetChatPresence()

Gets the chat presence status for all chat users.
Returns: CRMScript.NetServer.NSChatPresence[] Example:

GetChatSessionEntity(Integer)

Gets an NSChatSessionEntity object.
Returns: CRMScript.NetServer.NSChatSessionEntity Example:

GetChatTopicEntity(Integer)

Gets an NSChatTopicEntity object.
Returns: CRMScript.NetServer.NSChatTopicEntity Example:

GetChatTopicUserAgent(Integer,String)

Gets a user assigned to a topic
Returns: CRMScript.NetServer.NSChatTopicAgent Example:

GetChatTopicUserAgentList(Integer)

Gets a list of users assigned to a chat topic.
Returns: CRMScript.NetServer.NSChatTopicAgent[] Example:

GetChatTranscript(Integer,Bool)

Gets the chat transcript, formatted as plain text or HTML.
Returns: CRMScript.Global.String - chat transcript, formatted as plain text or HTMl. Example:

GetUserAgentList(Bool,Bool)

Gets list of users that can be assigned to chat topics.
Returns: CRMScript.NetServer.NSMDOListItem[]
Users with Chat-CALs from the MDO list ‘chatuser’
Example:

IsWithinOpeningHours(Integer)

Checks if we are right now within the opening hours of the given topic. Will use timezones to calculate if configured.
Returns: CRMScript.Global.Bool Example:

PickUpChatSession(Integer)

Answer the session: assign the session to the user. The welcome message is sent to the customer.
Returns: CRMScript.NetServer.NSChatSessionEntity - Returns NULL if session was not in queue. Example:

PickUpFirstChatSession()

Answer the first available session from the queue: assign the session to the user. The welcome message is sent to the customer.
Returns: CRMScript.NetServer.NSChatSessionEntity Example:

RejectChatSessionTransfer(Integer)

Do not want. Deny the transfer to the user. If the session is not being transferred, nothing happens.
Returns: CRMScript.NetServer.NSChatSessionEntity Example:

ResetChatSession(Integer)

Resets chat session, puts it back on the queue for pickup.
Returns: CRMScript.NetServer.NSChatSessionEntity
Used by bots to hand off a session to human
Example:

SaveChatPresence(NSChatPresence[])

Saves the chat presence for specified users
Returns: CRMScript.Global.Void Example:

SaveChatSessionEntity(NSChatSessionEntity)

Updates the existing NSChatSessionEntity or creates a new NSChatSessionEntity if the id parameter is 0
Returns: CRMScript.NetServer.NSChatSessionEntity Example:

SaveChatTopicEntity(NSChatTopicEntity)

Updates the existing NSChatTopicEntity or creates a new NSChatTopicEntity if the id parameter is 0
Returns: CRMScript.NetServer.NSChatTopicEntity Example:

TransferChatSession(Integer,String)

Requests to send the session to another user. If the session does not belong to the user, nothing happens.
Returns: CRMScript.NetServer.NSChatSessionEntity Example:

UpdateChatTopicUserAgent(Integer,String,NSChatTopicAgent)

Updates a user’s role in a chat topic
Returns: CRMScript.NetServer.NSChatTopicAgent Example:

UpdateChatTopicUserAgent(Integer,NSChatTopicAgent[])

Updates users roles in a chat topic
Returns: CRMScript.NetServer.NSChatTopicAgent[] Example: