I want export channel messages to ftp server or external drive. I thing we can export messages via rest API. Could you any one help on this..
-
Thanks for your update.I have created a separate channel and I can able to send mirth logs to the external drive which is FTP server using file writer connection type(destination) Now I want to export channel messages ( particularly one or more channel) to an external drive using Rest API. I can able to access the rest API interface(https://10.X.X.X:8443/api), and there selected endpoint /channels/{channelId}/messages/_export to export messages. but got the Unsupported Media Type (415). I do not know proper steps to make automate this job. now I hope you got a picture. – Rajkapoor Mohamed Nov 23 '18 at 08:50
2 Answers
If you want to send messages to a REST API, you can use the HTTP Sender
destination connector type.
If your REST API Endpoint requires any special headers or authentication, you will need to configure this appropriately (such as by setting variables in the Destination Transformer). Don't forget to put something in the "Content" box at the bottom of the screen - this usually has a value such as ${message.transformedData}
or ${message.rawData}
.
If you want to send messages to an FTP server, you can use the File Writer
destination connector type. Again, make sure you put something such as ${message.transformedData}
in the "Template" field.

- 2,560
- 6
- 22
- 35
The POST /channels/{channelId}/messages/_export
endpoint is to export messages to files on the server filesystem. When the client does an export to the local file system, it basically writes the results of GET /channels/{channelId}/messages
with one file per message and attachments included. See Source.
Possibly the most effective way to get all your processed messages offsite is to just take a database backup.
The data pruner also has an option to archive messages to disk as they are pruned, and those files could be picked up and sent offsite if desired.

- 1,679
- 6
- 16