POST request with outbound

Hi all,

I was trying to integrate other services e.g. DHIS2 with CHT and for that I was thinking about using openHIM. I defined an outbound (after setting mark_for_outbound true) with the url & auth but from the logs of the mediator & platform, it seems like it is performing a GET request. Is there a way to change this to a POST?

Hi @magp18

From what I can tell from the code, the request is already a POST: cht-core/outbound.js at master · medic/cht-core · GitHub

Can you please share logs, or some indication that the request is a GET?
Thanks!

@magp18 - Seconding what @diana mentioned, I found it to be a POST while I was exploring what an OpenHIM integration might look like in our CHIS-Interoperability repo.

Speaking of which, while this code is very nascent (and entirely lacking ;s !?), it may be helpful, along with our recently update documentation, about how to approach an OpenHIM integration.

Let us know how it goes!

Hi @diana,

This is from medic-sentinel (CHT is running on docker). I was assuming it was a GET because of the OpenHIM platform (but seems something went wrong before?)


Now it’s not triggering the Mediator anymore

And the request body was empty somehow. Let me know what other logs are of interest.

Will have a look on this thanks! And sure will gladly update you on the integration with openHIM:)

Hi @magp18

I don’t think CHT would make any request if payload mapping failed. Can you please have a look at your outbound configuration and make sure that it follows the documentation? The error would suggest that the mapping property is not set. .outbound | Community Health Toolkit

1 Like

Yes you are right, I didn’t realize the mapping property was required, thought I could send the raw data like this directly.

After adding this property I am getting a failed to push error, certificate has expired. Although my certificates seem to be valid.

The CHT doesn’t do certificate validation. Can you try making a request to your integration server from the server that hosts CHT API and check if the request goes through?

Thanks for the reply @diana and sorry for the late reply. But yes I think you are right, using 5001 works for me (I have a different error - ESOCKETTIMEOUT) but I think that’s related to my openHIM mapping (there might be an error). I am trying to get it right and will let you know. Thanks anyhow