Mime Automation (Independent Publisher) v1.1 (#3396)

* added new function to v1.1

* fixed v1.1 Swagger and Change Validation error

---------

Co-authored-by: Andreas Cieslik <andreas.cieslik@karcher.com>
This commit is contained in:
Andreas Cieslik 2024-06-13 11:58:00 +02:00 коммит произвёл GitHub
Родитель 0a683a6454
Коммит ce6ab351a0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 148 добавлений и 22 удалений

Просмотреть файл

@ -2,14 +2,14 @@
"swagger": "2.0",
"info": {
"title": "Mime Automation",
"version": "1.0",
"description": "Mime Automation provides a way to extract data from a TNEF (winmail.dat) encoded file",
"version": "1.1",
"description": "Mime Automation provides a way to extract data from a TNEF (winmail.dat) or EML base64-encoded file",
"contact": {
"name": "Andreas Cieslik",
"email": "acieslik@accloudsolutions.com"
}
},
"host": "accloudsolutions.c1-eu-nmbg-hz.projectx.biz",
"host": "accloudsolutions.p.nadles.com",
"basePath": "/",
"schemes": [
"https"
@ -52,6 +52,42 @@
"description": "Extracts attachments in Base64 format from a Base64-encoded TNEF file string",
"summary": "Extract files from a TNEF-encoded file"
}
},
"/MimeAutomation/ExtractFilesFromEml": {
"post": {
"tags": [
"MimeAutomation"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"in": "body",
"name": "body",
"schema": {
"$ref": "#/definitions/InputFile"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/MimeAttachment"
}
}
}
},
"summary": "Extract files from a base64-encoded EML file",
"description": "Extracts attachments in Base64 format from a Base64-encoded EML file string",
"operationId": "ExtractFilesFromEml"
}
}
},
"definitions": {
@ -71,6 +107,40 @@
},
"additionalProperties": false
},
"InputFile": {
"required": [
"content"
],
"type": "object",
"properties": {
"content": {
"minLength": 1,
"type": "string",
"description": "Base-64-encoded string of an EML file",
"title": "Content"
}
}
},
"MimeAttachment": {
"type": "object",
"properties": {
"fileName": {
"type": "string",
"description": "File name with extension",
"title": "File Name"
},
"mimeType": {
"type": "string",
"description": "Content or media type (e.g. image/png)",
"title": "Mime Type"
},
"content": {
"type": "string",
"description": "Base-64 encoded string of the attachement file",
"title": "Content"
}
}
},
"TnefFile": {
"required": [
"content"
@ -78,6 +148,7 @@
"type": "object",
"properties": {
"content": {
"minLength": 1,
"type": "string",
"description": "Base-64-encoded string of a TNEF file (e.g. winmail.dat)",
"title": "Content"

Просмотреть файл

@ -1,5 +1,5 @@
# Mime Automation
The Mime Automation connector helps you to extract attachments in a Base-64 formated string together with its file name, which is originating from a Base-64-encoded TNEF file string.
The Mime Automation connector helps you to extract attachments in a Base-64 formated string together with its file name, which is originating from a Base-64-encoded TNEF or EML file string.
## Publisher: Publisher's Name
Andreas Cieslik, AC Cloud Solutions
@ -10,26 +10,38 @@ Required. Any plans or licenses, tools required from the connector.
## Supported Operations
### Extract files from a TNEF-encoded file
For the "Content" parameter you need to provide a Base64-encoded TNEF file string.
The API service will then extract existing files in an JSON array with file name and content parameters.
The API service will then extract existing files in an JSON array with file name, mime type and content parameters.
The content will also be a base-64 encoded string of the actual file.
### Extract files from a EML-encoded file
For the "Content" parameter you need to provide a Base64-encoded EML file string.
The API service will then extract existing files in an JSON array with file name, mime type and content parameters.
The content will also be a base-64 encoded string of the actual file.
## Obtaining Credentials
Please go this web site and subscribe to the required plan:
https://www.accloudsolutions.com/products/apis/tnef-attachment-extractor
Please go this web site and subscribe to the required plan in the Products => APIs section:
https://www.accloudsolutions.com
Once you have signed up and subscribed to a plan you will get an API key in your portal overview.
When you use this connector you need to provide that API key for the connection to be configured.
## Getting Started
### TNEF Attachment Extraction
Transport Neutral Encapsulation Format or TNEF is a proprietary email attachment format used by Microsoft Outlook and Microsoft Exchange Server. An attached file with TNEF encoding is most often named winmail.dat or win.dat, and has a MIME type of Application/MS-TNEF. The official (IANA) media type, however, is application/vnd.ms-tnef.
This API endpoint expects in the request body a JSON with a "content" property
Use case:
Some email clients or third party applications that receive emails cannot interpret the TNEF-encoded file that comes from users that are using Microsoft Outlook as their main email client to send their emails with having the TNEF feature activated. With a custom implementation /business process flow that is using our API it would be still possible to parse out and extract the attachted documents in order to store these files on your client or in your third party application.
More information on how Microsoft Outlook can be configured in this regard here:
https://support.microsoft.com/en-us/topic/how-email-message-formats-affect-internet-email-messages-in-outlook-3b2c0536-c1c0-1d68-19f0-8cae13c26722
This API endpoint expects in the request body a JSON with a "content" property
```json
{
content: "BASE-64 encoded string of a TNEF file"
}
```
For quick testing you can convert your winmail.dat (TNEF encoded file) into a base-64 encoded string with online converter:
https://base64.guru/converter/encode/file
@ -39,24 +51,67 @@ Otherwise you need to implement this conversion logic in your client prior to ca
As a result this endpoint will return base-64 encoded files and its original file names.
The result schema will be like this:
{
fileName:"mypicture.jpg"
content:"/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAAA/+4AJkFkb2JlAGTAAAAAAQMAFQQDBgoNAAADiAAABUwAAAfnAAALd//bAI...",
fileName:"readme.txt"
content:"/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAAA/+4AJkFkb2JlAGTAAAAAAQMAFQQDBgoNAAADiAAABUwAAAfnAAALd//bAI..."
}
```json
[
{
fileName:"mypicture.jpg",
content:"/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAAA/+4AJkFkb2JlAGTAAAAAAQMAFQQDBgoNAAADiAAABUwAAAfnAAALd//bAI..."
},
{
fileName:"readme.txt",
content:"/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAAA/+4AJkFkb2JlAGTAAAAAAQMAFQQDBgoNAAADiAAABUwAAAfnAAALd//bAI..."
}
]
```
To quickly check and convert the result base-64 strings back you could also use this online converter tool:
https://base64.guru/converter/decode/file
Use case:
Some email clients or third party applications that receive emails cannot interpret the TNEF-encoded file that comes from users that are using Microsoft Outlook as their main email client to send their emails with having the TNEF feature activated. With a custom implementation /business process flow that is using our API it would be still possible to parse out and extract the attachted documents in order to store these files on your client or in your third party application.
### EML Attachment Extraction
Use case
In your business your receive eml files and you want to implement an automation process to automatically process any email attached file(s) for further business logics or for archiving purposes. Then this is the right API for you.
What is the EML file format?
The EML file format is a common file type used for storing email messages. EML stands for "Electronic Mail" and it is a file format typically associated with email clients and systems. It contains the complete content of an email, including the sender and recipient information, subject, message body, attachments, and any other relevant metadata. EML files are usually plain text files with a specific structure that allows them to be easily parsed and interpreted by email applications. They can be opened and viewed by various email clients or imported into different email programs for further use or archiving purposes.
Sample request schema:
This API endpoint expects in the request body a JSON with a "content" property
```json
{
content: "BASE-64 encoded string of an EML file"
}
```
For quick testing you can convert your *.eml file into a base-64 encoded string with an online converter:
https://base64.guru/converter/encode/file
Otherwise you need to implement this conversion logic in your client prior to calling this API endpoint.
In Microsoft's PowerAutomate or FX either you will get the file content already in base64 or there are functions for conversion available.
As a result this endpoint will return base-64 encoded files and its original file names and the mime (file) type.
Sample result schema:
```json
[
{
fileName:"mypicture.jpg",
mimeType:"image/jpeg",
content:"/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAAA/+4AJkFkb2JlAGTAAAAAAQMAFQQDBgoNAAADiAAABUwAAAfnAAALd//bAI…",
},
{
fileName:"readme.txt",
mimeType:"text/plain",
content:"/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAAA/+4AJkFkb2JlAGTAAAAAAQMAFQQDBgoNAAADiAAABUwAAAfnAAALd//bAI…"
}
]
```
To quickly check and convert the result base-64 strings back you could also use this online converter tool:
https://base64.guru/converter/decode/file
More information on how Microsoft Outlook can be configured in this regard here:
https://support.microsoft.com/en-us/topic/how-email-message-formats-affect-internet-email-messages-in-outlook-3b2c0536-c1c0-1d68-19f0-8cae13c26722
## Known Issues and Limitations
There are no known issues at this time.