Skip to main content

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent”></a> Interface ICustomerServiceAgent

Namespace: SuperOffice.WebApi.Agents
Assembly: SuperOffice.WebApi.dll
Agent used for Customer Service methods

Implements

IAgentBase, IDisposable

Methods

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_AddMessageFromMailDataAsync_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> AddMessageFromMailDataAsync(int, string, RequestOptions)

This method will add a message to an existing request in the sam way as importMail would do it from an email. It accepts RFC822 formatted data

Parameters

ticketId int The id of the ticket to add a message data string RFC822 formatted data to import as a message requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<TicketInfo&gt; An object containing some meta data for the ticket

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_CheckIfCustomizedTemplatesAsync_SuperOffice_WebApi_RequestOptions_”></a> CheckIfCustomizedTemplatesAsync(RequestOptions)

Checks whether the core html templates are customized

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&gt; True if the templates are customized

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_CheckSymmetricEncryptionAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> CheckSymmetricEncryptionAsync(string, RequestOptions)

Do a test to check that we are using the same encryption keys

Parameters

encryptedString string An encrypted version of the string requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; Encrypted version of the string done by NetServer

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_CreateDefaultCustomerCenterConfigAsync_SuperOffice_WebApi_RequestOptions_”></a> CreateDefaultCustomerCenterConfigAsync(RequestOptions)

Set default values into a new CustomerCenterConfig. NetServer calculates default values on the entity, which is required when creating/storing a new instance

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CustomerCenterConfig&gt; A blank CustomerCenterConfig

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_CreateDefaultMailboxEntityAsync_SuperOffice_WebApi_RequestOptions_”></a> CreateDefaultMailboxEntityAsync(RequestOptions)

Set default values into a new MailboxEntity. NetServer calculates default values on the entity, which is required when creating/storing a new instance

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<MailboxEntity&gt; A blank MailboxEntity

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_CreateSessionAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> CreateSessionAsync(string, RequestOptions)

Creates a login session for a CS user

Parameters

remoteIp string The ip of the client creating the session requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CsSessionKey&gt; The session key information

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_CreateTicketFromMailDataAsync_System_Int32_System_String_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> CreateTicketFromMailDataAsync(int, string, int, RequestOptions)

This method create a new ticket in the same way as importMail would import an email. It accepts RFC822 formatted data

Parameters

mailboxId int The id of the Service mailbox data string RFC822 formatted data to import as a ticket personId int Optional. If greater than 0, the new ticket is attached to this person as the primary customer and the email’s From header is not used to resolve the customer; the supplied person must exist and not be retired or the call throws a validation error. If 0 (default), the customer is resolved from the email as before. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<TicketInfo&gt; An object containing some meta data for the created ticket

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_DeleteCustomerCenterConfigAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> DeleteCustomerCenterConfigAsync(int, RequestOptions)

Deletes the CustomerCenterConfig

Parameters

customerCenterConfigId int The identity of the CustomerCenterConfig requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_EventHandlerExistsAsync_SuperOffice_WebApi_Data_EventHandlerType_SuperOffice_WebApi_RequestOptions_”></a> EventHandlerExistsAsync(EventHandlerType, RequestOptions)

Check if an eventhandler exists for a given enum

Parameters

eventHandlerType EventHandlerType The EventHandlerType we are checking requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&gt; True if it exists

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_EventHandlersExistsAsync_SuperOffice_WebApi_Data_EventHandlerType___SuperOffice_WebApi_RequestOptions_”></a> EventHandlersExistsAsync(EventHandlerType[], RequestOptions)

Check if any given eventhandler exists

Parameters

eventHandlerTypes EventHandlerType[] The EventHandlerTypes we are checking requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<EventHandlerType[]&gt; The existing event handlers

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_ExecuteEventHandlersAsync_SuperOffice_WebApi_Data_EventData_SuperOffice_WebApi_RequestOptions_”></a> ExecuteEventHandlersAsync(EventData, RequestOptions)

This method will execute event handlers in CRMScript for a given event.

Parameters

eventData EventData The EventData instance sent to the event handler requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<EventData&gt; The EventData instance after event handler execution

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_FindTicketsByTitleOrIdAsync_System_String_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> FindTicketsByTitleOrIdAsync(string, int, RequestOptions)

This method wil search for tickets matching title or id

Parameters

titleOrId string The search string. If this is a number, it will also search for a matching ticket id maxRows int The maximum number of rows to be returned requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<TicketInfo[]&gt; An array of objects containing some meta data for matching tickets

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_GetAllCustomerCenterConfigsAsync_SuperOffice_WebApi_RequestOptions_”></a> GetAllCustomerCenterConfigsAsync(RequestOptions)

Get all rows from cust_config as an array of CustomerCenterConfig entities

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CustomerCenterConfig[]&gt; An array of CustomerCenterConfig entities

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_GetCustomerCenterConfigAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetCustomerCenterConfigAsync(int, RequestOptions)

Gets a specific CustomerCenterConfig object.

Parameters

customerCenterConfigId int The identifier of the CustomerCenterConfig object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CustomerCenterConfig&gt; CustomerCenterConfig

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_GetCustomerServiceStartupAsync_SuperOffice_WebApi_RequestOptions_”></a> GetCustomerServiceStartupAsync(RequestOptions)

Get the carrier with data that Service needs when starting up

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CustomerServiceStartup&gt; The carrier containing the startup data

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_GetCustomerServiceStartupByOwnerAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetCustomerServiceStartupByOwnerAsync(int, RequestOptions)

Get the carrier with data that Service needs when starting up for a specific user

Parameters

userId int The user for which we want to fetch the startup values for requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CustomerServiceStartup&gt; The carrier containing the startup data

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_GetFaqForCustomerAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetFaqForCustomerAsync(int, RequestOptions)

Get a FAQ entry, ment to be displayed for a customer. This can either be a link to the FAQ entry on Custom Center, or it can be the answer and question. This is dependent on Registry setting with reg_id=157

Parameters

faqEntryId int The id of the FAQ entry to get. Only FAQ entries with access level public (both for unauthenticated and autenticated customer) will be returned requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; The FAQ to show to the customer. Either a clickable link or the question/answer itself.

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_GetMailboxEntityAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetMailboxEntityAsync(int, RequestOptions)

Gets a specific MailboxEntity object.

Parameters

mailboxEntityId int The identifier of the MailboxEntity object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<MailboxEntity&gt; MailboxEntity

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_GetMailboxesAsync_SuperOffice_WebApi_RequestOptions_”></a> GetMailboxesAsync(RequestOptions)

This method will get all registered mailboxes in Service

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Mailbox[]&gt; An array of Mailbox objects

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_GetParsedTemplateAsync_System_Int32_System_Int32_System_Int32_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetParsedTemplateAsync(int, int, int, int, RequestOptions)

Get a specific langauge version of the reply template, and run this trough the parser

Parameters

replyTemplateId int The id of the reply template languageId int The language id (prefered language). If 0 is given, the language of the person will be used personId int The id of the person that will be populated into the parser ticketId int The id of the ticket that will be populated into the parser requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ReplyTemplateParsed&gt; The parsed reply template

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_GetPreviewFaqEntryAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetPreviewFaqEntryAsync(int, RequestOptions)

Get a faq entry from its faq entry id

Parameters

kbEntryId int FAQ entry ID requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<PreviewFaqEntry&gt; FAQ entry suitable for preview

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_GetPreviewQuickReplyAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetPreviewQuickReplyAsync(int, RequestOptions)

Get a quick reply from its quick reply id

Parameters

quickReplyId int Quick reply ID requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<PreviewQuickReply&gt; Quick reply suitable for preview

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_GetPreviewReplyTemplateAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetPreviewReplyTemplateAsync(int, RequestOptions)

Get a reply template from its reply template id

Parameters

replyTemplateId int Reply template ID requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<PreviewReplyTemplate&gt; Reply template suitable for preview

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_GetProgramUrlAsync_System_String_System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> GetProgramUrlAsync(string, bool, RequestOptions)

This method will convert a module name into a Service URL.

Parameters

programName string In this parameter you must specify which CS program you want to create an URL for. Valid examples are “ticket”, “rms”, “spm” etc. external bool If set to true, this will generate URLs that are accesible from the outside (for example Internet) requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; Returns a valid Service URL composed of the give parameters.

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_GetSmsConfigAsync_SuperOffice_WebApi_RequestOptions_”></a> GetSmsConfigAsync(RequestOptions)

Get the SmsConfig settings for Customer Service sms providers.

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<SmsConfig&gt; Current SMS configuration.

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_GetStatisticsAsync_SuperOffice_WebApi_Data_StatusScreenPanelType___SuperOffice_WebApi_RequestOptions_”></a> GetStatisticsAsync(StatusScreenPanelType[], RequestOptions)

Returns the calculated results for the required statistics for the Customer Service Status Page

Parameters

functions StatusScreenPanelType[] List of functions to calculate and return requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<StatisticsDataSet[]&gt; Array of StatisticsDataSet

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_GetSystemTemplateSettingsAsync_SuperOffice_WebApi_RequestOptions_”></a> GetSystemTemplateSettingsAsync(RequestOptions)

Returns system template settings

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<SystemTemplateSettings&gt; System template settings item

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_GetUnparsedTemplateAsync_System_Int32_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetUnparsedTemplateAsync(int, int, RequestOptions)

Get a specific langauge version of the reply template. No parsing is performed.

Parameters

replyTemplateId int The id of the reply template languageId int The language id (prefered language). If 0 is given, the language of the person will be used requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ReplyTemplateParsed&gt; The unparsed reply template, but using the same return data structure

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_HasChatNotifyAsync_SuperOffice_WebApi_RequestOptions_”></a> HasChatNotifyAsync(RequestOptions)

Check if user has any chat notification

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&gt; True if the user has at least one notification setting on

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_RemoveSessionAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> RemoveSessionAsync(int, RequestOptions)

Remove a login session for a CS user

Parameters

loginId int The login id to remove requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_ReportSessionActiveAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> ReportSessionActiveAsync(string, RequestOptions)

Report a session as being ‘active’; will update the corresponding row in login table, but not more than once per minute/session

Parameters

sessionKey string CS session key, matching the ‘login’ table requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<int&gt; The ID of the login table row, or 0 if not found

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_SaveAllCustomerCenterConfigsAsync_SuperOffice_WebApi_Data_CustomerCenterConfig___SuperOffice_WebApi_RequestOptions_”></a> SaveAllCustomerCenterConfigsAsync(CustomerCenterConfig[], RequestOptions)

Save an array of CustomerCenterConfig entities to the database

Parameters

custConfigs CustomerCenterConfig[] The CustomerCenterConfig entities to be saved. If the id does not exists, a new one will be created. Unknown ids will be skipped requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task void

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_SaveCustomerCenterConfigAsync_SuperOffice_WebApi_Data_CustomerCenterConfig_SuperOffice_WebApi_RequestOptions_”></a> SaveCustomerCenterConfigAsync(CustomerCenterConfig, RequestOptions)

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

Parameters

customerCenterConfig CustomerCenterConfig The CustomerCenterConfig that is saved. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CustomerCenterConfig&gt; New or updated CustomerCenterConfig

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_SaveMailboxEntityAsync_SuperOffice_WebApi_Data_MailboxEntity_SuperOffice_WebApi_RequestOptions_”></a> SaveMailboxEntityAsync(MailboxEntity, RequestOptions)

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

Parameters

mailboxEntity MailboxEntity The MailboxEntity that is saved. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<MailboxEntity&gt; New or updated MailboxEntity

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_SaveSystemTemplateSettingsAsync_SuperOffice_WebApi_Data_SystemTemplateSettings_SuperOffice_WebApi_RequestOptions_”></a> SaveSystemTemplateSettingsAsync(SystemTemplateSettings, RequestOptions)

Saves and validates updated system templates. Throws exception if validation fails

Parameters

systemTemplateSettings SystemTemplateSettings System template settings item with updated values requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<SystemTemplateSettings&gt; Updated system template settings

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_SessionIsValidAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> SessionIsValidAsync(string, RequestOptions)

Check if a CS session is valid

Parameters

csSessionKey string The CS session key to check requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&gt; True if there is a valid CS session based on the session key

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_TestSmtpServerAsync_System_String_System_String_System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> TestSmtpServerAsync(string, string, bool, RequestOptions)

This method will do a test of a SMTP account, by sending an email to a special @superoffice.com account

Parameters

smtpUri string An URI containing information to connect to the SMTP server, eg. smtps://myuser:mypassword@smtp.myserver.com:465. Note that username and password must be url encoded from string The from-address used in the test useStoredPassword bool Use database persisted password requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<SmtpTestResult&gt; Contains the result of the test

<a id=“SuperOffice_WebApi_Agents_ICustomerServiceAgent_UpdateFeatureTogglesAsync_SuperOffice_WebApi_Data_CsFeatureToggle___SuperOffice_WebApi_RequestOptions_”></a> UpdateFeatureTogglesAsync(CsFeatureToggle[], RequestOptions)

Update the cached FeatureToggles for CS

Parameters

featureToggles CsFeatureToggle[] Feature toggle name / state requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task