Show / Hide Table of Contents

Class NSCustomerServiceAgent

Agent used for Customer Service methods.

Syntax
Examples
NSCustomerServiceAgent agent;
agent.callMethod(arg1, arg2);

Constructors

NSCustomerServiceAgent()

Agent used for Customer Service methods.

Introduced or updated in version: 7.5

Declaration
NSCustomerServiceAgent
Examples
NSCustomerServiceAgent agent;
agent.callMethod(arg1, arg2);

Methods

AddMessageFromMailData(Integer,String)

Adds a message to an existing request in the sam way as importMail would do it from an email.

Introduced or updated in version: 8.5R08

Declaration
NSTicketInfo AddMessageFromMailData(Integer ticketId, String data)
Parameters
Type Name Description
Integer ticketId
String data

RFC822 formatted data.

Returns
Type Description
NSTicketInfo
Examples
NSCustomerServiceAgent agent;
Integer ticketId;
String data;
NSTicketInfo res = agent.AddMessageFromMailData(ticketId, data);

ChatSessionsForUser()

Gets all chat TOPICS which this user is a member of.

Introduced or updated in version: 8.2

Declaration
NSChatSession[] ChatSessionsForUser()
Returns
Type Description
NSChatSession[]

chat topics.

Remarks

Members means that you have at least one of: Can Respond, Notifications, Listen or Manager

Examples
NSCustomerServiceAgent agent;
NSChatSession[] res = agent.ChatSessionsForUser();

CheckIfCustomizedTemplates()

Checks whether the core HTML templates are customized

Introduced or updated in version: 8.5R08

Declaration
Bool CheckIfCustomizedTemplates()
Returns
Type Description
Bool
Examples
NSCustomerServiceAgent agent;
Bool res = agent.CheckIfCustomizedTemplates();

CheckSymmetricEncryption(String)

Checks that we are using the same encryption keys

Introduced or updated in version: 8.5R08

Declaration
String CheckSymmetricEncryption(String encryptedString)
Parameters
Type Name Description
String encryptedString
Returns
Type Description
String
Examples
NSCustomerServiceAgent agent;
String encryptedString;
String res = agent.CheckSymmetricEncryption(encryptedString);

CreateDefaultCustomerCenterConfig()

Sets default values into a new NSCustomerCenterConfig.

Introduced or updated in version: 8.5R08

Declaration
NSCustomerCenterConfig CreateDefaultCustomerCenterConfig()
Returns
Type Description
NSCustomerCenterConfig
Remarks

NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance

Examples
NSCustomerServiceAgent agent;
NSCustomerCenterConfig thing = agent.CreateDefaultCustomerCenterConfig();
thing = agent.SaveCustomerCenterConfig(thing);

CreateDefaultMailboxEntity()

Sets default values into a new NSMailboxEntity

Introduced or updated in version: 7.5

Declaration
NSMailboxEntity CreateDefaultMailboxEntity()
Returns
Type Description
NSMailboxEntity
Remarks

NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance

Examples
NSCustomerServiceAgent agent;
NSMailboxEntity thing = agent.CreateDefaultMailboxEntity();
thing = agent.SaveMailboxEntity(thing);

CreateDefaultSmsConfig()

Sets default values into a new NSSmsConfig.

Introduced or updated in version: 8.2

Declaration
NSSmsConfig CreateDefaultSmsConfig()
Returns
Type Description
NSSmsConfig
Remarks

NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance

Examples
NSCustomerServiceAgent agent;
NSSmsConfig thing = agent.CreateDefaultSmsConfig();
thing = agent.SaveSmsConfig(thing);

CreateSession(String)

Creates a login session for a CS user

Introduced or updated in version: 8.2

Declaration
NSCsSessionKey CreateSession(String remoteIp)
Parameters
Type Name Description
String remoteIp

The IP of the client creating the session.

Returns
Type Description
NSCsSessionKey
Examples
NSCustomerServiceAgent agent;
String remoteIp;
NSCsSessionKey res = agent.CreateSession(remoteIp);

CreateTicketFromMailData(Integer,String)

Creates a new ticket in the same way as importMail would import an email.

Introduced or updated in version: 8.5R08

Declaration
NSTicketInfo CreateTicketFromMailData(Integer mailboxId, String data)
Parameters
Type Name Description
Integer mailboxId
String data

RFC822 formatted data.

Returns
Type Description
NSTicketInfo
Examples
NSCustomerServiceAgent agent;
Integer mailboxId;
String data;
NSTicketInfo res = agent.CreateTicketFromMailData(mailboxId, data);

DeleteChatSessions(Integer[])

Deletes the specified chat sessions.

Introduced or updated in version: 8.2

Declaration
Void DeleteChatSessions(Integer[] ids)
Parameters
Type Name Description
Integer[] ids
Returns
Type Description
Void
Examples
NSCustomerServiceAgent agent;
Integer[] ids;
agent.DeleteChatSessions(ids);

DeleteCustomerCenterConfig(Integer)

Deletes the NSCustomerCenterConfig

Introduced or updated in version: 8.5R08

Declaration
DeleteCustomerCenterConfig(Integer customerCenterConfig)
Parameters
Type Name Description
Integer customerCenterConfig
Returns
Type Description
Void
Examples
NSCustomerServiceAgent agent;
agent.DeleteCustomerCenterConfig(123);

EventHandlerExists(Integer)

Checks if an event handler exists.

Introduced or updated in version: 8.2

Declaration
Bool EventHandlerExists(Integer eventHandlerType)
Parameters
Type Name Description
Integer eventHandlerType

See EventHandlerType.

Returns
Type Description
Bool
Examples
NSCustomerServiceAgent agent;
Integer eventHandlerType;
Bool res = agent.EventHandlerExists(eventHandlerType);

ExecuteEventHandlers(NSEventData)

Executes event handlers in CRMScript for a given event.

Introduced or updated in version: 8.5R08

Declaration
NSEventData ExecuteEventHandlers(NSEventData eventData)
Parameters
Type Name Description
NSEventData eventData
Returns
Type Description
NSEventData
Examples
NSCustomerServiceAgent agent;
NSEventData eventData;
NSEventData res = agent.ExecuteEventHandlers(eventData);

FindTicketsByTitleOrId(String,Integer)

Searches for tickets matching title or ID

Introduced or updated in version: 8.5R08

Declaration
NSTicketInfo[] FindTicketsByTitleOrId(String titleOrId, Integer maxRows)
Parameters
Type Name Description
String titleOrId
Integer maxRows
Returns
Type Description
NSTicketInfo[]
Examples
NSCustomerServiceAgent agent;
String titleOrId;
Integer maxRows;
NSTicketInfo[] res = agent.FindTicketsByTitleOrId(titleOrId, maxRows);

GetAllCustomerCenterConfigs()

Gets all rows from cust_config as an array of NSCustomerCenterConfig entities

Introduced or updated in version: 8.5R08

Declaration
NSCustomerCenterConfig[] GetAllCustomerCenterConfigs()
Returns
Type Description
NSCustomerCenterConfig[]
Examples
NSCustomerServiceAgent agent;
NSCustomerCenterConfig[] res = agent.GetAllCustomerCenterConfigs();

GetCustomerCenterConfig(Integer)

Gets an NSCustomerCenterConfig object.

Introduced or updated in version: 8.5R08

Declaration
NSCustomerCenterConfig GetCustomerCenterConfig(Integer customerCenterConfigId)
Parameters
Type Name Description
Integer customerCenterConfigId
Returns
Type Description
NSCustomerCenterConfig
Examples
NSCustomerServiceAgent agent;
NSCustomerCenterConfig thing = agent.GetCustomerCenterConfig(123);

GetCustomerServiceStartup()

Gets the carrier with data that Service needs when starting up

Introduced or updated in version: 8.5R08

Declaration
NSCustomerServiceStartup GetCustomerServiceStartup()
Returns
Type Description
NSCustomerServiceStartup
Examples
NSCustomerServiceAgent agent;
NSCustomerServiceStartup res = agent.GetCustomerServiceStartup();

GetMailboxEntity(Integer)

Gets an NSMailboxEntity object.

Introduced or updated in version: 7.5

Declaration
NSMailboxEntity GetMailboxEntity(Integer mailboxEntityId)
Parameters
Type Name Description
Integer mailboxEntityId
Returns
Type Description
NSMailboxEntity
Examples
NSCustomerServiceAgent agent;
NSMailboxEntity thing = agent.GetMailboxEntity(123);

GetMailboxes()

Gets all registered mailboxes in Service

Introduced or updated in version: 8.5R08

Declaration
NSMailbox[] GetMailboxes()
Returns
Type Description
NSMailbox[]
Examples
NSCustomerServiceAgent agent;
NSMailbox[] res = agent.GetMailboxes();

GetProgramUrl(String,Bool)

Converts a module name into a Service URL.

Introduced or updated in version: 8.5R08

Declaration
String GetProgramUrl(String programName, Bool external)
Parameters
Type Name Description
String programName
Bool external
Returns
Type Description
String
Examples
NSCustomerServiceAgent agent;
String programName;
Bool external;
String res = agent.GetProgramUrl(programName, external);

GetSmsConfig()

Gets the NSSmsConfig settings for Customer Service SMS providers.

Introduced or updated in version: 8.2

Declaration
NSSmsConfig GetSmsConfig()
Returns
Type Description
NSSmsConfig
Examples
NSCustomerServiceAgent agent;
NSSmsConfig res = agent.GetSmsConfig();

GetStatistics()

Gets the calculated results for the required statistics for the Service Status page

Introduced or updated in version: 7.5

Declaration
CRMScript.NetServer.NSStatisticsDataSet[] GetStatistics(Integer[] functions)
Parameters
Type Name Description
Integer functions

List of functions to calculate and return. See StatusScreenPanelType.

Returns
Type Description

Array of StatisticsDataSet.

Examples
NSCustomerServiceAgent agent;
Integer[] functions;
NSStatisticsDataSet[] res = agent.GetStatistics(functions);

HasChatNotify()

Checks if user has any chat notification

Introduced or updated in version: 8.2

Declaration
Bool HasChatNotify()
Returns
Type Description
Bool
Examples
NSCustomerServiceAgent agent;
Bool res = agent.HasChatNotify();

RemoveSession(Integer)

Removes a login session for a Service user

Introduced or updated in version: 8.2

Declaration
Void RemoveSession(Integer loginId)
Parameters
Type Name Description
Integer loginId
Returns
Type Description
Void

SaveAllCustomerCenterConfigs(NSCustomerCenterConfig[])

Saves an array of NSCustomerCenterConfig entities to the database

Introduced or updated in version: 8.5R08

Declaration
Void SaveAllCustomerCenterConfigs(NSCustomerCenterConfig[] custConfigs)
Parameters
Type Name Description
NSCustomerCenterConfig[] custConfigs
Returns
Type Description
Void
Examples
NSCustomerServiceAgent agent;
agent.SaveAllCustomerCenterConfigs(custConfigs);

SaveCustomerCenterConfig(NSCustomerCenterConfig)

Updates the existing NSCustomerCenterConfig or creates a new NSCustomerCenterConfig if the id parameter is 0

Introduced or updated in version: 8.5R08

Declaration
NSCustomerCenterConfig SaveCustomerCenterConfig(NSCustomerCenterConfig customerCenterConfig)
Parameters
Type Name Description
NSCustomerCenterConfig customerCenterConfig

The NSCustomerCenterConfig to save.

Returns
Type Description
NSCustomerCenterConfig
Examples
NSCustomerService  agent;
NSCustomerCenterConfig thing = agent.CreateDefaultCustomerCenterConfig();
thing = agent.SaveCustomerCenterConfig(thing);

SaveMailboxEntity(NSMailboxEntity)

Updates the existing NSMailboxEntity or creates a new NSMailboxEntity if the ID parameter is 0

Introduced or updated in version: 7.5

Declaration
NSMailboxEntity SaveMailboxEntity(NSMailboxEntity mailboxEntity)
Parameters
Type Name Description
NSMailboxEntity mailboxEntity

The NSMailboxEntity to save.

Returns
Type Description
NSMailboxEntity
Examples
NSCustomerService  agent;
NSMailboxEntity thing = agent.CreateDefaultMailboxEntity();
thing = agent.SaveMailboxEntity(thing);

SaveSmsConfig(NSSmsConfig)

Updates the existing NSSmsConfig or creates a new NSSmsConfig if the ID parameter is 0

Introduced or updated in version: 8.2

Declaration
NSSmsConfig SaveSmsConfig(NSSmsConfig smsConfig)
Parameters
Type Name Description
NSSmsConfig smsConfig
Returns
Type Description
NSSmsConfig
Examples
NSCustomerService  agent;
NSSmsConfig thing = agent.CreateDefaultSmsConfig();
thing = agent.SaveSmsConfig(thing);

SessionIsValid(String)

Checks if a Service session is valid

Introduced or updated in version: 8.2

Declaration
Bool SessionIsValid(String csSessionKey)
Parameters
Type Name Description
String csSessionKey
Returns
Type Description
Bool
Examples
NSCustomerServiceAgent agent;
String csSessionKey;
Bool res = agent.SessionIsValid(csSessionKey);

TestSmtpServer(String,String,Bool)

Tests an SMTP account, by sending an email to a special @superoffice.com account

Introduced or updated in version: 8.5R08

Declaration
NSSmtpTestResult TestSmtpServer(String smtpUri, String from, Bool useStoredPassword)
Parameters
Type Name Description
String smtpUri
String from
Bool useStoredPassword
Returns
Type Description
NSSmtpTestResult
Examples
NSCustomerServiceAgent agent;
String smtpUri;
String from;
Bool useStoredPassword;
NSSmtpTestResult res = agent.TestSmtpServer(smtpUri, from, useStoredPassword);

UpdateFeatureToggles(CsFeatureToggle[])

Updates the cached FeatureToggles for Service

Introduced or updated in version: 7.5

Declaration
Void UpdateFeatureToggles(CsFeatureToggle[] featureToggles)
Parameters
Type Name Description
featureToggles
Returns
Type Description
Void
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top