1

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.

SE Does Not Like Dissent
  • 1,767
  • 3
  • 16
  • 36
  • Some source code references that might help are: com.mirth.connect.server.controllers.DefaultChannelController#updateChannelGroups (this is where the real work is done), com.mirth.connect.server.api.servlets.ChannelGroupServlet#updateChannelGroups (just an intermediate call), com.mirth.connect.client.core.api.servlets.ChannelGroupServletInterface#updateChannelGroups (the actual interface definition, this is used by the build tools to generate swagger). This is not a complete answer but the raw source may help determine what formats are needed. – Freiheit Sep 24 '18 at 19:56
  • Do you get any specific errors from the calls you have attempted? – Freiheit Sep 24 '18 at 19:57

2 Answers2

1

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.

agermano
  • 1,679
  • 6
  • 16
0

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