What is a working minimal example of POST /channelgroups/_bulkUpdate in Mirth REST API?

1.4k views Asked by At

In the Mirth REST API found on EG https://localhost:8443/api/, under Channel Groups, there's a test section for bulkUpdate, which has two parameters: channelGroups, and removedChannelGroupIds. By default I set override to true.

Despite passing channelGroups and the ID list in various formats (EG as a channelGroup XML object, list of channels, list of channelGroups etc) Mirth rejects those formats and I have no idea what format Mirth is after. Leaving either field blank also fails. Does anyone have an example of a minimal working dataset for both fields that will return success from Mirth when calling bulkUpdate?

Mirth version is 3.6.0, but ideally it should also work in 3.5.1 for legacy devices.

2

There are 2 answers

0
Frank Parth On

It also seems to be failing to create the channels within the channel group.

0
agermano On

This was answered on the user forum https://www.mirthcorp.com/community/forums/showthread.php?t=218606

That route actually expects multipart/form-data. So for example you could send a request with "Content-Type: multipart/form-data; boundary=abc123" and a payload like:

--abc123
Content-Type: application/xml; charset=utf8
Content-Disposition: form-data; name="channelGroups"

<set>
  <channelGroup version="3.6.1">
    <id>56a61dfb-58df-4286-8100-5ccab05364ba</id>
    <name>Group 1</name>
    <revision>1</revision>
    <lastModified>
      <time>1537550138646</time>
      <timezone>UTC</timezone>
    </lastModified>
    <description></description>
    <channels/>
  </channelGroup>
</set>
--abc123
Content-Type: application/xml; charset=utf8
Content-Disposition: form-data; name="removedChannelGroupIds"

<set/>
--abc123--

As of mirth 3.6, it is not possible to call this API function from the SwaggerUI.