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