<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent”></a> Class CustomerServiceAgent
Namespace: SuperOffice.WebApi.AgentsAssembly: SuperOffice.WebApi.dll Agent used for Customer Service methods
Inheritance
object ← AgentBase ← CustomerServiceAgentImplements
ICustomerServiceAgent, IAgentBase, IDisposableInherited Members
AgentBase._json, AgentBase._binary, AgentBase._config, AgentBase._client, AgentBase._disposeClient, AgentBase.Merge(RequestOptions), AgentBase.BuildRequestFromObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.BuildRequestFromStream(HttpMethod, string, Stream, WebApiOptions, string), AgentBase.BuildRequestFromObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.ParseAuthorization(IAuthorization), AgentBase.CancelRequest(), AgentBase.SendRequestObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.SendRequestObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.SendRequest(HttpRequestMessage, RequestOptions), AgentBase.ThrowOnResponseErrorAsync(HttpRequestMessage, HttpResponseMessage), AgentBase.ParseResponse<T>(HttpResponseMessage), AgentBase.Finally(RequestOptions), AgentBase.Dispose(), AgentBase.Configuration, AgentBase.Client, AgentBase.HasRunningRequest, AgentBase.ClientCancellationTokenSource, AgentBase.ProgressListener, AgentBase.UploadProgressListener, object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()Examples
<pre><code class=“lang-csharp”>using SuperOffice.WebApi; using SuperOffice.WebApi.Agents; var mySession = new WebApiOptions(“http://example.com/super/api”); mySession.Authorization = new AuthorizationUsernamePassword(“user”, “pass”); using (CustomerServiceAgent agent = new CustomerServiceAgent(mySession)) { // call methods on agent here… }</code></pre>Constructors
<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent__ctor_System_Net_Http_HttpClient_”></a> CustomerServiceAgent(HttpClient)
Constructor: Agent used for Customer Service methodsParameters
httpClient HttpClient
Use this HTTP client instead of making own HttpClient instance.
<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent__ctor_SuperOffice_WebApi_WebApiOptions_System_Net_Http_HttpClient_”></a> CustomerServiceAgent(WebApiOptions, HttpClient)
Constructor: Agent used for Customer Service methodsParameters
options WebApiOptions
Base URL and authentication values.
httpClient HttpClient
Optional: Use this HTTP client instead of making a new one.
Methods
<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_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 dataParameters
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> An object containing some meta data for the ticket<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_CheckIfCustomizedTemplatesAsync_SuperOffice_WebApi_RequestOptions_”></a> CheckIfCustomizedTemplatesAsync(RequestOptions)
Checks whether the core html templates are customizedParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<bool> True if the templates are customized<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_CheckSymmetricEncryptionAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> CheckSymmetricEncryptionAsync(string, RequestOptions)
Do a test to check that we are using the same encryption keysParameters
encryptedString string
An encrypted version of the string
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<string> Encrypted version of the string done by NetServer<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_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 instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<CustomerCenterConfig> A blank CustomerCenterConfig<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_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 instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<MailboxEntity> A blank MailboxEntity<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_CreateSessionAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> CreateSessionAsync(string, RequestOptions)
Creates a login session for a CS userParameters
remoteIp string
The ip of the client creating the session
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<CsSessionKey> The session key information<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_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 dataParameters
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> An object containing some meta data for the created ticket<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_DeleteCustomerCenterConfigAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> DeleteCustomerCenterConfigAsync(int, RequestOptions)
Deletes the CustomerCenterConfigParameters
customerCenterConfigId int
The identity of the CustomerCenterConfig
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_EventHandlerExistsAsync_SuperOffice_WebApi_Data_EventHandlerType_SuperOffice_WebApi_RequestOptions_”></a> EventHandlerExistsAsync(EventHandlerType, RequestOptions)
Check if an eventhandler exists for a given enumParameters
eventHandlerType EventHandlerType
The EventHandlerType we are checking
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<bool> True if it exists<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_EventHandlersExistsAsync_SuperOffice_WebApi_Data_EventHandlerType___SuperOffice_WebApi_RequestOptions_”></a> EventHandlersExistsAsync(EventHandlerType[], RequestOptions)
Check if any given eventhandler existsParameters
eventHandlerTypes EventHandlerType[]
The EventHandlerTypes we are checking
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<EventHandlerType[]> The existing event handlers<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_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> The EventData instance after event handler execution<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_FindTicketsByTitleOrIdAsync_System_String_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> FindTicketsByTitleOrIdAsync(string, int, RequestOptions)
This method wil search for tickets matching title or idParameters
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[]> An array of objects containing some meta data for matching tickets<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_GetAllCustomerCenterConfigsAsync_SuperOffice_WebApi_RequestOptions_”></a> GetAllCustomerCenterConfigsAsync(RequestOptions)
Get all rows from cust_config as an array of CustomerCenterConfig entitiesParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<CustomerCenterConfig[]> An array of CustomerCenterConfig entities<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_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> CustomerCenterConfig<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_GetCustomerServiceStartupAsync_SuperOffice_WebApi_RequestOptions_”></a> GetCustomerServiceStartupAsync(RequestOptions)
Get the carrier with data that Service needs when starting upParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<CustomerServiceStartup> The carrier containing the startup data<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_GetCustomerServiceStartupByOwnerAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetCustomerServiceStartupByOwnerAsync(int, RequestOptions)
Get the carrier with data that Service needs when starting up for a specific userParameters
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> The carrier containing the startup data<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_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=157Parameters
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> The FAQ to show to the customer. Either a clickable link or the question/answer itself.<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_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> MailboxEntity<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_GetMailboxesAsync_SuperOffice_WebApi_RequestOptions_”></a> GetMailboxesAsync(RequestOptions)
This method will get all registered mailboxes in ServiceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<Mailbox[]> An array of Mailbox objects<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_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 parserParameters
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> The parsed reply template<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_GetPreviewFaqEntryAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetPreviewFaqEntryAsync(int, RequestOptions)
Get a faq entry from its faq entry idParameters
kbEntryId int
FAQ entry ID
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<PreviewFaqEntry> FAQ entry suitable for preview<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_GetPreviewQuickReplyAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetPreviewQuickReplyAsync(int, RequestOptions)
Get a quick reply from its quick reply idParameters
quickReplyId int
Quick reply ID
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<PreviewQuickReply> Quick reply suitable for preview<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_GetPreviewReplyTemplateAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetPreviewReplyTemplateAsync(int, RequestOptions)
Get a reply template from its reply template idParameters
replyTemplateId int
Reply template ID
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<PreviewReplyTemplate> Reply template suitable for preview<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_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> Returns a valid Service URL composed of the give parameters.<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_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> Current SMS configuration.<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_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 PageParameters
functions StatusScreenPanelType[]
List of functions to calculate and return
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<StatisticsDataSet[]> Array of StatisticsDataSet<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_GetSystemTemplateSettingsAsync_SuperOffice_WebApi_RequestOptions_”></a> GetSystemTemplateSettingsAsync(RequestOptions)
Returns system template settingsParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<SystemTemplateSettings> System template settings item<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_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> The unparsed reply template, but using the same return data structure<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_HasChatNotifyAsync_SuperOffice_WebApi_RequestOptions_”></a> HasChatNotifyAsync(RequestOptions)
Check if user has any chat notificationParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<bool> True if the user has at least one notification setting on<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_RemoveSessionAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> RemoveSessionAsync(int, RequestOptions)
Remove a login session for a CS userParameters
loginId int
The login id to remove
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_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/sessionParameters
sessionKey string
CS session key, matching the ‘login’ table
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int> The ID of the login table row, or 0 if not found<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_SaveAllCustomerCenterConfigsAsync_SuperOffice_WebApi_Data_CustomerCenterConfig___SuperOffice_WebApi_RequestOptions_”></a> SaveAllCustomerCenterConfigsAsync(CustomerCenterConfig[], RequestOptions)
Save an array of CustomerCenterConfig entities to the databaseParameters
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_CustomerServiceAgent_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> New or updated CustomerCenterConfig<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_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> New or updated MailboxEntity<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_SaveSystemTemplateSettingsAsync_SuperOffice_WebApi_Data_SystemTemplateSettings_SuperOffice_WebApi_RequestOptions_”></a> SaveSystemTemplateSettingsAsync(SystemTemplateSettings, RequestOptions)
Saves and validates updated system templates. Throws exception if validation failsParameters
systemTemplateSettings SystemTemplateSettings
System template settings item with updated values
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<SystemTemplateSettings> Updated system template settings<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_SessionIsValidAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> SessionIsValidAsync(string, RequestOptions)
Check if a CS session is validParameters
csSessionKey string
The CS session key to check
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<bool> True if there is a valid CS session based on the session key<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_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 accountParameters
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> Contains the result of the test<a id=“SuperOffice_WebApi_Agents_CustomerServiceAgent_UpdateFeatureTogglesAsync_SuperOffice_WebApi_Data_CsFeatureToggle___SuperOffice_WebApi_RequestOptions_”></a> UpdateFeatureTogglesAsync(CsFeatureToggle[], RequestOptions)
Update the cached FeatureToggles for CSParameters
featureToggles CsFeatureToggle[]
Feature toggle name / state
requestOptions RequestOptions
Override language/culture codes on this request.