Class TicketAgent
Facade for the Ticket Agent Agent used for Ticket functions
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
public class TicketAgent : AgentBase<ITicketAgent>, IDisposable, ITicketAgent, IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
Constructors
TicketAgent()
Facade for the Ticket Agent Agent used for Ticket functions
Declaration
public TicketAgent()
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
Methods
AddAttachments(Int32, Int32[])
Connect existing attachments with this TicketMessage. Can connect multiple attachments
Declaration
public void AddAttachments(int ticketMessageEntityId, int[] attachmentIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketMessageEntityId | The id of the ticket message to connect the attachments to |
Int32[] | attachmentIds | An array of attachments to connect to this TicketMessage |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
BatchForward(Int32[], String[], String[], String[], String, Boolean)
Forwards selected tickets to specified recipients. This method starts a batch task.
Declaration
public int BatchForward(int[] ticketIds, string[] to, string[] cc, string[] bcc, string comment, bool closeTicket)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | ticketIds | Ids of tickets to be forwarded. |
String[] | to | The To-recipients. Each recipient must be in correct mailbox format (john@example.com or John Doe <john@example.com>). |
String[] | cc | The Cc-recipients. Each recipient must be in correct mailbox format (john@example.com or John Doe <john@example.com>). |
String[] | bcc | The Bcc-recipients. Each recipient must be in correct mailbox format (john@example.com or John Doe <john@example.com>). |
String | comment | Comment will be included before ticket messages. Might be empty |
Boolean | closeTicket | If true, ticket will be closed after forwarding |
Returns
Type | Description |
---|---|
Int32 | ID of the new batch task. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
BatchReply(TicketBatchReplyData)
Replies to the specified tickets. This method starts a batch task.
Declaration
public int BatchReply(TicketBatchReplyData batchReplyData)
Parameters
Type | Name | Description |
---|---|---|
TicketBatchReplyData | batchReplyData | All data needed to initiate a mass ticket reply sending. |
Returns
Type | Description |
---|---|
Int32 | ID of the new batch task. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
CalculateMessageRecipients(Int32, MessageActionType, Int32)
Gets recipients for new message
Declaration
public Recipient[] CalculateMessageRecipients(int ticketId, MessageActionType actionType, int messageId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketId | The id of the ticket |
MessageActionType | actionType | Message action |
Int32 | messageId | Optional ID of message being replied. Value <= 0 ignores parameter |
Returns
Type | Description |
---|---|
Recipient[] | An array with Recipient objects |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
ClearNotify(Int32[])
Clear notification status for one or more tickets.
Declaration
public void ClearNotify(int[] ids)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | ids | List of notify IDs. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
CopyFromCRMDocument(Int32)
Copy CRM document to an attachment
Declaration
public AttachmentEntity CopyFromCRMDocument(int documentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId | The id of the document to copy to an attachment |
Returns
Type | Description |
---|---|
AttachmentEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
CopyToTempFile(String, Int32)
Copy ticket attachment to temporary file. Needed for existing document dialog compatibility
Declaration
public string CopyToTempFile(string filename, int attachmentId)
Parameters
Type | Name | Description |
---|---|---|
String | filename | Preferred filename |
Int32 | attachmentId | The id of the attachment to copy |
Returns
Type | Description |
---|---|
String | Temporary document filename |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
CreateDefaultAttachmentEntity()
Loading default values into a new AttachmentEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public AttachmentEntity CreateDefaultAttachmentEntity()
Returns
Type | Description |
---|---|
AttachmentEntity | New AttachmentEntity with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
CreateDefaultForTicketType(Int32)
Create default ticket entity for particular TicketType
Declaration
public TicketEntity CreateDefaultForTicketType(int ticketTypeId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketTypeId | ID of ticket type |
Returns
Type | Description |
---|---|
TicketEntity | Default ticket entity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
CreateDefaultTicketEntity()
Loading default values into a new TicketEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public TicketEntity CreateDefaultTicketEntity()
Returns
Type | Description |
---|---|
TicketEntity | New TicketEntity with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
CreateDefaultTicketMessageEntity()
Loading default values into a new TicketMessageEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public TicketMessageEntity CreateDefaultTicketMessageEntity()
Returns
Type | Description |
---|---|
TicketMessageEntity | New TicketMessageEntity with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
DeleteMessageHeaders(Int32[])
Removes headers from the message as specified in the collection of entity ids. The ids are message header ids (message header primary key)
Declaration
public void DeleteMessageHeaders(int[] headerIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | headerIds | Message header primary keys |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
DeleteTicketEntity(Int32)
Delete a ticket
Declaration
public void DeleteTicketEntity(int ticketEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketEntityId | The ticket to delete |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
DeleteTicketMessageEntity(Int32)
Delete a ticket message
Declaration
public void DeleteTicketMessageEntity(int ticketMessageEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketMessageEntityId | The ticket message to delete |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
DoEscalating(Int32, TicketPriorityEscalateAction)
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.
Declaration
public void DoEscalating(int ticketId, TicketPriorityEscalateAction action)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketId | The id of ticket |
TicketPriorityEscalateAction | action | The action to use when calculating the escalation |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetAttachmentEntity(Int32)
Gets a AttachmentEntity object.
Declaration
public AttachmentEntity GetAttachmentEntity(int attachmentEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | attachmentEntityId | The identifier of the AttachmentEntity object |
Returns
Type | Description |
---|---|
AttachmentEntity | AttachmentEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetAttachmentInfo(Int32)
Get a list with meta data for all attached attachments
Declaration
public AttachmentEntity[] GetAttachmentInfo(int ticketMessageEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketMessageEntityId | The id of the ticket message to get attachment infos for |
Returns
Type | Description |
---|---|
AttachmentEntity[] | An array with AttachmentEntity objects, describing each attachment |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetAttachmentInfoNonInline(Int32)
Get a list with meta data for all attached attachments, EXCEPT those marked as inline
Declaration
public AttachmentEntity[] GetAttachmentInfoNonInline(int ticketMessageEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketMessageEntityId | The id of the ticket message to get attachment infos for |
Returns
Type | Description |
---|---|
AttachmentEntity[] | An array with AttachmentEntity objects, describing each attachment; those marked as INLINE will be skipped |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetAttachmentPreview(Int32)
Retrieve an attachment from ticket message. The returned data is intended to be used for a preview. The returned data is sanitized.
Declaration
public AttachmentPreview GetAttachmentPreview(int attachmentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | attachmentId | The id of the attachment to retrieve |
Returns
Type | Description |
---|---|
AttachmentPreview | Sanitized preview version of the attachment and additional metadata, if available |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetAttachmentStream(Int32)
Get the content of an attachment
Declaration
public Stream GetAttachmentStream(int attachmentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | attachmentId | The id of the attachment to retrieve |
Returns
Type | Description |
---|---|
Stream | A stream to the attachment content |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetDefaultMessageContent(Int32, MessageActionType, Int32)
Obsolete, use GetDefaultMessageContentFull instead
Declaration
public string GetDefaultMessageContent(int ticketId, MessageActionType messageActionType, int ticketMessageId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketId | The id of the ticket |
MessageActionType | messageActionType | Message action type: None/Reply/ReplyAll/Forward |
Int32 | ticketMessageId | The id of the message to quote in the returned content. 0 to skip/ignore |
Returns
Type | Description |
---|---|
String | Sanitized HTML content |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetDefaultMessageContentFull(Int32, MessageActionType, Int32, Int32)
Generate a default message content: attachments and body as sanitized HTML
Declaration
public TicketMessageContent GetDefaultMessageContentFull(int ticketId, MessageActionType messageActionType, int ticketMessageId, int ticketTypeId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketId | The id of the ticket |
MessageActionType | messageActionType | Message action type: None/Reply/ReplyAll/Forward |
Int32 | ticketMessageId | The id of the message to quote in the returned content. 0 to skip/ignore |
Int32 | ticketTypeId | The id of the ticket type to look for reply template. 0 to use current ticket type |
Returns
Type | Description |
---|---|
TicketMessageContent | Generated default message content |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetDefaultMessageContentWithOptions(Int32, MessageActionType, Int32, Int32, Boolean)
Generate a default message content with option to exclude signature: attachments and body as sanitized HTML
Declaration
public TicketMessageContent GetDefaultMessageContentWithOptions(int ticketId, MessageActionType messageActionType, int ticketMessageId, int ticketTypeId, bool excludeSignature)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketId | The id of the ticket |
MessageActionType | messageActionType | Message action type: None/Reply/ReplyAll/Forward |
Int32 | ticketMessageId | The id of the message to quote in the returned content. 0 to skip/ignore |
Int32 | ticketTypeId | The id of the ticket type to look for reply template. 0 to use current ticket type |
Boolean | excludeSignature | Flag to exclude a signature when generating the return content |
Returns
Type | Description |
---|---|
TicketMessageContent | Generated default message content |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetForRmUi(Int32)
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
Declaration
public TicketEntity GetForRmUi(int ticketId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketId | Primary key of ticket to fetch |
Returns
Type | Description |
---|---|
TicketEntity | The ticket entity. Information is filtered/adapted to the current needs of the UI |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetHotlistEjUsers(Int32, Int32[], NotifyType, NotifyChannel)
Get a list of ej_user ids who should receive hotlist notification based on request and notification type
Declaration
public int[] GetHotlistEjUsers(int ticketId, int[] skipAssociateIds, NotifyType notifyType, NotifyChannel channel)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketId | The id of the ticket |
Int32[] | skipAssociateIds | A list of associate ids to skip when calculating whom to get the notification |
NotifyType | notifyType | The notification type we want to check for |
NotifyChannel | channel | The channel which we should check for |
Returns
Type | Description |
---|---|
Int32[] | List of matching ej_user ids |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetNextInQueue()
Assign a ticket to the caller based on intelligent queue system
Declaration
public TicketEntity GetNextInQueue()
Returns
Type | Description |
---|---|
TicketEntity | The ticket entity after assigning it to the caller |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetPreviewAttachmentStream(Int32)
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.
Declaration
public DocumentPreview GetPreviewAttachmentStream(int attachmentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | attachmentId | The id of the attachment to retrieve |
Returns
Type | Description |
---|---|
DocumentPreview | Sanitized preview version of the attachment |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetRfcAttachmentStream(Int32, Int32)
Get the content of an attachment which is part of RFC822 email attachment
Declaration
public Stream GetRfcAttachmentStream(int attachmentId, int position)
Parameters
Type | Name | Description |
---|---|---|
Int32 | attachmentId | The id of the root attachment |
Int32 | position | The position (index) of the attachment within the root attachment. Numbering starts from 0 |
Returns
Type | Description |
---|---|
Stream | RFC822 attachment content as a Stream |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetTicket(Int32)
Gets a Ticket object.
Declaration
public Ticket GetTicket(int ticketId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketId | The identifier of the Ticket object |
Returns
Type | Description |
---|---|
Ticket | Ticket |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetTicketAttachments(Int32)
Get attachment infos for all attachments connected to messages in specified ticket
Declaration
public AttachmentEntity[] GetTicketAttachments(int ticketEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketEntityId | The id of the ticket to get attachment infos from |
Returns
Type | Description |
---|---|
AttachmentEntity[] | An array containing attachment info objects for all the attachments |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetTicketEntity(Int32)
Gets a TicketEntity object.
Declaration
public TicketEntity GetTicketEntity(int ticketEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketEntityId | The identifier of the TicketEntity object |
Returns
Type | Description |
---|---|
TicketEntity | TicketEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetTicketMessage(Int32)
Gets a TicketMessage object.
Declaration
public TicketMessage GetTicketMessage(int ticketMessageId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketMessageId | The identifier of the TicketMessage object |
Returns
Type | Description |
---|---|
TicketMessage | TicketMessage |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetTicketMessageEntities(Int32, Int32[])
Get ticket message entities with attachment info for given ticket
Declaration
public TicketMessageEntity[] GetTicketMessageEntities(int ticketId, int[] messageIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketId | The id of the ticket to get message entities from |
Int32[] | messageIds | Optional ids of message entities to get. If not provided, all ticket message entities will be returned. |
Returns
Type | Description |
---|---|
TicketMessageEntity[] | An array containing ticket message entities |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetTicketMessageEntity(Int32)
Gets a TicketMessageEntity object.
Declaration
public TicketMessageEntity GetTicketMessageEntity(int ticketMessageEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketMessageEntityId | The identifier of the TicketMessageEntity object |
Returns
Type | Description |
---|---|
TicketMessageEntity | TicketMessageEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetTicketMessageWithEmbeddedData(Int32, ImageEmbedType)
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.
Declaration
public TicketMessageEntity GetTicketMessageWithEmbeddedData(int id, ImageEmbedType embedImages)
Parameters
Type | Name | Description |
---|---|---|
Int32 | id | The id of the ticket message entity |
ImageEmbedType | embedImages | 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. |
Returns
Type | Description |
---|---|
TicketMessageEntity | The entity to get |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetTicketMessageWithOptions(Int32, Boolean)
Get a ticket message entity with additional options.
Declaration
public TicketMessageEntity GetTicketMessageWithOptions(int ticketMessageEntityId, bool includeNonInlineAttachmentsInfo)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketMessageEntityId | The id of the ticket message entity |
Boolean | includeNonInlineAttachmentsInfo | If true, then non inline attachments info will be loaded into TicketMessageEntity |
Returns
Type | Description |
---|---|
TicketMessageEntity | The entity to get |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetTickets(Int32[])
Get multiple tickets
Declaration
public Ticket[] GetTickets(int[] ticketIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | ticketIds | The ids of tickets to get |
Returns
Type | Description |
---|---|
Ticket[] | Returns array of tickets in same order as input ids |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
GetTicketSummaries(Int32[])
Get an array of summaryitem for the given tickets
Declaration
public TicketSummaryItem[] GetTicketSummaries(int[] ticketIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | ticketIds | The tickets to fetch summaries for |
Returns
Type | Description |
---|---|
TicketSummaryItem[] | Summary items for the given id's, in no particular order |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
Html2Text(String)
Create a plain text version of the html, suitable for email
Declaration
public string Html2Text(string content)
Parameters
Type | Name | Description |
---|---|---|
String | content | The html version |
Returns
Type | Description |
---|---|
String | The plain text version |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
MergeTickets(TicketEntity, Int32[])
Merge one or more tickets into one primary ticket
Declaration
public TicketEntity MergeTickets(TicketEntity mergedTicketEntity, int[] secondaryTicketIds)
Parameters
Type | Name | Description |
---|---|---|
TicketEntity | mergedTicketEntity | Merged ticket entity |
Int32[] | secondaryTicketIds | Ids of secondary tickets |
Returns
Type | Description |
---|---|
TicketEntity | The newly merged entity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
NotifyNewTicket(Int32)
Notify user agents about the creation of a new ticket
Declaration
public void NotifyNewTicket(int ticketEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketEntityId | The id of the ticket to notify about |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
NotifyNewTicketMessage(Int32)
Notify user agents about the creation of a new message on a ticket
Declaration
public void NotifyNewTicketMessage(int ticketEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketEntityId | The id of the ticket to notify about |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
ProcessTicketWhenRead(Int32)
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
Declaration
public TicketEntity ProcessTicketWhenRead(int ticketEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketEntityId | The id of the ticket to mark as read |
Returns
Type | Description |
---|---|
TicketEntity | The ticket entity after marking it as read |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
RemoveMessageAttachments(Int32, Int32[])
Removes attachments from the message as specified in the collection of entity ids. The ids are attachment ids (attachment primary key)
Declaration
public void RemoveMessageAttachments(int ticketMessageEntityId, int[] attachmentIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketMessageEntityId | The id of the ticket message to remove attachments from |
Int32[] | attachmentIds | Attachment primary keys |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
ResolveTicketId(Int32)
Ticket can be connected (merged) to another ticket. This method traverses through its connection(s) and returns proper ticketId
Declaration
public int ResolveTicketId(int ticketId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketId | Potentially correct ticketId |
Returns
Type | Description |
---|---|
Int32 | Correct ticketId. Returns 0 in case ticket does not exists |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
SanitizeMailContent(String)
Remove harmful HTML tags and attributes from an email
Declaration
public string SanitizeMailContent(string content)
Parameters
Type | Name | Description |
---|---|---|
String | content | The email content to sanitize |
Returns
Type | Description |
---|---|
String | The sanitized email content |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
SanitizeMailContents(String[])
Remove harmful HTML tags and attributes from an email
Declaration
public string[] SanitizeMailContents(string[] contents)
Parameters
Type | Name | Description |
---|---|---|
String[] | contents | The email contents to sanitize |
Returns
Type | Description |
---|---|
String[] | The sanitized email contents |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
SanitizeMailContentWithOptions(String, HtmlSanitizerOptions)
Remove harmful HTML tags and attributes from an email, using specified options
Declaration
public string SanitizeMailContentWithOptions(string content, HtmlSanitizerOptions options)
Parameters
Type | Name | Description |
---|---|---|
String | content | The email content to sanitize |
HtmlSanitizerOptions | options | The options for the sanitizer engine |
Returns
Type | Description |
---|---|
String | The sanitized email content |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
SaveAttachmentEntity(AttachmentEntity)
Updates the existing AttachmentEntity or creates a new AttachmentEntity if the id parameter is empty
Declaration
public AttachmentEntity SaveAttachmentEntity(AttachmentEntity attachmentEntity)
Parameters
Type | Name | Description |
---|---|---|
AttachmentEntity | attachmentEntity | The AttachmentEntity that is saved. |
Returns
Type | Description |
---|---|
AttachmentEntity | New or updated AttachmentEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
SaveTicketEntity(TicketEntity)
Updates the existing TicketEntity or creates a new TicketEntity if the id parameter is empty
Declaration
public TicketEntity SaveTicketEntity(TicketEntity ticketEntity)
Parameters
Type | Name | Description |
---|---|---|
TicketEntity | ticketEntity | The TicketEntity that is saved. |
Returns
Type | Description |
---|---|
TicketEntity | New or updated TicketEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
SaveTicketEntityWithNotify(TicketEntity, Boolean)
Saves a ticket and performs any user notifications
Declaration
public TicketEntity SaveTicketEntityWithNotify(TicketEntity newEntity, bool notify)
Parameters
Type | Name | Description |
---|---|---|
TicketEntity | newEntity | The ticket to save |
Boolean | notify | If true, then the notifications will be sent |
Returns
Type | Description |
---|---|
TicketEntity | The newly saved entity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
SaveTicketMessageEntity(TicketMessageEntity)
Updates the existing TicketMessageEntity or creates a new TicketMessageEntity if the id parameter is empty
Declaration
public TicketMessageEntity SaveTicketMessageEntity(TicketMessageEntity ticketMessageEntity)
Parameters
Type | Name | Description |
---|---|---|
TicketMessageEntity | ticketMessageEntity | The TicketMessageEntity that is saved. |
Returns
Type | Description |
---|---|
TicketMessageEntity | New or updated TicketMessageEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
SaveTicketMessageEntityWithNotify(TicketMessageEntity, Boolean)
Saves a ticket message and performs any user notifications
Declaration
public TicketMessageEntity SaveTicketMessageEntityWithNotify(TicketMessageEntity newEntity, bool notify)
Parameters
Type | Name | Description |
---|---|---|
TicketMessageEntity | newEntity | The ticket message to save |
Boolean | notify | If true, then the notification will be sent along with the save |
Returns
Type | Description |
---|---|
TicketMessageEntity | The saved entity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
SaveTicketMessageEntityWithOptions(TicketMessageEntity, Boolean, Int32[], Boolean)
Saves a ticket message and performs additional actions
Declaration
public TicketMessageEntity SaveTicketMessageEntityWithOptions(TicketMessageEntity entity, bool notify, int[] attachmentIds, bool updateRepliedAt)
Parameters
Type | Name | Description |
---|---|---|
TicketMessageEntity | entity | The ticket message to save |
Boolean | notify | If true, then the notification will be sent along with the save |
Int32[] | attachmentIds | An array of attachments to connect to this TicketMessage |
Boolean | updateRepliedAt | Updates ticket's replied_at field if needed |
Returns
Type | Description |
---|---|
TicketMessageEntity | The saved entity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
SendTicketMessage(Int32, String[], String[], String[], String, Int32, String)
Send a message to recipients by email
Declaration
public void SendTicketMessage(int ticketMessageEntityId, string[] to, string[] cc, string[] bcc, string subject, int replyTemplateId, string gdprSource)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketMessageEntityId | The id of the ticket message to send |
String[] | to | The To-recipients. Each recipient must be in correct format |
String[] | cc | The Cc-recipients. Each recipient must be in correct format |
String[] | bcc | The Bcc-recipients. Each recipient must be in correct format |
String | subject | The subject |
Int32 | replyTemplateId | Optional ID of reply template to merge message with. <= 0 to skip. |
String | gdprSource | Obsolete |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
SendTicketMessageSms(Int32, Int32, String[])
Send a message to recipients by sms
Declaration
public void SendTicketMessageSms(int ticketMessageEntityId, int replyTemplateId, string[] sms)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketMessageEntityId | The id of the ticket message to send |
Int32 | replyTemplateId | Optional ID of reply template to merge message with. <= 0 to skip. |
String[] | sms | The Sms-recipients. Each recipient must be in correct format |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
SetDeletedStatusByIds(Int32[])
Sets tickets' status to Deleted. After a grace period these tickets will be deleted by a background job.
Declaration
public int[] SetDeletedStatusByIds(int[] ticketIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | ticketIds | Ids of tickets to be set for deletion. |
Returns
Type | Description |
---|---|
Int32[] | Ids of tickets set for deletion. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
SetDeletedStatusByProvider(String, ArchiveRestrictionInfo[])
Sets tickets' status to Deleted. After a grace period these tickets will be deleted by a background job.
Declaration
public int[] SetDeletedStatusByProvider(string providerName, ArchiveRestrictionInfo[] restrictions)
Parameters
Type | Name | Description |
---|---|---|
String | providerName | Name of the provider that returns ticket rows. |
ArchiveRestrictionInfo[] | restrictions | 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. |
Returns
Type | Description |
---|---|
Int32[] | Ids of tickets set for deletion. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
SetTicketMessageImportant(Int32, Boolean)
Set the important flag on or off for a ticket message
Declaration
public void SetTicketMessageImportant(int ticketMessageId, bool important)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketMessageId | The id of the ticket message to set the important flag on |
Boolean | important | Turn on or off the important flag |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
SetTicketReadByOwner(Int32, TicketReadStatus, Boolean)
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
Declaration
public TicketEntity SetTicketReadByOwner(int ticketEntityId, TicketReadStatus readStatus, bool checkEscalating)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ticketEntityId | The id of the ticket to set |
TicketReadStatus | readStatus | The read status to set. See the enum for explanation of the different colors. Setting Unknown does nothing |
Boolean | checkEscalating | If true, then the escalation system will be called and executed when setting the ReadByOwner |
Returns
Type | Description |
---|---|
TicketEntity | The ticket entity after setting the ReadByOwner |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
SplitTicket(Int32, Int32, DateTime, Int32[], TicketEntity)
Save new ticket and move/copy data from existing ticket in a single request. Specified messages will be moved.
Declaration
public TicketEntity SplitTicket(int sourceTicketEntityId, int sourceTicketEntityStatusId, DateTime sourceTicketEntityActivate, int[] transferMessageIds, TicketEntity newTicketEntity)
Parameters
Type | Name | Description |
---|---|---|
Int32 | sourceTicketEntityId | The id of the ticket to split |
Int32 | sourceTicketEntityStatusId | The id of the source ticket's status |
DateTime | sourceTicketEntityActivate | The activate date of the source ticket |
Int32[] | transferMessageIds | IDs of messages that should be transferred from the original ticket to the new one |
TicketEntity | newTicketEntity | The new ticket to save. Includes new values for simple properties like title, category, status, etc., but not messages. |
Returns
Type | Description |
---|---|
TicketEntity | The newly created entity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
SplitTicketMessage(TicketMessageEntity, TicketEntity, TicketMessageEntity, Int32[])
Create new ticket and move/copy data from existing ticket in addition update old message and save new message in a single request.
Declaration
public TicketEntity SplitTicketMessage(TicketMessageEntity sourceTicketMessage, TicketEntity newTicketEntity, TicketMessageEntity newTicketMessage, int[] transferAttachmentsIds)
Parameters
Type | Name | Description |
---|---|---|
TicketMessageEntity | sourceTicketMessage | The message being splitted, content can be modified as part of the split. |
TicketEntity | newTicketEntity | The new ticket to save. Includes new values for simple properties like title, category, status, etc., but not messages. |
TicketMessageEntity | newTicketMessage | The new message to be saved |
Int32[] | transferAttachmentsIds | IDs of attachments that should be transferred from the original message to the new one |
Returns
Type | Description |
---|---|
TicketEntity | The newly created entity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
UndeleteByIds(Int32[])
Restores deleted tickets by their ids. Status is set to a default open status defined in Registry table
Declaration
public void UndeleteByIds(int[] ticketIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | ticketIds | Ids of tickets to be restored. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
UpdateTicketsReadStatus(Int32[], TicketReadStatus)
This method changes multiple tickets' read status
Declaration
public int[] UpdateTicketsReadStatus(int[] ticketIds, TicketReadStatus newStatus)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | ticketIds | Ticket ids to be updated |
TicketReadStatus | newStatus | New read status |
Returns
Type | Description |
---|---|
Int32[] | Updated ticket ids |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
UpdateTicketsReadStatusByProvider(String, ArchiveRestrictionInfo[], TicketReadStatus)
This method changes multiple tickets' read status
Declaration
public int[] UpdateTicketsReadStatusByProvider(string provider, ArchiveRestrictionInfo[] restrictions, TicketReadStatus newStatus)
Parameters
Type | Name | Description |
---|---|---|
String | provider | Name of the provider that returns ticket rows. |
ArchiveRestrictionInfo[] | restrictions | 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. |
TicketReadStatus | newStatus | New read status |
Returns
Type | Description |
---|---|
Int32[] | Updated ticket ids |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
UploadAttachment(Int32, Stream)
Upload the content for an attachment
Declaration
public void UploadAttachment(int attachmentId, Stream content)
Parameters
Type | Name | Description |
---|---|---|
Int32 | attachmentId | The id of the attachment row, for which to attach the upload data |
Stream | content | A stream to the content to be uploaded |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}
ValidateAttachments(Int32[])
Check attachments, return validation result for each item
Declaration
public AttachmentValidationResult[] ValidateAttachments(int[] attachmentIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | attachmentIds | The IDs of the attachments to validate |
Returns
Type | Description |
---|---|
AttachmentValidationResult[] | Validation result |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TicketAgent agent = new TicketAgent())
{
// call methods on agent here...
}
}