Announcement

Collapse
No announcement yet.

Mirth Connect Client API

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mirth Connect Client API

    I am trying to the Mirth Connect Client API.

    I am able to login, retrieve message information from a specific channel, process the result and logout.

    I am struggling to remove a message from the channel via the API.

    From the Swagger UI testing I am trying to use

    DELETE /messages with the proper channelId, and the values of the MessageId in the minMessageId and maxMessageId and a Statues of "RECIEVED"

    Code:
    curl -X DELETE --header 'Accept: application/xml' 'https://myhost:8443/api/channels/9496af7a-f5e0-4093-b465-89b9f428ece8/messages?minMessageId=1316140&maxMessageId=1316140&status=RECEIVED'
    
    https://myhost:8443/api/channels/9496af7a-f5e0-4093-b465-89b9f428ece8/messages?minMessageId=1316140&maxMessageId=1316140&status=RECEIVED
    I receive a 204 response, the message is not removed from the channel.

    I have also tried this method
    Code:
    curl -X POST --header 'Content-Type: application/xml' --header 'Accept: text/html' -d '{"maxMessageId": 1316140, "minMessageId":1316140,"statuses": ["RECEIVED"]}' 'https://myhost:8443/api/channels/9496af7a-f5e0-4093-b465-89b9f428ece8/messages/_remove'
    
    https://myhost:8443/api/channels/9496af7a-f5e0-4093-b465-89b9f428ece8/messages/_remove
    This returns a 500 error.


    I have tried this method
    Code:
    curl -X DELETE --header 'Accept: application/xml' 'https://myhost:8443/api/channels/9496af7a-f5e0-4093-b465-89b9f428ece8/messages/1316140'
    
    https://myhost:8443/api/channels/9496af7a-f5e0-4093-b465-89b9f428ece8/messages/1316140
    This returns a 204.


    This method returns the specific message
    Code:
    curl -X GET --header 'Accept: application/xml' 'https://myhost:8443/api/channels/9496af7a-f5e0-4093-b465-89b9f428ece8/messages/1316140'
    
    https://myhost:8443/api/channels/9496af7a-f5e0-4093-b465-89b9f428ece8/messages/1316140

    How do you remove 1 message from the channel?

    What do I have borked up?

    Thanks for the help.

  • #2
    http://www.mirthcorp.com/community/i...wse/MIRTH-4136 seems related, but that ticket suggests returning message IDs instead of a 204 as information during a PUT. What you're describing seems to be a bug because you're issuing a DELETE but not seeing the message deleted.
    Jon Bartels

    Zen is hiring!!!!
    http://consultzen.com/careers/
    Talented healthcare IT professionals wanted. Engineers to sales to management.
    Good benefits, great working environment, genuinely interesting work.

    Comment


    • #3
      After further testing, it appears that the Client API does not support the deleting of messages in a 'RECEIVED' Status.

      All other methods appear to function as designed on messages in a 'RECEIVED' Status.

      Is this by design or a bug?

      Comment


      • #4
        Originally posted by MaxNeb View Post
        After further testing, it appears that the Client API does not support the deleting of messages in a 'RECEIVED' Status.

        All other methods appear to function as designed on messages in a 'RECEIVED' Status.

        Is this by design or a bug?
        This is by design and is the same as how message deletion works in the Administrator UI:



        To remove unfinished messages (including those in the RECEIVED state), you first need to stop the channel.
        Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

        Nicholas Rupley
        Work: 949-237-6069
        Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


        - How do I foo?
        - You just bar.

        Comment

        Working...
        X