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.

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)
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.

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

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

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.

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

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.

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

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.

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.

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

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.

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.

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

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

Declaration
NSCustomerCenterConfig[] GetAllCustomerCenterConfigs()
Returns
Type Description
NSCustomerCenterConfig[]
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
Type Description
NSCustomerCenterConfig
Examples
NSCustomerServiceAgent agent;
NSCustomerCenterConfig thing = agent.GetCustomerCenterConfig(123);

GetCustomerServiceStartup()

Gets the carrier with data that Service needs when starting up

Declaration
NSCustomerServiceStartup GetCustomerServiceStartup()
Returns
Type Description
NSCustomerServiceStartup
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
Type Description
NSMailboxEntity
Examples
NSCustomerServiceAgent agent;
NSMailboxEntity thing = agent.GetMailboxEntity(123);

GetMailboxes()

Gets all registered mailboxes in Service

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.

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.

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

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

Declaration
Bool HasChatNotify()
Returns
Type Description
Bool
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
Type Description
Void
Examples
NSCustomerServiceAgent agent;
agent.callMethod(arg1, arg2);

SaveAllCustomerCenterConfigs(NSCustomerCenterConfig[])

Saves an array of NSCustomerCenterConfig entities to the database

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

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

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

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

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

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

Declaration
Void UpdateFeatureToggles(CsFeatureToggle[] featureToggles)
Parameters
Type Name Description
featureToggles
Returns
Type Description
Void
Examples
NSCustomerServiceAgent agent;
agent.callMethod(arg1, arg2);
In This Article
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top