AttachmentInput value object

The attachment input value object includes the following fields.

  • name—Required name field, with a maximum length of 255 characters.
  • description—Optional description, with a maximum length of 2000 characters. If the attachment type is NOTE, the description field is required and contains the note text.
  • source—Required brief name of the source, such as "Cases," with a maximum length of 2000 characters.
  • sourceText—Required brief information about the attachment, with a maximum length of 2000 characters. This text is application-dependent and the field supports HTML tags, such as <br> and <table><tr><td> and font formatting tags. This might contain metadata to display to the user about the attachment such as the number of cases.

    It is displayed in the tooltip for values in the Attachment name column in the Topic or Action Attachments table when viewing or editing a topic. The text is limited to 500 characters by Internet Explorer.

If the notes field is not specified, then the sourceText is also displayed in the View Source Details dialog box. The dialog box is displayed when the user selects View Source Details for an attachment type.

  • type—Required attachment type of IMAGE, FILE, TABLE, NOTE, or URL. The SIGNAL type is reserved.
  • extension—Name of the extension, with a maximum length of 40 characters. This is required if the attachment type is FILE. If the type is IMAGE, a ZIP file extension is required and the zip file contains JPG, PEG, PNG, or GIF images, optional *.txt files with strings such as section headers, and optional notes*.txt files.
  • notes—Optional details that contain an encapsulated HTML <table> tag for notes. Notes are more detailed and can be much longer than the sourceText field since they are displayed in a scrollable window and not in a tooltip.

    If specified, the notes field is displayed in the View Source Details dialog box when selecting View Source Details for an attachment in the Topic or Action Attachments table. If the notes field is not specified, then the sourceText field value is displayed in the View Source Details dialog box. This field can be formatted with HTML tags, such as formatting as an HTML table and setting the font style for the text.

    The notes field is different from the notes shown by selecting the Show Notes link above a TABLE. The optional notes on a TABLE are part of the XML that is streamed with the attachment. This notes field is also different from the notes in IMAGE attachments, where any notes*.txt files in the IMAGE zip file are always displayed along with image files in the attachment.
  • dataHandler—Used by Java clients to stream data. The DataHandler is a MTOM (W3C Message Transmission Optimization Mechanism) for streaming data to transfer large amounts of data. It can be used for large or binary files.

    For .NET, the dataHandler variable is not used and you should call the streamFileAttachment method to stream your attachment.

  • guid—Used by .NET clients when streaming data. The guid uniquely identifies the attachment across two method calls, the first to stream the attachment and then the second to attach to a topic or action.
  • urlAddress—If the attachment type is URL, the urlAddress contains the URL field. It must be in the form http[s]://xxx[port][/yyy]. The maximum length is 2000.
  • data—If the attachment type is FILE, the data field must be specified with a filename including the extension. This field is required for FILE types and is used when creating a PDF of the topic with the attachment. The attachment is displayed as a link in the PDF with the filename from the data field.
    class AttachmentInput {
     String name;
     String description;
     String source;
     String sourceText;
     AttachmentType type;
     String extension;
     String notes;
     String data;
     DataHandler dataHandler;
     String guid;
     String urlAddress;
    }
    enum AttachmentType {
     NOTE, IMAGE, FILE, URL, SIGNAL, TABLE
    }