<a id=“SuperOffice_WebApi_Agents_ITicketAgent”></a> Interface ITicketAgent
Namespace: SuperOffice.WebApi.AgentsAssembly: SuperOffice.WebApi.dll Agent used for Ticket functions
Implements
IAgentBase, IDisposableMethods
<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 userParameters
ticketIds int[]
Ids of tickets to be accepted.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
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 attachmentsParameters
ticketMessageEntityId int
The id of the ticket message to connect the attachments to
attachmentIds int[]
An array of attachments to connect to this TicketMessage
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
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.Parameters
ticketIds int[]
Ids of tickets to be forwarded.
to string[]
The To-recipients. Each recipient must be in correct mailbox format (john@example.com or John Doe <john@example.com>).
cc string[]
The Cc-recipients. Each recipient must be in correct mailbox format (john@example.com or John Doe <john@example.com>).
bcc string[]
The Bcc-recipients. Each recipient must be in correct mailbox format (john@example.com or John Doe <john@example.com>).
comment string
Comment will be included before ticket messages. Might be empty
closeTicket bool
If true, ticket will be closed after forwarding
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int> 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.Parameters
batchReplyData TicketBatchReplyData
All data needed to initiate a mass ticket reply sending.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int> 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 messageParameters
ticketId int
The id of the ticket
actionType MessageActionType
Message action
messageId int
Optional ID of message being replied. Value <= 0 ignores parameter
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<Recipient[]> 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.Parameters
ids int[]
List of notify IDs.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
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 attachmentParameters
documentId int
The id of the document to copy to an attachment
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<AttachmentEntity><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 compatibilityParameters
filename string
Preferred filename
attachmentId int
The id of the attachment to copy
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<string> 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 instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<AttachmentEntity> 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 TicketTypeParameters
ticketTypeId int
ID of ticket type
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketEntity> 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 instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketEntity> 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 instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketMessageEntity> 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 instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketRelationEntity> 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.Parameters
sourceTicketIds int[]
The ids of the tickets to relate to the destination ticket.
destinationTicketId int
The id of the ticket that the source tickets will be related to.
relationType TicketRelationType
The type of relation to create.
comment string
Optional comment to store on each relation.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketRelationResult[]> 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)Parameters
headerIds int[]
Message header primary keys
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
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 ticketParameters
ticketEntityId int
The ticket to delete
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
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 messageParameters
ticketMessageEntityId int
The ticket message to delete
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
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 TicketRelationEntityParameters
ticketRelationEntityId int
The identity of the TicketRelationEntity
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
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.Parameters
ticketId int
The id of ticket
action TicketPriorityEscalateAction
The action to use when calculating the escalation
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
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.Parameters
attachmentEntityId int
The identifier of the AttachmentEntity object
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<AttachmentEntity> 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 attachmentsParameters
ticketMessageEntityId int
The id of the ticket message to get attachment infos for
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<AttachmentEntity[]> 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 inlineParameters
ticketMessageEntityId int
The id of the ticket message to get attachment infos for
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<AttachmentEntity[]> 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.Parameters
attachmentId int
The id of the attachment to retrieve
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<AttachmentPreview> 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 attachmentParameters
attachmentId int
The id of the attachment to retrieve
returnContentType string
Accept content-type. Default “application/octet-stream”. Could also be “application/pdf”, “text/plain”, “text/html”, or “multipart/related”
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<byte[]> 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 insteadParameters
ticketId int
The id of the ticket
messageActionType MessageActionType
Message action type: None/Reply/ReplyAll/Forward
ticketMessageId int
The id of the message to quote in the returned content. 0 to skip/ignore
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<string> 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 HTMLParameters
ticketId int
The id of the ticket
messageActionType MessageActionType
Message action type: None/Reply/ReplyAll/Forward
ticketMessageId int
The id of the message to quote in the returned content. 0 to skip/ignore
ticketTypeId int
The id of the ticket type to look for reply template. 0 to use current ticket type
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketMessageContent> 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 HTMLParameters
ticketId int
The id of the ticket
messageActionType MessageActionType
Message action type: None/Reply/ReplyAll/Forward
ticketMessageId int
The id of the message to quote in the returned content. 0 to skip/ignore
ticketTypeId int
The id of the ticket type to look for reply template. 0 to use current ticket type
excludeSignature bool
Flag to exclude a signature when generating the return content
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketMessageContent> 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 versionsParameters
ticketId int
Primary key of ticket to fetch
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketEntity> 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 typeParameters
ticketId int
The id of the ticket
skipAssociateIds int[]
A list of associate ids to skip when calculating whom to get the notification
notifyType NotifyType
The notification type we want to check for
channel NotifyChannel
The channel which we should check for
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int[]> 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 systemParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketEntity> 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.Parameters
attachmentId int
The id of the attachment to retrieve
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<DocumentPreview> 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 attachmentParameters
attachmentId int
The id of the root attachment
position int
The position (index) of the attachment within the root attachment. Numbering starts from 0
returnContentType string
Accept content-type. Default “application/octet-stream”. Could also be “application/pdf”, “text/plain”, “text/html”, or “multipart/related”
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<byte[]> 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.Parameters
ticketId int
The identifier of the Ticket object
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<Ticket> 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 ticketParameters
ticketEntityId int
The id of the ticket to get attachment infos from
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<AttachmentEntity[]> 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.Parameters
ticketEntityId int
The identifier of the TicketEntity object
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketEntity> TicketEntity<a id=“SuperOffice_WebApi_Agents_ITicketAgent_GetTicketMessageAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetTicketMessageAsync(int, RequestOptions)
Gets a specific TicketMessage object.Parameters
ticketMessageId int
The identifier of the TicketMessage object
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketMessage> 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 ticketParameters
ticketId int
The id of the ticket to get message entities from
messageIds int[]
Optional ids of message entities to get. If not provided, all ticket message entities will be returned.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketMessageEntity[]> 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.Parameters
ticketMessageEntityId int
The identifier of the TicketMessageEntity object
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketMessageEntity> 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.Parameters
id int
The id of the ticket message entity
embedImages ImageEmbedType
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
Override language/culture codes on this request.
Returns
Task<TicketMessageEntity> 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.Parameters
ticketMessageEntityId int
The id of the ticket message entity
includeNonInlineAttachmentsInfo bool
If true, then non inline attachments info will be loaded into TicketMessageEntity
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketMessageEntity> 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.Parameters
ticketId int
The id of the ticket to get the parent for.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int> 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.Parameters
ticketId int
The id of the ticket being evaluated.
parentTicketId int
The id of the parent ticket, if any. Pass 0 if there is no parent.
ticketTypeId int
The id of the ticket type.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketRelationAction> 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.Parameters
ticketRelationEntityId int
The identifier of the TicketRelationEntity object
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketRelationEntity> TicketRelationEntity<a id=“SuperOffice_WebApi_Agents_ITicketAgent_GetTicketRelationsAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetTicketRelationsAsync(int, RequestOptions)
Get all relations for a ticket.Parameters
ticketId int
The id of the ticket to get relations for.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketRelationItem[]> 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 ticketsParameters
ticketIds int[]
The tickets to fetch summaries for
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketSummaryItem[]> 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 ticketsParameters
ticketIds int[]
The ids of tickets to get
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<Ticket[]> 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 emailParameters
content string
The html version
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<string> 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 ticketParameters
mergedTicketEntity TicketEntity
Merged ticket entity
secondaryTicketIds int[]
Ids of secondary tickets
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketEntity> 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 ticketParameters
ticketEntityId int
The id of the ticket to notify about
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
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 ticketParameters
ticketEntityId int
The id of the ticket to notify about
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
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 configurationParameters
ticketEntityId int
The id of the ticket to mark as read
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketEntity> 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)Parameters
ticketMessageEntityId int
The id of the ticket message to remove attachments from
attachmentIds int[]
Attachment primary keys
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
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 ticketIdParameters
ticketId int
Potentially correct ticketId
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int> 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 emailParameters
content string
The email content to sanitize
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<string> 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 optionsParameters
content string
The email content to sanitize
options HtmlSanitizerOptions
The options for the sanitizer engine
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<string> 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 emailParameters
contents string[]
The email contents to sanitize
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<string[]> 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.Parameters
attachmentEntity AttachmentEntity
The AttachmentEntity that is saved.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<AttachmentEntity> 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.Parameters
ticketEntity TicketEntity
The TicketEntity that is saved.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketEntity> 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 notificationsParameters
newEntity TicketEntity
The ticket to save
notify bool
If true, then the notifications will be sent
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketEntity> 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.Parameters
ticketMessageEntity TicketMessageEntity
The TicketMessageEntity that is saved.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketMessageEntity> 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 notificationsParameters
newEntity TicketMessageEntity
The ticket message to save
notify bool
If true, then the notification will be sent along with the save
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketMessageEntity> 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 actionsParameters
entity TicketMessageEntity
The ticket message to save
notify bool
If true, then the notification will be sent along with the save
attachmentIds int[]
An array of attachments to connect to this TicketMessage
updateRepliedAt bool
Updates ticket’s replied_at field if needed
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketMessageEntity> 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.Parameters
ticketRelationEntity TicketRelationEntity
The TicketRelationEntity that is saved.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketRelationEntity> 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 emailParameters
ticketMessageEntityId int
The id of the ticket message to send
to string[]
The To-recipients. Each recipient must be in correct format
cc string[]
The Cc-recipients. Each recipient must be in correct format
bcc string[]
The Bcc-recipients. Each recipient must be in correct format
subject string
The subject
replyTemplateId int
Optional ID of reply template to merge message with. <= 0 to skip.
gdprSource string
Obsolete
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
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 smsParameters
ticketMessageEntityId int
The id of the ticket message to send
replyTemplateId int
Optional ID of reply template to merge message with. <= 0 to skip.
sms string[]
The Sms-recipients. Each recipient must be in correct format
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
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.Parameters
ticketIds int[]
Ids of tickets to be set for deletion.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int[]> 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.Parameters
providerName string
Name of the provider that returns ticket rows.
restrictions ArchiveRestrictionInfo[]
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
Override language/culture codes on this request.
Returns
Task<int[]> 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.Parameters
ticketIds int[]
Ids of tickets to be set for SPAM.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int[]> 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.Parameters
providerName string
Name of the provider that returns ticket rows.
restrictions ArchiveRestrictionInfo[]
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
Override language/culture codes on this request.
Returns
Task<int[]> 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 messageParameters
ticketMessageId int
The id of the ticket message to set the important flag on
important bool
Turn on or off the important flag
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
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.Parameters
ticketId int
The id of the ticket to set the parent on.
parentTicketId int
The id of the ticket to set as parent.
comment string
Optional comment to store on the relation.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
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 ticketParameters
ticketEntityId int
The id of the ticket to set
readStatus TicketReadStatus
The read status to set. See the enum for explanation of the different colors. Setting Unknown does nothing
checkEscalating bool
If true, then the escalation system will be called and executed when setting the ReadByOwner
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketEntity> 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.Parameters
sourceTicketEntityId int
The id of the ticket to split
sourceTicketEntityStatusId int
The id of the source ticket’s status
sourceTicketEntityActivate DateTime
The activate date of the source ticket
transferMessageIds int[]
IDs of messages that should be transferred from the original ticket to the new one
newTicketEntity TicketEntity
The new ticket to save. Includes new values for simple properties like title, category, status, etc., but not messages.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketEntity> 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.Parameters
sourceTicketMessage TicketMessageEntity
The message being splitted, content can be modified as part of the split.
newTicketEntity TicketEntity
The new ticket to save. Includes new values for simple properties like title, category, status, etc., but not messages.
newTicketMessage TicketMessageEntity
The new message to be saved
transferAttachmentsIds int[]
IDs of attachments that should be transferred from the original message to the new one
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<TicketEntity> 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 tableParameters
ticketIds int[]
Ids of tickets to be restored.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
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 statusParameters
ticketIds int[]
Ticket ids to be updated
newStatus TicketReadStatus
New read status
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int[]> 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 statusParameters
provider string
Name of the provider that returns ticket rows.
restrictions ArchiveRestrictionInfo[]
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
New read status
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int[]> 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 attachmentParameters
attachmentId int
The id of the attachment row, for which to attach the upload data
content byte[]
A stream to the content to be uploaded
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
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 itemParameters
attachmentIds int[]
The IDs of the attachments to validate
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<AttachmentValidationResult[]> 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.Parameters
sourceTicketIds int[]
The ids of the tickets to relate to the destination ticket.
destinationTicketId int
The id of the ticket that the source tickets will be related to.
relationType TicketRelationType
The type of relation to create.
requestOptions RequestOptions
Override language/culture codes on this request.