> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SuperOffice.WebApi.Agents.CustomerServiceAgent

# \<a id="SuperOffice\_WebApi\_Agents\_CustomerServiceAgent">\</a> Class CustomerServiceAgent

Namespace: [SuperOffice.WebApi.Agents](SuperOffice.WebApi.Agents.md)\
Assembly: SuperOffice.WebApi.dll

Agent used for Customer Service methods

```csharp theme={null}
public class CustomerServiceAgent : AgentBase, ICustomerServiceAgent, IAgentBase, IDisposable
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ←
[AgentBase](SuperOffice.WebApi.Agents.AgentBase.md) ←
[CustomerServiceAgent](SuperOffice.WebApi.Agents.CustomerServiceAgent.md)

#### Implements

[ICustomerServiceAgent](SuperOffice.WebApi.Agents.ICustomerServiceAgent.md),
[IAgentBase](SuperOffice.WebApi.Agents.IAgentBase.md),
[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

#### Inherited Members

[AgentBase.\_json](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__json),
[AgentBase.\_binary](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__binary),
[AgentBase.\_config](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__config),
[AgentBase.\_client](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__client),
[AgentBase.\_disposeClient](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__disposeClient),
[AgentBase.Merge(RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Merge_SuperOffice_WebApi_RequestOptions_),
[AgentBase.BuildRequestFromObject(HttpMethod, string, object, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromObject_System_Net_Http_HttpMethod_System_String_System_Object_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.BuildRequestFromStream(HttpMethod, string, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromStream_System_Net_Http_HttpMethod_System_String_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.BuildRequestFromObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromObjectWithStream_System_Net_Http_HttpMethod_System_String_System_Object_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.ParseAuthorization(IAuthorization)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ParseAuthorization_SuperOffice_WebApi_Authorization_IAuthorization_),
[AgentBase.CancelRequest()](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_CancelRequest),
[AgentBase.SendRequestObject(HttpMethod, string, object, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequestObject_System_Net_Http_HttpMethod_System_String_System_Object_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.SendRequestObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequestObjectWithStream_System_Net_Http_HttpMethod_System_String_System_Object_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.SendRequest(HttpRequestMessage, RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequest_System_Net_Http_HttpRequestMessage_SuperOffice_WebApi_RequestOptions_),
[AgentBase.ThrowOnResponseErrorAsync(HttpRequestMessage, HttpResponseMessage)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ThrowOnResponseErrorAsync_System_Net_Http_HttpRequestMessage_System_Net_Http_HttpResponseMessage_),
[AgentBase.ParseResponse\<T\&gt;(HttpResponseMessage)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ParseResponse__1_System_Net_Http_HttpResponseMessage_),
[AgentBase.Finally(RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Finally_SuperOffice_WebApi_RequestOptions_),
[AgentBase.Dispose()](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Dispose),
[AgentBase.Configuration](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Configuration),
[AgentBase.Client](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Client),
[AgentBase.HasRunningRequest](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_HasRunningRequest),
[AgentBase.ClientCancellationTokenSource](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ClientCancellationTokenSource),
[AgentBase.ProgressListener](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ProgressListener),
[AgentBase.UploadProgressListener](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_UploadProgressListener),
[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring),
[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)),
[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)),
[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals),
[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode),
[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype),
[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone)

## Examples

\<pre>\<code class="lang-csharp">using SuperOffice.WebApi;
using SuperOffice.WebApi.Agents;

var mySession = new WebApiOptions("[http://example.com/super/api](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 methods

```csharp theme={null}
public CustomerServiceAgent(HttpClient httpClient)
```

#### Parameters

`httpClient` [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.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 methods

```csharp theme={null}
public CustomerServiceAgent(WebApiOptions options, HttpClient httpClient = null)
```

#### Parameters

`options` [WebApiOptions](SuperOffice.WebApi.WebApiOptions.md)

Base URL and authentication values.

`httpClient` [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.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 data

```csharp theme={null}
public Task<TicketInfo> AddMessageFromMailDataAsync(int ticketId, string data, RequestOptions requestOptions = null)
```

#### Parameters

`ticketId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the ticket to add a message

`data` [string](https://learn.microsoft.com/dotnet/api/system.string)

RFC822 formatted data to import as a message

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[TicketInfo](SuperOffice.WebApi.Data.TicketInfo.md)\&gt;

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 customized

```csharp theme={null}
public Task<bool> CheckIfCustomizedTemplatesAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

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 keys

```csharp theme={null}
public Task<string> CheckSymmetricEncryptionAsync(string encryptedString, RequestOptions requestOptions = null)
```

#### Parameters

`encryptedString` [string](https://learn.microsoft.com/dotnet/api/system.string)

An encrypted version of the string

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\&gt;

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 instance

```csharp theme={null}
public Task<CustomerCenterConfig> CreateDefaultCustomerCenterConfigAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CustomerCenterConfig](SuperOffice.WebApi.Data.CustomerCenterConfig.md)\&gt;

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 instance

```csharp theme={null}
public Task<MailboxEntity> CreateDefaultMailboxEntityAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[MailboxEntity](SuperOffice.WebApi.Data.MailboxEntity.md)\&gt;

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 user

```csharp theme={null}
public Task<CsSessionKey> CreateSessionAsync(string remoteIp, RequestOptions requestOptions = null)
```

#### Parameters

`remoteIp` [string](https://learn.microsoft.com/dotnet/api/system.string)

The ip of the client creating the session

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CsSessionKey](SuperOffice.WebApi.Data.CsSessionKey.md)\&gt;

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 data

```csharp theme={null}
public Task<TicketInfo> CreateTicketFromMailDataAsync(int mailboxId, string data, int personId, RequestOptions requestOptions = null)
```

#### Parameters

`mailboxId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the Service mailbox

`data` [string](https://learn.microsoft.com/dotnet/api/system.string)

RFC822 formatted data to import as a ticket

`personId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

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](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[TicketInfo](SuperOffice.WebApi.Data.TicketInfo.md)\&gt;

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 CustomerCenterConfig

```csharp theme={null}
public Task DeleteCustomerCenterConfigAsync(int customerCenterConfigId, RequestOptions requestOptions = null)
```

#### Parameters

`customerCenterConfigId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identity of the CustomerCenterConfig

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.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 enum

```csharp theme={null}
public Task<bool> EventHandlerExistsAsync(EventHandlerType eventHandlerType, RequestOptions requestOptions = null)
```

#### Parameters

`eventHandlerType` [EventHandlerType](SuperOffice.WebApi.Data.EventHandlerType.md)

The EventHandlerType we are checking

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

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 exists

```csharp theme={null}
public Task<EventHandlerType[]> EventHandlersExistsAsync(EventHandlerType[] eventHandlerTypes, RequestOptions requestOptions = null)
```

#### Parameters

`eventHandlerTypes` [EventHandlerType](SuperOffice.WebApi.Data.EventHandlerType.md)\[]

The EventHandlerTypes we are checking

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EventHandlerType](SuperOffice.WebApi.Data.EventHandlerType.md)\[]\&gt;

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.

```csharp theme={null}
public Task<EventData> ExecuteEventHandlersAsync(EventData eventData, RequestOptions requestOptions = null)
```

#### Parameters

`eventData` [EventData](SuperOffice.WebApi.Data.EventData.md)

The EventData instance sent to the event handler

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EventData](SuperOffice.WebApi.Data.EventData.md)\&gt;

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 id

```csharp theme={null}
public Task<TicketInfo[]> FindTicketsByTitleOrIdAsync(string titleOrId, int maxRows, RequestOptions requestOptions = null)
```

#### Parameters

`titleOrId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The search string. If this is a number, it will also search for a matching ticket id

`maxRows` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The maximum number of rows to be returned

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[TicketInfo](SuperOffice.WebApi.Data.TicketInfo.md)\[]\&gt;

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 entities

```csharp theme={null}
public Task<CustomerCenterConfig[]> GetAllCustomerCenterConfigsAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CustomerCenterConfig](SuperOffice.WebApi.Data.CustomerCenterConfig.md)\[]\&gt;

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.

```csharp theme={null}
public Task<CustomerCenterConfig> GetCustomerCenterConfigAsync(int customerCenterConfigId, RequestOptions requestOptions = null)
```

#### Parameters

`customerCenterConfigId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the CustomerCenterConfig object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CustomerCenterConfig](SuperOffice.WebApi.Data.CustomerCenterConfig.md)\&gt;

CustomerCenterConfig

### \<a id="SuperOffice\_WebApi\_Agents\_CustomerServiceAgent\_GetCustomerServiceStartupAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetCustomerServiceStartupAsync(RequestOptions)

Get the carrier with data that Service needs when starting up

```csharp theme={null}
public Task<CustomerServiceStartup> GetCustomerServiceStartupAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CustomerServiceStartup](SuperOffice.WebApi.Data.CustomerServiceStartup.md)\&gt;

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 user

```csharp theme={null}
public Task<CustomerServiceStartup> GetCustomerServiceStartupByOwnerAsync(int userId, RequestOptions requestOptions = null)
```

#### Parameters

`userId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The user for which we want to fetch the startup values for

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CustomerServiceStartup](SuperOffice.WebApi.Data.CustomerServiceStartup.md)\&gt;

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=157

```csharp theme={null}
public Task<string> GetFaqForCustomerAsync(int faqEntryId, RequestOptions requestOptions = null)
```

#### Parameters

`faqEntryId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

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](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\&gt;

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.

```csharp theme={null}
public Task<MailboxEntity> GetMailboxEntityAsync(int mailboxEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`mailboxEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the MailboxEntity object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[MailboxEntity](SuperOffice.WebApi.Data.MailboxEntity.md)\&gt;

MailboxEntity

### \<a id="SuperOffice\_WebApi\_Agents\_CustomerServiceAgent\_GetMailboxesAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetMailboxesAsync(RequestOptions)

This method will get all registered mailboxes in Service

```csharp theme={null}
public Task<Mailbox[]> GetMailboxesAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[Mailbox](SuperOffice.WebApi.Data.Mailbox.md)\[]\&gt;

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 parser

```csharp theme={null}
public Task<ReplyTemplateParsed> GetParsedTemplateAsync(int replyTemplateId, int languageId, int personId, int ticketId, RequestOptions requestOptions = null)
```

#### Parameters

`replyTemplateId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the reply template

`languageId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The language id (prefered language). If 0 is given, the language of the person will be used

`personId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the person that will be populated into the parser

`ticketId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the ticket that will be populated into the parser

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ReplyTemplateParsed](SuperOffice.WebApi.Data.ReplyTemplateParsed.md)\&gt;

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 id

```csharp theme={null}
public Task<PreviewFaqEntry> GetPreviewFaqEntryAsync(int kbEntryId, RequestOptions requestOptions = null)
```

#### Parameters

`kbEntryId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

FAQ entry ID

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[PreviewFaqEntry](SuperOffice.WebApi.Data.PreviewFaqEntry.md)\&gt;

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 id

```csharp theme={null}
public Task<PreviewQuickReply> GetPreviewQuickReplyAsync(int quickReplyId, RequestOptions requestOptions = null)
```

#### Parameters

`quickReplyId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Quick reply ID

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[PreviewQuickReply](SuperOffice.WebApi.Data.PreviewQuickReply.md)\&gt;

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 id

```csharp theme={null}
public Task<PreviewReplyTemplate> GetPreviewReplyTemplateAsync(int replyTemplateId, RequestOptions requestOptions = null)
```

#### Parameters

`replyTemplateId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Reply template ID

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[PreviewReplyTemplate](SuperOffice.WebApi.Data.PreviewReplyTemplate.md)\&gt;

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.

```csharp theme={null}
public Task<string> GetProgramUrlAsync(string programName, bool external, RequestOptions requestOptions = null)
```

#### Parameters

`programName` [string](https://learn.microsoft.com/dotnet/api/system.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](https://learn.microsoft.com/dotnet/api/system.boolean)

If set to true, this will generate URLs that are accesible from the outside (for example Internet)

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\&gt;

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.

```csharp theme={null}
public Task<SmsConfig> GetSmsConfigAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[SmsConfig](SuperOffice.WebApi.Data.SmsConfig.md)\&gt;

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 Page

```csharp theme={null}
public Task<StatisticsDataSet[]> GetStatisticsAsync(StatusScreenPanelType[] functions, RequestOptions requestOptions = null)
```

#### Parameters

`functions` [StatusScreenPanelType](SuperOffice.WebApi.Data.StatusScreenPanelType.md)\[]

List of functions to calculate and return

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[StatisticsDataSet](SuperOffice.WebApi.Data.StatisticsDataSet.md)\[]\&gt;

Array of StatisticsDataSet

### \<a id="SuperOffice\_WebApi\_Agents\_CustomerServiceAgent\_GetSystemTemplateSettingsAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetSystemTemplateSettingsAsync(RequestOptions)

Returns system template settings

```csharp theme={null}
public Task<SystemTemplateSettings> GetSystemTemplateSettingsAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[SystemTemplateSettings](SuperOffice.WebApi.Data.SystemTemplateSettings.md)\&gt;

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.

```csharp theme={null}
public Task<ReplyTemplateParsed> GetUnparsedTemplateAsync(int replyTemplateId, int languageId, RequestOptions requestOptions = null)
```

#### Parameters

`replyTemplateId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the reply template

`languageId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The language id (prefered language). If 0 is given, the language of the person will be used

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ReplyTemplateParsed](SuperOffice.WebApi.Data.ReplyTemplateParsed.md)\&gt;

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 notification

```csharp theme={null}
public Task<bool> HasChatNotifyAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

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 user

```csharp theme={null}
public Task RemoveSessionAsync(int loginId, RequestOptions requestOptions = null)
```

#### Parameters

`loginId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The login id to remove

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.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/session

```csharp theme={null}
public Task<int> ReportSessionActiveAsync(string sessionKey, RequestOptions requestOptions = null)
```

#### Parameters

`sessionKey` [string](https://learn.microsoft.com/dotnet/api/system.string)

CS session key, matching the 'login' table

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\&gt;

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 database

```csharp theme={null}
public Task SaveAllCustomerCenterConfigsAsync(CustomerCenterConfig[] custConfigs, RequestOptions requestOptions = null)
```

#### Parameters

`custConfigs` [CustomerCenterConfig](SuperOffice.WebApi.Data.CustomerCenterConfig.md)\[]

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](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.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.

```csharp theme={null}
public Task<CustomerCenterConfig> SaveCustomerCenterConfigAsync(CustomerCenterConfig customerCenterConfig, RequestOptions requestOptions = null)
```

#### Parameters

`customerCenterConfig` [CustomerCenterConfig](SuperOffice.WebApi.Data.CustomerCenterConfig.md)

The CustomerCenterConfig that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CustomerCenterConfig](SuperOffice.WebApi.Data.CustomerCenterConfig.md)\&gt;

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.

```csharp theme={null}
public Task<MailboxEntity> SaveMailboxEntityAsync(MailboxEntity mailboxEntity, RequestOptions requestOptions = null)
```

#### Parameters

`mailboxEntity` [MailboxEntity](SuperOffice.WebApi.Data.MailboxEntity.md)

The MailboxEntity that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[MailboxEntity](SuperOffice.WebApi.Data.MailboxEntity.md)\&gt;

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 fails

```csharp theme={null}
public Task<SystemTemplateSettings> SaveSystemTemplateSettingsAsync(SystemTemplateSettings systemTemplateSettings, RequestOptions requestOptions = null)
```

#### Parameters

`systemTemplateSettings` [SystemTemplateSettings](SuperOffice.WebApi.Data.SystemTemplateSettings.md)

System template settings item with updated values

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[SystemTemplateSettings](SuperOffice.WebApi.Data.SystemTemplateSettings.md)\&gt;

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 valid

```csharp theme={null}
public Task<bool> SessionIsValidAsync(string csSessionKey, RequestOptions requestOptions = null)
```

#### Parameters

`csSessionKey` [string](https://learn.microsoft.com/dotnet/api/system.string)

The CS session key to check

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

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 account

```csharp theme={null}
public Task<SmtpTestResult> TestSmtpServerAsync(string smtpUri, string from, bool useStoredPassword, RequestOptions requestOptions = null)
```

#### Parameters

`smtpUri` [string](https://learn.microsoft.com/dotnet/api/system.string)

An URI containing information to connect to the SMTP server, eg. smtps\://myuser:[mypassword@smtp.myserver.com](mailto:mypassword@smtp.myserver.com):465. Note that username and password must be url encoded

`from` [string](https://learn.microsoft.com/dotnet/api/system.string)

The from-address used in the test

`useStoredPassword` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Use database persisted password

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[SmtpTestResult](SuperOffice.WebApi.Data.SmtpTestResult.md)\&gt;

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 CS

```csharp theme={null}
public Task UpdateFeatureTogglesAsync(CsFeatureToggle[] featureToggles, RequestOptions requestOptions = null)
```

#### Parameters

`featureToggles` [CsFeatureToggle](SuperOffice.WebApi.Data.CsFeatureToggle.md)\[]

Feature toggle name / state

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)


## Related topics

- [SuperOffice.WebApi.Data.CustomerServiceConfig](/en/api/reference/webapi/SuperOffice.WebApi.Data.CustomerServiceConfig.md)
- [SuperOffice.WebApi.Data.CustomerServiceStartup](/en/api/reference/webapi/SuperOffice.WebApi.Data.CustomerServiceStartup.md)
- [SuperOffice.WebApi.Data.CustomerCenterConfig](/en/api/reference/webapi/SuperOffice.WebApi.Data.CustomerCenterConfig.md)
