Class NSCustomerServiceAgent
Agent used for Customer Service methods.
Syntax
Examples
NSCustomerServiceAgent agent;
agent.callMethod(arg1, arg2);
Constructors
NSCustomerServiceAgent()
Agent used for Customer Service methods.
Declaration
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.
Declaration
NSTicketInfo AddMessageFromMailData(Integer ticketId, String data)
Parameters
Type |
Name |
Description |
Integer |
ticketId |
|
String |
data |
RFC822 formatted data.
|
Returns
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.
Declaration
NSChatSession[] ChatSessionsForUser()
Returns
Examples
NSCustomerServiceAgent agent;
NSChatSession[] res = agent.ChatSessionsForUser();
CheckIfCustomizedTemplates()
Checks whether the core HTML templates are customized
Declaration
Bool CheckIfCustomizedTemplates()
Returns
Examples
NSCustomerServiceAgent agent;
Bool res = agent.CheckIfCustomizedTemplates();
CheckSymmetricEncryption(String)
Checks that we are using the same encryption keys
Declaration
String CheckSymmetricEncryption(String encryptedString)
Parameters
Type |
Name |
Description |
String |
encryptedString |
|
Returns
Examples
NSCustomerServiceAgent agent;
String encryptedString;
String res = agent.CheckSymmetricEncryption(encryptedString);
CreateDefaultCustomerCenterConfig()
Sets default values into a new NSCustomerCenterConfig.
Declaration
NSCustomerCenterConfig CreateDefaultCustomerCenterConfig()
Returns
Examples
NSCustomerServiceAgent agent;
NSCustomerCenterConfig thing = agent.CreateDefaultCustomerCenterConfig();
thing = agent.SaveCustomerCenterConfig(thing);
CreateDefaultMailboxEntity()
Sets default values into a new NSMailboxEntity
Declaration
NSMailboxEntity CreateDefaultMailboxEntity()
Returns
Examples
NSCustomerServiceAgent agent;
NSMailboxEntity thing = agent.CreateDefaultMailboxEntity();
thing = agent.SaveMailboxEntity(thing);
CreateDefaultSmsConfig()
Sets default values into a new NSSmsConfig.
Declaration
NSSmsConfig CreateDefaultSmsConfig()
Returns
Examples
NSCustomerServiceAgent agent;
NSSmsConfig thing = agent.CreateDefaultSmsConfig();
thing = agent.SaveSmsConfig(thing);
CreateSession(String)
Creates a login session for a CS user
Declaration
NSCsSessionKey CreateSession(String remoteIp)
Parameters
Type |
Name |
Description |
String |
remoteIp |
The IP of the client creating the session.
|
Returns
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.
Declaration
NSTicketInfo CreateTicketFromMailData(Integer mailboxId, String data)
Parameters
Type |
Name |
Description |
Integer |
mailboxId |
|
String |
data |
RFC822 formatted data.
|
Returns
Examples
NSCustomerServiceAgent agent;
Integer mailboxId;
String data;
NSTicketInfo res = agent.CreateTicketFromMailData(mailboxId, data);
DeleteChatSessions(Integer[])
Deletes the specified chat sessions.
Declaration
Void DeleteChatSessions(Integer[] ids)
Parameters
Type |
Name |
Description |
Integer[] |
ids |
|
Returns
Examples
NSCustomerServiceAgent agent;
Integer[] ids;
agent.DeleteChatSessions(ids);
DeleteCustomerCenterConfig(Integer)
Deletes the NSCustomerCenterConfig
Declaration
DeleteCustomerCenterConfig(Integer customerCenterConfig)
Parameters
Type |
Name |
Description |
Integer |
customerCenterConfig |
|
Returns
Examples
NSCustomerServiceAgent agent;
agent.DeleteCustomerCenterConfig(123);
EventHandlerExists(Integer)
Checks if an event handler exists.
Declaration
Bool EventHandlerExists(Integer eventHandlerType)
Parameters
Returns
Examples
NSCustomerServiceAgent agent;
Integer eventHandlerType;
Bool res = agent.EventHandlerExists(eventHandlerType);
ExecuteEventHandlers(NSEventData)
Executes event handlers in CRMScript for a given event.
Declaration
NSEventData ExecuteEventHandlers(NSEventData eventData)
Parameters
Returns
Examples
NSCustomerServiceAgent agent;
NSEventData eventData;
NSEventData res = agent.ExecuteEventHandlers(eventData);
FindTicketsByTitleOrId(String,Integer)
Searches for tickets matching title or ID
Declaration
NSTicketInfo[] FindTicketsByTitleOrId(String titleOrId, Integer maxRows)
Parameters
Returns
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
Declaration
NSCustomerCenterConfig[] GetAllCustomerCenterConfigs()
Returns
Examples
NSCustomerServiceAgent agent;
NSCustomerCenterConfig[] res = agent.GetAllCustomerCenterConfigs();
GetCustomerCenterConfig(Integer)
Gets an NSCustomerCenterConfig object.
Declaration
NSCustomerCenterConfig GetCustomerCenterConfig(Integer customerCenterConfigId)
Parameters
Type |
Name |
Description |
Integer |
customerCenterConfigId |
|
Returns
Examples
NSCustomerServiceAgent agent;
NSCustomerCenterConfig thing = agent.GetCustomerCenterConfig(123);
GetCustomerServiceStartup()
Gets the carrier with data that Service needs when starting up
Declaration
NSCustomerServiceStartup GetCustomerServiceStartup()
Returns
Examples
NSCustomerServiceAgent agent;
NSCustomerServiceStartup res = agent.GetCustomerServiceStartup();
GetMailboxEntity(Integer)
Gets an NSMailboxEntity object.
Declaration
NSMailboxEntity GetMailboxEntity(Integer mailboxEntityId)
Parameters
Type |
Name |
Description |
Integer |
mailboxEntityId |
|
Returns
Examples
NSCustomerServiceAgent agent;
NSMailboxEntity thing = agent.GetMailboxEntity(123);
GetMailboxes()
Gets all registered mailboxes in Service
Declaration
NSMailbox[] GetMailboxes()
Returns
Examples
NSCustomerServiceAgent agent;
NSMailbox[] res = agent.GetMailboxes();
GetProgramUrl(String,Bool)
Converts a module name into a Service URL.
Declaration
String GetProgramUrl(String programName, Bool external)
Parameters
Type |
Name |
Description |
String |
programName |
|
Bool |
external |
|
Returns
Examples
NSCustomerServiceAgent agent;
String programName;
Bool external;
String res = agent.GetProgramUrl(programName, external);
GetSmsConfig()
Gets the NSSmsConfig settings for Customer Service SMS providers.
Declaration
NSSmsConfig GetSmsConfig()
Returns
Examples
NSCustomerServiceAgent agent;
NSSmsConfig res = agent.GetSmsConfig();
GetStatistics()
Gets the calculated results for the required statistics for the Service Status page
Declaration
CRMScript.NetServer.NSStatisticsDataSet[] GetStatistics(Integer[] functions)
Parameters
Returns
Type |
Description |
|
Array of StatisticsDataSet.
|
Examples
NSCustomerServiceAgent agent;
Integer[] functions;
NSStatisticsDataSet[] res = agent.GetStatistics(functions);
HasChatNotify()
Checks if user has any chat notification
Declaration
Returns
Examples
NSCustomerServiceAgent agent;
Bool res = agent.HasChatNotify();
RemoveSession(Integer)
Removes a login session for a Service user
Declaration
Void RemoveSession(Integer loginId)
Parameters
Type |
Name |
Description |
Integer |
loginId |
|
Returns
Examples
NSCustomerServiceAgent agent;
agent.callMethod(arg1, arg2);
SaveAllCustomerCenterConfigs(NSCustomerCenterConfig[])
Saves an array of NSCustomerCenterConfig entities to the database
Declaration
Void SaveAllCustomerCenterConfigs(NSCustomerCenterConfig[] custConfigs)
Parameters
Returns
Examples
NSCustomerServiceAgent agent;
agent.SaveAllCustomerCenterConfigs(custConfigs);
SaveCustomerCenterConfig(NSCustomerCenterConfig)
Updates the existing NSCustomerCenterConfig or creates a new NSCustomerCenterConfig if the id parameter is 0
Declaration
NSCustomerCenterConfig SaveCustomerCenterConfig(NSCustomerCenterConfig customerCenterConfig)
Parameters
Returns
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
Declaration
NSMailboxEntity SaveMailboxEntity(NSMailboxEntity mailboxEntity)
Parameters
Type |
Name |
Description |
NSMailboxEntity |
mailboxEntity |
The NSMailboxEntity to save.
|
Returns
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
Declaration
NSSmsConfig SaveSmsConfig(NSSmsConfig smsConfig)
Parameters
Returns
Examples
NSCustomerService agent;
NSSmsConfig thing = agent.CreateDefaultSmsConfig();
thing = agent.SaveSmsConfig(thing);
SessionIsValid(String)
Checks if a Service session is valid
Declaration
Bool SessionIsValid(String csSessionKey)
Parameters
Type |
Name |
Description |
String |
csSessionKey |
|
Returns
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
Declaration
NSSmtpTestResult TestSmtpServer(String smtpUri, String from, Bool useStoredPassword)
Parameters
Returns
Examples
NSCustomerServiceAgent agent;
String smtpUri;
String from;
Bool useStoredPassword;
NSSmtpTestResult res = agent.TestSmtpServer(smtpUri, from, useStoredPassword);
UpdateFeatureToggles(CsFeatureToggle[])
Updates the cached FeatureToggles for Service
Declaration
Void UpdateFeatureToggles(CsFeatureToggle[] featureToggles)
Parameters
Type |
Name |
Description |
|
featureToggles |
|
Returns
Examples
NSCustomerServiceAgent agent;
agent.callMethod(arg1, arg2);