How to connect CommCareHQ to a REST endpoint

Thanks for reaching out! Set up “form forwarding” in CommCareHQ and specify JSON, using your OpenFn inbox URL as the target: https://confluence.dimagi.com/pages/viewpage.action?pageId=12224128

Next, create a message-filter trigger like this: http://openfn.github.io/docs/documentation/#match-a-message-with-a-fragment-inside-another-object-called-form (You want to run some job whenever a message matching that CommCare formID shows up.)

Your job should use the language-http adaptor, and probably an expression like this to make a POST to your REST endpoint: https://github.com/OpenFn/language-http#sample-post-with-existing-data

Turn on the job and submit some data in CommCare. You should see it run on OpenFn instantly. Check out the logs to determine what changes need to be made to your expression and then retry whatever runs you’d like until it works as desired.

Let me know if you need anything else. I’ve added this thread to our Google Group (after removing your name and email) because it will be incredibly helpful to others. If you’re keen, post in that group as a follow-up. Thanks so much.

Updated docs here: https://openfn.github.io/docs/source-applications/#commcare-hq