Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

Receiving Webhooks

In order for MifosX to send webhook payloads, your server needs to be accessible from the Internet.

MifosX will send the response of the event as the request body (in the requested format - json/ x-www-url-formencoded).

For example :-

A successful POST to /clients endpoint will generate the response {"officeId":1,"clientId":1787,"resourceId":1787}.

An action like pay charge (https://demo.openmf.org/mifosng-provider/api/v1/savingsaccounts/382/charges/241?command=paycharge) will generate the response {"officeId":187,"clientId":7,"savingsId":382,"resourceId":241}.

See the fields in https://github.com/openMF/mifosx/blob/develop/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/data/CommandProcessingResult.java.

Along with that MifosX will send the following headers.

Webhook Headers

MifosX will send along a few HTTP headers to differentiate between event types.

NameDescription
X-Mifos-EntityThe entity type that was triggered.
X-Mifos-ActionThe action triggered on the entity type.
X-Mifos-Platform-TenantId

The tenant which experienced the event.

The bridge / third-party app is expected to authenticate with the MifosX server first and send the auth token along with each request to fetch additional information such as client's mobile number or account number.

See /hooks/template response (groupings array inside the json) or the m_permission table (other than special, read and checker permissions) to find a list of all available combinations of Entity and Action.

List hooks

 https://demo.openmf.org/api-docs/apiLive.htm#configs_hooks_retrieve

Create a hook

 https://demo.openmf.org/api-docs/apiLive.htm#configs_hooks_create

Update a hook

 https://demo.openmf.org/api-docs/apiLive.htm#configs_hook_update

Delete a hook

https://demo.openmf.org/api-docs/apiLive.htm#configs_hook_delete

Get Template

 https://demo.openmf.org/api-docs/apiLive.htm#hooks_template

UML Diagram

 

ER Diagram

 

  • No labels