Attachment Utilities
the attachment utilities connector provides a suite of tools for file conversion and data extraction, facilitating seamless data manipulation and enrichment within the swimlane ecosystem the attachment utilities connector is an essential tool for data transformation and extraction within the swimlane turbine platform it enables users to convert attachments to base64 or plain text, download files from urls, extract images and text from various file types, and transform spreadsheet data into json format this integration streamlines the processing of diverse file types and content, enhancing the capabilities of security workflows by automating the extraction and conversion of critical data users benefit from increased efficiency and accuracy in data handling, which is crucial for timely and effective security analysis and response prerequisites capabilities the attachment utils connector has the following capabilities convert a base64 string to an attachment type convert an attachment to text convert an attachment to base64 download file from url extract text from image (ocr) extract images from an html file extract images from a url xlsx and csv to json action setup extract text from image (ocr) page segmentation mode values 0 orientation and script detection (osd) only 1 automatic page segmentation with osd 2 automatic page segmentation, but no osd, or ocr (not implemented) 3 fully automatic page segmentation, but no osd (default) 4 assume a single column of text of variable sizes 5 assume a single uniform block of vertically aligned text 6 assume a single uniform block of text 7 treat the image as a single text line 8 treat the image as a single word 9 treat the image as a single word in a circle 10 treat the image as a single character 11 sparse text find as much text as possible in no particular order 12 sparse text with osd 13 raw line treat the image as a single text line, bypassing hacks that are tesseract specific ocr engine mode values 0 legacy engine only 1 neural nets lstm engine only 2 legacy + lstm engines 3 default, based on what is available action limitation extract images from html this action can extract images from a html file only if full paths are available to image sources (i e , something like http //\<base url>/\<path to image>) actions attachment to base64 converts an attachment to a base64 encoded string, requiring the 'attachments' input for processing endpoint method get input argument name type required description attachments array required file to be uploaded attachments file string optional parameter for attachment to base64 attachments file name string optional name of the resource attachments description string optional parameter for attachment to base64 input example {"attachments" \[{"file" "string","file name" "example name","description" "string"}]} output parameter type description filename string filename base64 string base64 string output example {"filename" "string","base64" "string"} attachment to text converts attachments into plain text for content analysis and processing within the swimlane platform, requiring an 'attachments' input endpoint method get input argument name type required description attachments array required file to be uploaded attachments file string optional parameter for attachment to text attachments file name string optional name of the resource attachments description string optional parameter for attachment to text input example {"attachments" \[{"file" "string","file name" "example name","description" "string"}]} output parameter type description filename string filename text string text output example {"filename" "string","text" "string"} base64 to attachment converts a base64 encoded string into an attachment file within the attachment utilities service endpoint method get input argument name type required description filename string optional filename base64 string optional base64 encoded file input example {"filename" "example name","base64" "string"} output parameter type description file object attachments file file string output field file file file file name string name of the resource output example {"file" {"file" "string","file name" "example name"}} download file from url downloads a file from a specified url for subsequent processing within the swimlane platform; requires the url as input endpoint method get input argument name type required description url string required url endpoint for the request file name string optional the name of the file to be downloaded if not provided, a default name will be used verify ssl boolean optional verify ssl certificate http proxy string optional a proxy to route requests through input example {"url" "https //example com/api/resource","file name" "example name","verify ssl"\ true,"http proxy" "string"} output parameter type description file object attachments file file string output field file file file file name string name of the resource output example {"file" {"file" "string","file name" "example name"}} extract images from html file extracts images from an html file and prepares them for analysis and storage, with 'attachments' as a required input endpoint method get input argument name type required description attachments array required file to be uploaded attachments file string optional parameter for extract images from html file attachments file name string optional name of the resource attachments description string optional parameter for extract images from html file verify ssl boolean optional verify ssl certificate http proxy string optional a proxy to route requests through input example {"attachments" \[{"file" "string","file name" "example name","description" "string"}],"verify ssl"\ true,"http proxy" "string"} output parameter type description file array extracted images file file string output field file file file file name string name of the resource output example {"file" \[]} extract images from url retrieve all images from the html content of a specified url for efficient extraction and analysis endpoint method get input argument name type required description url string required url endpoint for the request verify ssl boolean optional verify ssl certificate http proxy string optional a proxy to route requests through input example {"url" "https //example com/api/resource","verify ssl"\ true,"http proxy" "string"} output parameter type description file array extracted images file file string output field file file file file name string name of the resource output example {"file" \[]} extract text from image (ocr) extracts text from an image file attachment, enabling analysis or further processing within attachment utilities endpoint method get input argument name type required description attachments array required file to be uploaded attachments file string optional parameter for extract text from image (ocr) attachments file name string optional name of the resource attachments description string optional parameter for extract text from image (ocr) languages array optional languags of the text to be extracted default eng psm number optional control the automatic page segmentation mode used by tesseract oem number optional controls the type of algorithm used by tesseract timeout number optional duration in seconds for the ocr processing, after which, pytesseract will terminate and raise runtimeerror nice number optional modifies the processor priority for the tesseract run nice adjusts the niceness of unix like processes input example {"attachments" \[{"file" "string","file name" "example name","description" "string"}],"languages" \["string"],"psm" 123,"oem" 123,"timeout" 123,"nice" 123} output parameter type description filename string name of the resource extracted text string output field extracted text output example {"filename" "string","extracted text" "string"} xlsx and csv to json transforms xlsx and csv file attachments into json format, enabling easier data manipulation and integration with other services endpoint method get input argument name type required description attachments array required file to be uploaded attachments file string optional parameter for xlsx and csv to json attachments file name string optional name of the resource attachments description string optional parameter for xlsx and csv to json input example {"attachments" \[{"file" "string","file name" "example name","description" "string"}]} output parameter type description json array output field json output example {"json" \[]} response headers header description example content type the media type of the resource application/json date the date and time at which the message was originated thu, 01 jan 2024 00 00 00 gmt