> ## 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.ITicketAgent

# \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent">\</a> Interface ITicketAgent

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

Agent used for Ticket functions

```csharp theme={null}
public interface ITicketAgent : IAgentBase, IDisposable
```

#### Implements

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

## Methods

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_AcceptTicketsAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> AcceptTicketsAsync(int\[], RequestOptions)

Accepts tickets by their ids. Sets owner to current user

```csharp theme={null}
Task AcceptTicketsAsync(int[] ticketIds, RequestOptions requestOptions = null)
```

#### Parameters

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

Ids of tickets to be accepted.

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

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_AddAttachmentsAsync\_System\_Int32\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> AddAttachmentsAsync(int, int\[], RequestOptions)

Connect existing attachments with this TicketMessage. Can connect multiple attachments

```csharp theme={null}
Task AddAttachmentsAsync(int ticketMessageEntityId, int[] attachmentIds, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket message to connect the attachments to

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

An array of attachments to connect to this TicketMessage

`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\_ITicketAgent\_BatchForwardAsync\_System\_Int32\_\_\_System\_String\_\_\_System\_String\_\_\_System\_String\_\_\_System\_String\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> BatchForwardAsync(int\[], string\[], string\[], string\[], string, bool, RequestOptions)

Forwards selected tickets to specified recipients. This method starts a batch task.

```csharp theme={null}
Task<int> BatchForwardAsync(int[] ticketIds, string[] to, string[] cc, string[] bcc, string comment, bool closeTicket, RequestOptions requestOptions = null)
```

#### Parameters

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

Ids of tickets to be forwarded.

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

The To-recipients. Each recipient must be in correct mailbox format ([john@example.com](mailto:john@example.com) or John Doe \<[john@example.com](mailto:john@example.com)>).

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

The Cc-recipients. Each recipient must be in correct mailbox format ([john@example.com](mailto:john@example.com) or John Doe \<[john@example.com](mailto:john@example.com)>).

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

The Bcc-recipients. Each recipient must be in correct mailbox format ([john@example.com](mailto:john@example.com) or John Doe \<[john@example.com](mailto:john@example.com)>).

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

Comment will be included before ticket messages. Might be empty

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

If true, ticket will be closed after forwarding

`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;

ID of the new batch task.

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_BatchReplyAsync\_SuperOffice\_WebApi\_Data\_TicketBatchReplyData\_SuperOffice\_WebApi\_RequestOptions\_">\</a> BatchReplyAsync(TicketBatchReplyData, RequestOptions)

Replies to the specified tickets. This method starts a batch task.

```csharp theme={null}
Task<int> BatchReplyAsync(TicketBatchReplyData batchReplyData, RequestOptions requestOptions = null)
```

#### Parameters

`batchReplyData` [TicketBatchReplyData](SuperOffice.WebApi.Data.TicketBatchReplyData.md)

All data needed to initiate a mass ticket reply sending.

`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;

ID of the new batch task.

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_CalculateMessageRecipientsAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_MessageActionType\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CalculateMessageRecipientsAsync(int, MessageActionType, int, RequestOptions)

Gets recipients for new message

```csharp theme={null}
Task<Recipient[]> CalculateMessageRecipientsAsync(int ticketId, MessageActionType actionType, int messageId, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket

`actionType` [MessageActionType](SuperOffice.WebApi.Data.MessageActionType.md)

Message action

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

Optional ID of message being replied. Value \<= 0 ignores parameter

`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)\<[Recipient](SuperOffice.WebApi.Data.Recipient.md)\[]\&gt;

An array with Recipient objects

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_ClearNotifyAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ClearNotifyAsync(int\[], RequestOptions)

Clear notification status for one or more tickets.

```csharp theme={null}
Task ClearNotifyAsync(int[] ids, RequestOptions requestOptions = null)
```

#### Parameters

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

List of notify IDs.

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

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_CopyFromCRMDocumentAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CopyFromCRMDocumentAsync(int, RequestOptions)

Copy CRM document to an attachment

```csharp theme={null}
Task<AttachmentEntity> CopyFromCRMDocumentAsync(int documentId, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the document to copy to an attachment

`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)\<[AttachmentEntity](SuperOffice.WebApi.Data.AttachmentEntity.md)\&gt;

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_CopyToTempFileAsync\_System\_String\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CopyToTempFileAsync(string, int, RequestOptions)

Copy ticket attachment to temporary file. Needed for existing document dialog compatibility

```csharp theme={null}
Task<string> CopyToTempFileAsync(string filename, int attachmentId, RequestOptions requestOptions = null)
```

#### Parameters

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

Preferred filename

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

The id of the attachment to copy

`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;

Temporary document filename

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_CreateDefaultAttachmentEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultAttachmentEntityAsync(RequestOptions)

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

```csharp theme={null}
Task<AttachmentEntity> CreateDefaultAttachmentEntityAsync(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)\<[AttachmentEntity](SuperOffice.WebApi.Data.AttachmentEntity.md)\&gt;

A blank AttachmentEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_CreateDefaultForTicketTypeAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultForTicketTypeAsync(int, RequestOptions)

Create default ticket entity for particular TicketType

```csharp theme={null}
Task<TicketEntity> CreateDefaultForTicketTypeAsync(int ticketTypeId, RequestOptions requestOptions = null)
```

#### Parameters

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

ID of ticket type

`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)\<[TicketEntity](SuperOffice.WebApi.Data.TicketEntity.md)\&gt;

Default ticket entity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_CreateDefaultTicketEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultTicketEntityAsync(RequestOptions)

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

```csharp theme={null}
Task<TicketEntity> CreateDefaultTicketEntityAsync(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)\<[TicketEntity](SuperOffice.WebApi.Data.TicketEntity.md)\&gt;

A blank TicketEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_CreateDefaultTicketMessageEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultTicketMessageEntityAsync(RequestOptions)

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

```csharp theme={null}
Task<TicketMessageEntity> CreateDefaultTicketMessageEntityAsync(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)\<[TicketMessageEntity](SuperOffice.WebApi.Data.TicketMessageEntity.md)\&gt;

A blank TicketMessageEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_CreateDefaultTicketRelationEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultTicketRelationEntityAsync(RequestOptions)

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

```csharp theme={null}
Task<TicketRelationEntity> CreateDefaultTicketRelationEntityAsync(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)\<[TicketRelationEntity](SuperOffice.WebApi.Data.TicketRelationEntity.md)\&gt;

A blank TicketRelationEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_CreateTicketRelationsAsync\_System\_Int32\_\_\_System\_Int32\_SuperOffice\_WebApi\_Data\_TicketRelationType\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateTicketRelationsAsync(int\[], int, TicketRelationType, string, RequestOptions)

Create multiple ticket relations in a single call. Returns a result per source ticket indicating success or failure.

```csharp theme={null}
Task<TicketRelationResult[]> CreateTicketRelationsAsync(int[] sourceTicketIds, int destinationTicketId, TicketRelationType relationType, string comment, RequestOptions requestOptions = null)
```

#### Parameters

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

The ids of the tickets to relate to the destination ticket.

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

The id of the ticket that the source tickets will be related to.

`relationType` [TicketRelationType](SuperOffice.WebApi.Data.TicketRelationType.md)

The type of relation to create.

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

Optional comment to store on each relation.

`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)\<[TicketRelationResult](SuperOffice.WebApi.Data.TicketRelationResult.md)\[]\&gt;

Creation results, one per source ticket id.

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_DeleteMessageHeadersAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteMessageHeadersAsync(int\[], RequestOptions)

Removes headers from the message as specified in the collection of entity ids. The ids are message header ids (message header primary key)

```csharp theme={null}
Task DeleteMessageHeadersAsync(int[] headerIds, RequestOptions requestOptions = null)
```

#### Parameters

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

Message header primary keys

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

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_DeleteTicketEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteTicketEntityAsync(int, RequestOptions)

Delete a ticket

```csharp theme={null}
Task DeleteTicketEntityAsync(int ticketEntityId, RequestOptions requestOptions = null)
```

#### Parameters

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

The ticket to delete

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

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_DeleteTicketMessageEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteTicketMessageEntityAsync(int, RequestOptions)

Delete a ticket message

```csharp theme={null}
Task DeleteTicketMessageEntityAsync(int ticketMessageEntityId, RequestOptions requestOptions = null)
```

#### Parameters

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

The ticket message to delete

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

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_DeleteTicketRelationEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteTicketRelationEntityAsync(int, RequestOptions)

Deletes the TicketRelationEntity

```csharp theme={null}
Task DeleteTicketRelationEntityAsync(int ticketRelationEntityId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identity of the TicketRelationEntity

`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\_ITicketAgent\_DoEscalatingAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_TicketPriorityEscalateAction\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DoEscalatingAsync(int, TicketPriorityEscalateAction, RequestOptions)

Checks if the ticket should change its alert level based on the priority and action. If it is to change, the alert level and alert timeout for the ticket will be updated.

```csharp theme={null}
Task DoEscalatingAsync(int ticketId, TicketPriorityEscalateAction action, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of ticket

`action` [TicketPriorityEscalateAction](SuperOffice.WebApi.Data.TicketPriorityEscalateAction.md)

The action to use when calculating the escalation

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

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetAttachmentEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAttachmentEntityAsync(int, RequestOptions)

Gets a specific AttachmentEntity object.

```csharp theme={null}
Task<AttachmentEntity> GetAttachmentEntityAsync(int attachmentEntityId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identifier of the AttachmentEntity 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)\<[AttachmentEntity](SuperOffice.WebApi.Data.AttachmentEntity.md)\&gt;

AttachmentEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetAttachmentInfoAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAttachmentInfoAsync(int, RequestOptions)

Get a list with meta data for all attached attachments

```csharp theme={null}
Task<AttachmentEntity[]> GetAttachmentInfoAsync(int ticketMessageEntityId, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket message to get attachment infos 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)\<[AttachmentEntity](SuperOffice.WebApi.Data.AttachmentEntity.md)\[]\&gt;

An array with AttachmentEntity objects, describing each attachment

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetAttachmentInfoNonInlineAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAttachmentInfoNonInlineAsync(int, RequestOptions)

Get a list with meta data for all attached attachments, EXCEPT those marked as inline

```csharp theme={null}
Task<AttachmentEntity[]> GetAttachmentInfoNonInlineAsync(int ticketMessageEntityId, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket message to get attachment infos 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)\<[AttachmentEntity](SuperOffice.WebApi.Data.AttachmentEntity.md)\[]\&gt;

An array with AttachmentEntity objects, describing each attachment; those marked as INLINE will be skipped

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetAttachmentPreviewAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAttachmentPreviewAsync(int, RequestOptions)

Retrieve an attachment from ticket message. The returned data is intended to be used for a preview. The returned data is sanitized.

```csharp theme={null}
Task<AttachmentPreview> GetAttachmentPreviewAsync(int attachmentId, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the attachment to retrieve

`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)\<[AttachmentPreview](SuperOffice.WebApi.Data.AttachmentPreview.md)\&gt;

Sanitized preview version of the attachment and additional metadata, if available

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetAttachmentStreamAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAttachmentStreamAsync(int, string, RequestOptions)

Get the content of an attachment

```csharp theme={null}
Task<byte[]> GetAttachmentStreamAsync(int attachmentId, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the attachment to retrieve

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

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`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)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

A stream to the attachment content

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetDefaultMessageContentAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_MessageActionType\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetDefaultMessageContentAsync(int, MessageActionType, int, RequestOptions)

Obsolete, use GetDefaultMessageContentFull instead

```csharp theme={null}
Task<string> GetDefaultMessageContentAsync(int ticketId, MessageActionType messageActionType, int ticketMessageId, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket

`messageActionType` [MessageActionType](SuperOffice.WebApi.Data.MessageActionType.md)

Message action type: None/Reply/ReplyAll/Forward

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

The id of the message to quote in the returned content. 0 to skip/ignore

`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;

Sanitized HTML content

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetDefaultMessageContentFullAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_MessageActionType\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetDefaultMessageContentFullAsync(int, MessageActionType, int, int, RequestOptions)

Generate a default message content: attachments and body as sanitized HTML

```csharp theme={null}
Task<TicketMessageContent> GetDefaultMessageContentFullAsync(int ticketId, MessageActionType messageActionType, int ticketMessageId, int ticketTypeId, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket

`messageActionType` [MessageActionType](SuperOffice.WebApi.Data.MessageActionType.md)

Message action type: None/Reply/ReplyAll/Forward

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

The id of the message to quote in the returned content. 0 to skip/ignore

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

The id of the ticket type to look for reply template. 0 to use current ticket type

`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)\<[TicketMessageContent](SuperOffice.WebApi.Data.TicketMessageContent.md)\&gt;

Generated default message content

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetDefaultMessageContentWithOptionsAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_MessageActionType\_System\_Int32\_System\_Int32\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetDefaultMessageContentWithOptionsAsync(int, MessageActionType, int, int, bool, RequestOptions)

Generate a default message content with option to exclude signature: attachments and body as sanitized HTML

```csharp theme={null}
Task<TicketMessageContent> GetDefaultMessageContentWithOptionsAsync(int ticketId, MessageActionType messageActionType, int ticketMessageId, int ticketTypeId, bool excludeSignature, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket

`messageActionType` [MessageActionType](SuperOffice.WebApi.Data.MessageActionType.md)

Message action type: None/Reply/ReplyAll/Forward

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

The id of the message to quote in the returned content. 0 to skip/ignore

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

The id of the ticket type to look for reply template. 0 to use current ticket type

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

Flag to exclude a signature when generating the return content

`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)\<[TicketMessageContent](SuperOffice.WebApi.Data.TicketMessageContent.md)\&gt;

Generated default message content

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetForRmUiAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetForRmUiAsync(int, RequestOptions)

Get a ticket entity, adapted to the specific needs of the Request Management UI. WARNING: This endpoint is not guaranteed to be stable/compatible between versions

```csharp theme={null}
Task<TicketEntity> GetForRmUiAsync(int ticketId, RequestOptions requestOptions = null)
```

#### Parameters

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

Primary key of ticket to fetch

`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)\<[TicketEntity](SuperOffice.WebApi.Data.TicketEntity.md)\&gt;

The ticket entity. Information is filtered/adapted to the current needs of the UI

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetHotlistEjUsersAsync\_System\_Int32\_System\_Int32\_\_\_SuperOffice\_WebApi\_Data\_NotifyType\_SuperOffice\_WebApi\_Data\_NotifyChannel\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetHotlistEjUsersAsync(int, int\[], NotifyType, NotifyChannel, RequestOptions)

Get a list of ej\_user ids who should receive hotlist notification based on request and notification type

```csharp theme={null}
Task<int[]> GetHotlistEjUsersAsync(int ticketId, int[] skipAssociateIds, NotifyType notifyType, NotifyChannel channel, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket

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

A list of associate ids to skip when calculating whom to get the notification

`notifyType` [NotifyType](SuperOffice.WebApi.Data.NotifyType.md)

The notification type we want to check for

`channel` [NotifyChannel](SuperOffice.WebApi.Data.NotifyChannel.md)

The channel which we should check 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)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\[]\&gt;

List of matching ej\_user ids

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetNextInQueueAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetNextInQueueAsync(RequestOptions)

Assign a ticket to the caller based on intelligent queue system

```csharp theme={null}
Task<TicketEntity> GetNextInQueueAsync(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)\<[TicketEntity](SuperOffice.WebApi.Data.TicketEntity.md)\&gt;

The ticket entity after assigning it to the caller

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetPreviewAttachmentStreamAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetPreviewAttachmentStreamAsync(int, RequestOptions)

Deprecated, see GetPreviewAttachment instead. Retrieve an attachment from ticket message. The returned data is intended to be used for a preview. The returned data is sanitized.

```csharp theme={null}
Task<DocumentPreview> GetPreviewAttachmentStreamAsync(int attachmentId, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the attachment to retrieve

`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)\<[DocumentPreview](SuperOffice.WebApi.Data.DocumentPreview.md)\&gt;

Sanitized preview version of the attachment

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetRfcAttachmentStreamAsync\_System\_Int32\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetRfcAttachmentStreamAsync(int, int, string, RequestOptions)

Get the content of an attachment which is part of RFC822 email attachment

```csharp theme={null}
Task<byte[]> GetRfcAttachmentStreamAsync(int attachmentId, int position, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the root attachment

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

The position (index) of the attachment within the root attachment. Numbering starts from 0

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

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`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)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

RFC822 attachment content as a Stream

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetTicketAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTicketAsync(int, RequestOptions)

Gets a specific Ticket object.

```csharp theme={null}
Task<Ticket> GetTicketAsync(int ticketId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identifier of the Ticket 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)\<[Ticket](SuperOffice.WebApi.Data.Ticket.md)\&gt;

Ticket

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetTicketAttachmentsAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTicketAttachmentsAsync(int, RequestOptions)

Get attachment infos for all attachments connected to messages in specified ticket

```csharp theme={null}
Task<AttachmentEntity[]> GetTicketAttachmentsAsync(int ticketEntityId, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket to get attachment infos from

`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)\<[AttachmentEntity](SuperOffice.WebApi.Data.AttachmentEntity.md)\[]\&gt;

An array containing attachment info objects for all the attachments

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetTicketEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTicketEntityAsync(int, RequestOptions)

Gets a specific TicketEntity object.

```csharp theme={null}
Task<TicketEntity> GetTicketEntityAsync(int ticketEntityId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identifier of the TicketEntity 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)\<[TicketEntity](SuperOffice.WebApi.Data.TicketEntity.md)\&gt;

TicketEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetTicketMessageAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTicketMessageAsync(int, RequestOptions)

Gets a specific TicketMessage object.

```csharp theme={null}
Task<TicketMessage> GetTicketMessageAsync(int ticketMessageId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identifier of the TicketMessage 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)\<[TicketMessage](SuperOffice.WebApi.Data.TicketMessage.md)\&gt;

TicketMessage

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetTicketMessageEntitiesAsync\_System\_Int32\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTicketMessageEntitiesAsync(int, int\[], RequestOptions)

Get ticket message entities with attachment info for given ticket

```csharp theme={null}
Task<TicketMessageEntity[]> GetTicketMessageEntitiesAsync(int ticketId, int[] messageIds, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket to get message entities from

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

Optional ids of message entities to get. If not provided, all ticket message entities 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)\<[TicketMessageEntity](SuperOffice.WebApi.Data.TicketMessageEntity.md)\[]\&gt;

An array containing ticket message entities

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetTicketMessageEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTicketMessageEntityAsync(int, RequestOptions)

Gets a specific TicketMessageEntity object.

```csharp theme={null}
Task<TicketMessageEntity> GetTicketMessageEntityAsync(int ticketMessageEntityId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identifier of the TicketMessageEntity 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)\<[TicketMessageEntity](SuperOffice.WebApi.Data.TicketMessageEntity.md)\&gt;

TicketMessageEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetTicketMessageWithEmbeddedDataAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_ImageEmbedType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTicketMessageWithEmbeddedDataAsync(int, ImageEmbedType, RequestOptions)

Get a ticket message entity with posibillity to change embedded images to be represented with inline data within the HTML body. If using inline data, be sure not to save this back to the database.

```csharp theme={null}
Task<TicketMessageEntity> GetTicketMessageWithEmbeddedDataAsync(int id, ImageEmbedType embedImages, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket message entity

`embedImages` [ImageEmbedType](SuperOffice.WebApi.Data.ImageEmbedType.md)

If set to Inline, then use inline base64 data to represent the images in the HTML body. Default: Link will use link to the image.

`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)\<[TicketMessageEntity](SuperOffice.WebApi.Data.TicketMessageEntity.md)\&gt;

The entity to get

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetTicketMessageWithOptionsAsync\_System\_Int32\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTicketMessageWithOptionsAsync(int, bool, RequestOptions)

Get a ticket message entity with additional options.

```csharp theme={null}
Task<TicketMessageEntity> GetTicketMessageWithOptionsAsync(int ticketMessageEntityId, bool includeNonInlineAttachmentsInfo, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket message entity

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

If true, then non inline attachments info will be loaded into TicketMessageEntity

`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)\<[TicketMessageEntity](SuperOffice.WebApi.Data.TicketMessageEntity.md)\&gt;

The entity to get

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetTicketParentIdAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTicketParentIdAsync(int, RequestOptions)

Get the parent ticket id. Returns 0 if the ticket has no parent.

```csharp theme={null}
Task<int> GetTicketParentIdAsync(int ticketId, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket to get the parent 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)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\&gt;

The id of the parent ticket, or 0 if there is no parent.

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetTicketRelationActionsAsync\_System\_Int32\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTicketRelationActionsAsync(int, int, int, RequestOptions)

Get the relation-driven actions that apply to a ticket, such as whether to offer closing the parent or whether open children are blocking the ticket from being closed.

```csharp theme={null}
Task<TicketRelationAction> GetTicketRelationActionsAsync(int ticketId, int parentTicketId, int ticketTypeId, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket being evaluated.

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

The id of the parent ticket, if any. Pass 0 if there is no parent.

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

The id of the ticket type.

`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)\<[TicketRelationAction](SuperOffice.WebApi.Data.TicketRelationAction.md)\&gt;

The relation-driven actions applicable to the ticket.

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetTicketRelationEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTicketRelationEntityAsync(int, RequestOptions)

Gets a specific TicketRelationEntity object.

```csharp theme={null}
Task<TicketRelationEntity> GetTicketRelationEntityAsync(int ticketRelationEntityId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identifier of the TicketRelationEntity 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)\<[TicketRelationEntity](SuperOffice.WebApi.Data.TicketRelationEntity.md)\&gt;

TicketRelationEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetTicketRelationsAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTicketRelationsAsync(int, RequestOptions)

Get all relations for a ticket.

```csharp theme={null}
Task<TicketRelationItem[]> GetTicketRelationsAsync(int ticketId, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket to get relations 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)\<[TicketRelationItem](SuperOffice.WebApi.Data.TicketRelationItem.md)\[]\&gt;

All relations for the ticket. Each item carries its RelationType (Parent, Child, or Related).

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetTicketSummariesAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTicketSummariesAsync(int\[], RequestOptions)

Get an array of summaryitem for the given tickets

```csharp theme={null}
Task<TicketSummaryItem[]> GetTicketSummariesAsync(int[] ticketIds, RequestOptions requestOptions = null)
```

#### Parameters

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

The tickets to fetch summaries 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)\<[TicketSummaryItem](SuperOffice.WebApi.Data.TicketSummaryItem.md)\[]\&gt;

Summary items for the given id's, in no particular order

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_GetTicketsAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTicketsAsync(int\[], RequestOptions)

Get multiple tickets

```csharp theme={null}
Task<Ticket[]> GetTicketsAsync(int[] ticketIds, RequestOptions requestOptions = null)
```

#### Parameters

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

The ids of tickets to get

`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)\<[Ticket](SuperOffice.WebApi.Data.Ticket.md)\[]\&gt;

Returns array of tickets in same order as input ids

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_Html2TextAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> Html2TextAsync(string, RequestOptions)

Create a plain text version of the html, suitable for email

```csharp theme={null}
Task<string> Html2TextAsync(string content, RequestOptions requestOptions = null)
```

#### Parameters

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

The html version

`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 plain text version

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_MergeTicketsAsync\_SuperOffice\_WebApi\_Data\_TicketEntity\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> MergeTicketsAsync(TicketEntity, int\[], RequestOptions)

Merge one or more tickets into one primary ticket

```csharp theme={null}
Task<TicketEntity> MergeTicketsAsync(TicketEntity mergedTicketEntity, int[] secondaryTicketIds, RequestOptions requestOptions = null)
```

#### Parameters

`mergedTicketEntity` [TicketEntity](SuperOffice.WebApi.Data.TicketEntity.md)

Merged ticket entity

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

Ids of secondary tickets

`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)\<[TicketEntity](SuperOffice.WebApi.Data.TicketEntity.md)\&gt;

The newly merged entity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_NotifyNewTicketAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> NotifyNewTicketAsync(int, RequestOptions)

Notify user agents about the creation of a new ticket

```csharp theme={null}
Task NotifyNewTicketAsync(int ticketEntityId, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket to notify about

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

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_NotifyNewTicketMessageAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> NotifyNewTicketMessageAsync(int, RequestOptions)

Notify user agents about the creation of a new message on a ticket

```csharp theme={null}
Task NotifyNewTicketMessageAsync(int ticketEntityId, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket to notify about

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

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_ProcessTicketWhenReadAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ProcessTicketWhenReadAsync(int, RequestOptions)

When a user view/read a ticket, a number of action should be performed: set read status, escalation handling, remove notifications, etc. Which actions will be performed depends on owner, caller and configuration

```csharp theme={null}
Task<TicketEntity> ProcessTicketWhenReadAsync(int ticketEntityId, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket to mark as read

`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)\<[TicketEntity](SuperOffice.WebApi.Data.TicketEntity.md)\&gt;

The ticket entity after marking it as read

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_RemoveMessageAttachmentsAsync\_System\_Int32\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RemoveMessageAttachmentsAsync(int, int\[], RequestOptions)

Removes attachments from the message as specified in the collection of entity ids. The ids are attachment ids (attachment primary key)

```csharp theme={null}
Task RemoveMessageAttachmentsAsync(int ticketMessageEntityId, int[] attachmentIds, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket message to remove attachments from

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

Attachment primary keys

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

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_ResolveTicketIdAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ResolveTicketIdAsync(int, RequestOptions)

Ticket can be connected (merged) to another ticket. This method traverses through its connection(s) and returns proper ticketId

```csharp theme={null}
Task<int> ResolveTicketIdAsync(int ticketId, RequestOptions requestOptions = null)
```

#### Parameters

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

Potentially correct ticketId

`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;

Correct ticketId. Returns 0 in case ticket does not exists

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SanitizeMailContentAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SanitizeMailContentAsync(string, RequestOptions)

Remove harmful HTML tags and attributes from an email

```csharp theme={null}
Task<string> SanitizeMailContentAsync(string content, RequestOptions requestOptions = null)
```

#### Parameters

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

The email content to sanitize

`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 sanitized email content

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SanitizeMailContentWithOptionsAsync\_System\_String\_SuperOffice\_WebApi\_Data\_HtmlSanitizerOptions\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SanitizeMailContentWithOptionsAsync(string, HtmlSanitizerOptions, RequestOptions)

Remove harmful HTML tags and attributes from an email, using specified options

```csharp theme={null}
Task<string> SanitizeMailContentWithOptionsAsync(string content, HtmlSanitizerOptions options, RequestOptions requestOptions = null)
```

#### Parameters

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

The email content to sanitize

`options` [HtmlSanitizerOptions](SuperOffice.WebApi.Data.HtmlSanitizerOptions.md)

The options for the sanitizer engine

`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 sanitized email content

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SanitizeMailContentsAsync\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SanitizeMailContentsAsync(string\[], RequestOptions)

Remove harmful HTML tags and attributes from an email

```csharp theme={null}
Task<string[]> SanitizeMailContentsAsync(string[] contents, RequestOptions requestOptions = null)
```

#### Parameters

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

The email contents to sanitize

`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 sanitized email contents

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SaveAttachmentEntityAsync\_SuperOffice\_WebApi\_Data\_AttachmentEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveAttachmentEntityAsync(AttachmentEntity, RequestOptions)

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

```csharp theme={null}
Task<AttachmentEntity> SaveAttachmentEntityAsync(AttachmentEntity attachmentEntity, RequestOptions requestOptions = null)
```

#### Parameters

`attachmentEntity` [AttachmentEntity](SuperOffice.WebApi.Data.AttachmentEntity.md)

The AttachmentEntity 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)\<[AttachmentEntity](SuperOffice.WebApi.Data.AttachmentEntity.md)\&gt;

New or updated AttachmentEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SaveTicketEntityAsync\_SuperOffice\_WebApi\_Data\_TicketEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveTicketEntityAsync(TicketEntity, RequestOptions)

Updates the existing TicketEntity or creates a new TicketEntity if the id parameter is 0. Does not notify users of save.

```csharp theme={null}
Task<TicketEntity> SaveTicketEntityAsync(TicketEntity ticketEntity, RequestOptions requestOptions = null)
```

#### Parameters

`ticketEntity` [TicketEntity](SuperOffice.WebApi.Data.TicketEntity.md)

The TicketEntity 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)\<[TicketEntity](SuperOffice.WebApi.Data.TicketEntity.md)\&gt;

New or updated TicketEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SaveTicketEntityWithNotifyAsync\_SuperOffice\_WebApi\_Data\_TicketEntity\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveTicketEntityWithNotifyAsync(TicketEntity, bool, RequestOptions)

Saves a ticket and performs any user notifications

```csharp theme={null}
Task<TicketEntity> SaveTicketEntityWithNotifyAsync(TicketEntity newEntity, bool notify, RequestOptions requestOptions = null)
```

#### Parameters

`newEntity` [TicketEntity](SuperOffice.WebApi.Data.TicketEntity.md)

The ticket to save

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

If true, then the notifications will be sent

`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)\<[TicketEntity](SuperOffice.WebApi.Data.TicketEntity.md)\&gt;

The newly saved entity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SaveTicketMessageEntityAsync\_SuperOffice\_WebApi\_Data\_TicketMessageEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveTicketMessageEntityAsync(TicketMessageEntity, RequestOptions)

Updates the existing TicketMessageEntity or creates a new TicketMessageEntity if the id parameter is 0. Does not notify users of save.

```csharp theme={null}
Task<TicketMessageEntity> SaveTicketMessageEntityAsync(TicketMessageEntity ticketMessageEntity, RequestOptions requestOptions = null)
```

#### Parameters

`ticketMessageEntity` [TicketMessageEntity](SuperOffice.WebApi.Data.TicketMessageEntity.md)

The TicketMessageEntity 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)\<[TicketMessageEntity](SuperOffice.WebApi.Data.TicketMessageEntity.md)\&gt;

New or updated TicketMessageEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SaveTicketMessageEntityWithNotifyAsync\_SuperOffice\_WebApi\_Data\_TicketMessageEntity\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveTicketMessageEntityWithNotifyAsync(TicketMessageEntity, bool, RequestOptions)

Saves a ticket message and performs any user notifications

```csharp theme={null}
Task<TicketMessageEntity> SaveTicketMessageEntityWithNotifyAsync(TicketMessageEntity newEntity, bool notify, RequestOptions requestOptions = null)
```

#### Parameters

`newEntity` [TicketMessageEntity](SuperOffice.WebApi.Data.TicketMessageEntity.md)

The ticket message to save

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

If true, then the notification will be sent along with the save

`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)\<[TicketMessageEntity](SuperOffice.WebApi.Data.TicketMessageEntity.md)\&gt;

The saved entity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SaveTicketMessageEntityWithOptionsAsync\_SuperOffice\_WebApi\_Data\_TicketMessageEntity\_System\_Boolean\_System\_Int32\_\_\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveTicketMessageEntityWithOptionsAsync(TicketMessageEntity, bool, int\[], bool, RequestOptions)

Saves a ticket message and performs additional actions

```csharp theme={null}
Task<TicketMessageEntity> SaveTicketMessageEntityWithOptionsAsync(TicketMessageEntity entity, bool notify, int[] attachmentIds, bool updateRepliedAt, RequestOptions requestOptions = null)
```

#### Parameters

`entity` [TicketMessageEntity](SuperOffice.WebApi.Data.TicketMessageEntity.md)

The ticket message to save

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

If true, then the notification will be sent along with the save

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

An array of attachments to connect to this TicketMessage

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

Updates ticket's replied\_at field if needed

`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)\<[TicketMessageEntity](SuperOffice.WebApi.Data.TicketMessageEntity.md)\&gt;

The saved entity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SaveTicketRelationEntityAsync\_SuperOffice\_WebApi\_Data\_TicketRelationEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveTicketRelationEntityAsync(TicketRelationEntity, RequestOptions)

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

```csharp theme={null}
Task<TicketRelationEntity> SaveTicketRelationEntityAsync(TicketRelationEntity ticketRelationEntity, RequestOptions requestOptions = null)
```

#### Parameters

`ticketRelationEntity` [TicketRelationEntity](SuperOffice.WebApi.Data.TicketRelationEntity.md)

The TicketRelationEntity 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)\<[TicketRelationEntity](SuperOffice.WebApi.Data.TicketRelationEntity.md)\&gt;

New or updated TicketRelationEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SendTicketMessageAsync\_System\_Int32\_System\_String\_\_\_System\_String\_\_\_System\_String\_\_\_System\_String\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SendTicketMessageAsync(int, string\[], string\[], string\[], string, int, string, RequestOptions)

Send a message to recipients by email

```csharp theme={null}
Task SendTicketMessageAsync(int ticketMessageEntityId, string[] to, string[] cc, string[] bcc, string subject, int replyTemplateId, string gdprSource, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket message to send

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

The To-recipients. Each recipient must be in correct format

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

The Cc-recipients. Each recipient must be in correct format

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

The Bcc-recipients. Each recipient must be in correct format

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

The subject

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

Optional ID of reply template to merge message with. \<= 0 to skip.

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

Obsolete

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

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SendTicketMessageSmsAsync\_System\_Int32\_System\_Int32\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SendTicketMessageSmsAsync(int, int, string\[], RequestOptions)

Send a message to recipients by sms

```csharp theme={null}
Task SendTicketMessageSmsAsync(int ticketMessageEntityId, int replyTemplateId, string[] sms, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket message to send

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

Optional ID of reply template to merge message with. \<= 0 to skip.

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

The Sms-recipients. Each recipient must be in correct format

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

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SetDeletedStatusByIdsAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetDeletedStatusByIdsAsync(int\[], RequestOptions)

Sets tickets' status to Deleted. After a grace period these tickets will be deleted by a background job.

```csharp theme={null}
Task<int[]> SetDeletedStatusByIdsAsync(int[] ticketIds, RequestOptions requestOptions = null)
```

#### Parameters

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

Ids of tickets to be set for deletion.

`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;

Ids of tickets set for deletion.

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SetDeletedStatusByProviderAsync\_System\_String\_SuperOffice\_WebApi\_Data\_ArchiveRestrictionInfo\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetDeletedStatusByProviderAsync(string, ArchiveRestrictionInfo\[], RequestOptions)

Sets tickets' status to Deleted. After a grace period these tickets will be deleted by a background job.

```csharp theme={null}
Task<int[]> SetDeletedStatusByProviderAsync(string providerName, ArchiveRestrictionInfo[] restrictions, RequestOptions requestOptions = null)
```

#### Parameters

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

Name of the provider that returns ticket rows.

`restrictions` [ArchiveRestrictionInfo](SuperOffice.WebApi.Data.ArchiveRestrictionInfo.md)\[]

Query restrictions to be added to provider. Fixed providers, such as LastTicketsProvider, FavouriteTicketsProvider etc. already have mandatory restrictions setup - in such case extra restrictions will be combined, however for general use case for fixed providers you can pass an empty array and provider will return default results. For selection providers generally you should pass selectionId as a restriction.

`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;

Ids of tickets set for deletion.

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SetSpamStatusByIdsAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetSpamStatusByIdsAsync(int\[], RequestOptions)

Sets tickets' status to SPAM. After a grace period these tickets will be deleted by a background job.

```csharp theme={null}
Task<int[]> SetSpamStatusByIdsAsync(int[] ticketIds, RequestOptions requestOptions = null)
```

#### Parameters

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

Ids of tickets to be set for SPAM.

`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;

Ids of tickets set for SPAM.

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SetSpamStatusByProviderAsync\_System\_String\_SuperOffice\_WebApi\_Data\_ArchiveRestrictionInfo\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetSpamStatusByProviderAsync(string, ArchiveRestrictionInfo\[], RequestOptions)

Sets tickets' status to SPAM. After a grace period these tickets will be deleted by a background job.

```csharp theme={null}
Task<int[]> SetSpamStatusByProviderAsync(string providerName, ArchiveRestrictionInfo[] restrictions, RequestOptions requestOptions = null)
```

#### Parameters

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

Name of the provider that returns ticket rows.

`restrictions` [ArchiveRestrictionInfo](SuperOffice.WebApi.Data.ArchiveRestrictionInfo.md)\[]

Query restrictions to be added to provider. Fixed providers, such as LastTicketsProvider, FavouriteTicketsProvider etc. already have mandatory restrictions setup - in such case extra restrictions will be combined, however for general use case for fixed providers you can pass an empty array and provider will return default results. For selection providers generally you should pass selectionId as a restriction.

`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;

Ids of tickets set for deletion.

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SetTicketMessageImportantAsync\_System\_Int32\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetTicketMessageImportantAsync(int, bool, RequestOptions)

Set the important flag on or off for a ticket message

```csharp theme={null}
Task SetTicketMessageImportantAsync(int ticketMessageId, bool important, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket message to set the important flag on

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

Turn on or off the important flag

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

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SetTicketParentAsync\_System\_Int32\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetTicketParentAsync(int, int, string, RequestOptions)

Set the parent of a ticket. If the ticket already has a parent, it will be overwritten.

```csharp theme={null}
Task SetTicketParentAsync(int ticketId, int parentTicketId, string comment, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket to set the parent on.

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

The id of the ticket to set as parent.

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

Optional comment to store on the relation.

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

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SetTicketReadByOwnerAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_TicketReadStatus\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetTicketReadByOwnerAsync(int, TicketReadStatus, bool, RequestOptions)

Set the ReadByOwner status for a ticket. It will only have an effect if the calling user is the same as the owner of the ticket

```csharp theme={null}
Task<TicketEntity> SetTicketReadByOwnerAsync(int ticketEntityId, TicketReadStatus readStatus, bool checkEscalating, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket to set

`readStatus` [TicketReadStatus](SuperOffice.WebApi.Data.TicketReadStatus.md)

The read status to set. See the enum for explanation of the different colors. Setting Unknown does nothing

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

If true, then the escalation system will be called and executed when setting the ReadByOwner

`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)\<[TicketEntity](SuperOffice.WebApi.Data.TicketEntity.md)\&gt;

The ticket entity after setting the ReadByOwner

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SplitTicketAsync\_System\_Int32\_System\_Int32\_System\_DateTime\_System\_Int32\_\_\_SuperOffice\_WebApi\_Data\_TicketEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SplitTicketAsync(int, int, DateTime, int\[], TicketEntity, RequestOptions)

Save new ticket and move/copy data from existing ticket in a single request. Specified messages will be moved.

```csharp theme={null}
Task<TicketEntity> SplitTicketAsync(int sourceTicketEntityId, int sourceTicketEntityStatusId, DateTime sourceTicketEntityActivate, int[] transferMessageIds, TicketEntity newTicketEntity, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the ticket to split

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

The id of the source ticket's status

`sourceTicketEntityActivate` [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)

The activate date of the source ticket

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

IDs of messages that should be transferred from the original ticket to the new one

`newTicketEntity` [TicketEntity](SuperOffice.WebApi.Data.TicketEntity.md)

The new ticket to save. Includes new values for simple properties like title, category, status, etc., but not messages.

`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)\<[TicketEntity](SuperOffice.WebApi.Data.TicketEntity.md)\&gt;

The newly created entity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_SplitTicketMessageAsync\_SuperOffice\_WebApi\_Data\_TicketMessageEntity\_SuperOffice\_WebApi\_Data\_TicketEntity\_SuperOffice\_WebApi\_Data\_TicketMessageEntity\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SplitTicketMessageAsync(TicketMessageEntity, TicketEntity, TicketMessageEntity, int\[], RequestOptions)

Create new ticket and move/copy data from existing ticket in addition update old message and save new message in a single request.

```csharp theme={null}
Task<TicketEntity> SplitTicketMessageAsync(TicketMessageEntity sourceTicketMessage, TicketEntity newTicketEntity, TicketMessageEntity newTicketMessage, int[] transferAttachmentsIds, RequestOptions requestOptions = null)
```

#### Parameters

`sourceTicketMessage` [TicketMessageEntity](SuperOffice.WebApi.Data.TicketMessageEntity.md)

The message being splitted, content can be modified as part of the split.

`newTicketEntity` [TicketEntity](SuperOffice.WebApi.Data.TicketEntity.md)

The new ticket to save. Includes new values for simple properties like title, category, status, etc., but not messages.

`newTicketMessage` [TicketMessageEntity](SuperOffice.WebApi.Data.TicketMessageEntity.md)

The new message to be saved

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

IDs of attachments that should be transferred from the original message to the new one

`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)\<[TicketEntity](SuperOffice.WebApi.Data.TicketEntity.md)\&gt;

The newly created entity

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_UndeleteByIdsAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> UndeleteByIdsAsync(int\[], RequestOptions)

Restores deleted tickets by their ids. Status is set to a default open status defined in Registry table

```csharp theme={null}
Task UndeleteByIdsAsync(int[] ticketIds, RequestOptions requestOptions = null)
```

#### Parameters

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

Ids of tickets to be restored.

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

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_UpdateTicketsReadStatusAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_Data\_TicketReadStatus\_SuperOffice\_WebApi\_RequestOptions\_">\</a> UpdateTicketsReadStatusAsync(int\[], TicketReadStatus, RequestOptions)

This method changes multiple tickets' read status

```csharp theme={null}
Task<int[]> UpdateTicketsReadStatusAsync(int[] ticketIds, TicketReadStatus newStatus, RequestOptions requestOptions = null)
```

#### Parameters

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

Ticket ids to be updated

`newStatus` [TicketReadStatus](SuperOffice.WebApi.Data.TicketReadStatus.md)

New read status

`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;

Updated ticket ids

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_UpdateTicketsReadStatusByProviderAsync\_System\_String\_SuperOffice\_WebApi\_Data\_ArchiveRestrictionInfo\_\_\_SuperOffice\_WebApi\_Data\_TicketReadStatus\_SuperOffice\_WebApi\_RequestOptions\_">\</a> UpdateTicketsReadStatusByProviderAsync(string, ArchiveRestrictionInfo\[], TicketReadStatus, RequestOptions)

This method changes multiple tickets' read status

```csharp theme={null}
Task<int[]> UpdateTicketsReadStatusByProviderAsync(string provider, ArchiveRestrictionInfo[] restrictions, TicketReadStatus newStatus, RequestOptions requestOptions = null)
```

#### Parameters

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

Name of the provider that returns ticket rows.

`restrictions` [ArchiveRestrictionInfo](SuperOffice.WebApi.Data.ArchiveRestrictionInfo.md)\[]

Query restrictions to be added to provider. Fixed providers, such as LastTicketsProvider, FavouriteTicketsProvider etc. already have mandatory restrictions setup - in such case extra restrictions will be combined, however for general use case for fixed providers you can pass an empty array and provider will return default results. For selection providers generally you should pass selectionId as a restriction.

`newStatus` [TicketReadStatus](SuperOffice.WebApi.Data.TicketReadStatus.md)

New read status

`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;

Updated ticket ids

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_UploadAttachmentAsync\_System\_Int32\_System\_Byte\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> UploadAttachmentAsync(int, byte\[], RequestOptions)

Upload the content for an attachment

```csharp theme={null}
Task UploadAttachmentAsync(int attachmentId, byte[] content, RequestOptions requestOptions = null)
```

#### Parameters

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

The id of the attachment row, for which to attach the upload data

`content` [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]

A stream to the content to be uploaded

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

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_ValidateAttachmentsAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ValidateAttachmentsAsync(int\[], RequestOptions)

Check attachments, return validation result for each item

```csharp theme={null}
Task<AttachmentValidationResult[]> ValidateAttachmentsAsync(int[] attachmentIds, RequestOptions requestOptions = null)
```

#### Parameters

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

The IDs of the attachments to validate

`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)\<[AttachmentValidationResult](SuperOffice.WebApi.Data.AttachmentValidationResult.md)\[]\&gt;

Validation result

### \<a id="SuperOffice\_WebApi\_Agents\_ITicketAgent\_ValidateTicketRelationsAsync\_System\_Int32\_\_\_System\_Int32\_SuperOffice\_WebApi\_Data\_TicketRelationType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ValidateTicketRelationsAsync(int\[], int, TicketRelationType, RequestOptions)

Validate proposed ticket relations without saving them. Returns a result per source ticket indicating whether the relation is valid.

```csharp theme={null}
Task<TicketRelationResult[]> ValidateTicketRelationsAsync(int[] sourceTicketIds, int destinationTicketId, TicketRelationType relationType, RequestOptions requestOptions = null)
```

#### Parameters

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

The ids of the tickets to relate to the destination ticket.

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

The id of the ticket that the source tickets will be related to.

`relationType` [TicketRelationType](SuperOffice.WebApi.Data.TicketRelationType.md)

The type of relation to create.

`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)\<[TicketRelationResult](SuperOffice.WebApi.Data.TicketRelationResult.md)\[]\&gt;

Validation results, one per source ticket id.
