Rajkapoor Mohamed
Rajkapoor Mohamed

Reputation: 31

How to create a mirth channel utilizing rest API.

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..

Upvotes: 3

Views: 7212

Answers (2)

agermano
agermano

Reputation: 1719

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.

Upvotes: 0

Daniel Elkington
Daniel Elkington

Reputation: 3637

If you want to send messages to a REST API, you can use the HTTP Sender destination connector type. Setting up HTTP Sender Mirth Destination

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}.

How to configure a destination to send the message's transformed data.

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. Sending messages using FTP

Upvotes: 4

Related Questions