Webhooks - a Quick Introduction
You can use webhooks integration in MFTG to send you a notification for following scenarios :
- Your station sends a message to a partner
- The station receives a message from a partner
- Message sent failed to a partner.
This notification is sent over HTTPS network protocol.
This is very convenient in comparison to other mechanisms for checking incoming data (such as API, S3 or SFTP), because:
- you do not have to repeatedly poll MFTG for new data (like the API endpoint, or the SFTP inbox) - in other words, your system can stay passive while MFTG will actively push data to it
- When polling, your system would need to keep on communicating, even when there is no new data. But there is no such redundancy when using Webhook as every webhook event corresponds to an actual receive.
- Usually within a matter of seconds you are automatically notified of incoming messages. This will increase the speed of your system
- you can use the webhook endpoint to fire/initiate your own custom workflows.
How MFT Gateway Webhooks Work
- You create and deploy a webhook (a simple HTTP endpoint / request handler) that can handle the notification data posted by MFT Gateway.
- Then add a webhook configuration entry on MFT Gateway side, pointing to the above URL.
- When a new AS2 message is received, sent or outgoing message failed MFTG Gateway automatically sends a HTTP POST request to your endpoint, containing details of the received, sent or failed message.
- Your handler processes the received details in the posted data, and decides on the next action - such as fetching the message content (files/attachments) or simply passing along the AS2 message ID to the next component in your order-processing pipeline.
For HTTPS webhook endpoints, additional steps may be required if the TLS certificate is not trusted (i.e. if the certificate is self-signed or issued by an untrusted party).
Webhook requests are best-effort, and currently do not offer guaranteed delivery (i.e. are not automatically retried) and neither manual retries; if your endpoint fails due to some reason, MFT Gateway will not invoke the webhook again for the same message.