Initial Release
InterSystems IRIS Interoperability adapter for the WhatsApp Cloud API (Meta). Send and receive WhatsApp messages directly from your IRIS production — no Python, no Node.js, no external service required.
Built for the InterSystems Community Bounty “Idea to Application” Round 3 — Idea DPI-I-882.
cp .env.example .env
Edit .env:
WA_ACCESS_TOKEN=your_access_token_here
WA_PHONE_NUMBER_ID=your_phone_number_id_here
WA_VERIFY_TOKEN=any_random_string_you_choose
docker compose up -d --build
That’s it. The production autostarts and pre-configures the adapter.
Open the IRIS Management Portal (http://localhost:52773/csp/sys/UtilHome.csp), switch to the USER namespace, and run:
Set tReq = ##class(IrisWhatsApp.Msg.TextRequest).%New() Set tReq.To = "8613800138000" Set tReq.Body = "Hello from InterSystems IRIS!"
Set tOp = ##class(Ens.Director).CreateBusinessOperation("WhatsAppOut", .tSC) Set tSC = tOp.SendRequestAsync("IrisWhatsApp.Out.Operation", tReq) Write "Sent! Status: ", $System.Status.GetErrorText(tSC)
Or send via SQL:
SELECT IrisWhatsApp.Out_Operation_SendText('8613800138000', 'Hello from IRIS SQL!')
https://your-server/csp/whatsapp/IrisWhatsApp.Webhook.cls/whatsappWA_VERIFY_TOKEN in your .envIncoming messages are now delivered to IrisWhatsApp.In.Service in your production. Configure a routing rule to process them.
┌─────────────────────────────────────────────────────┐
│ IRIS Production │
│ │
│ ┌──────────────────────┐ ┌───────────────────┐ │
│ │ In.Service │ │ WhatsAppOut │ │
│ │ (Ens.InboundAdapter) │ │ (Ens.BusinessOp) │ │
│ │ │ │ │ │
│ │ ProcessInput() │ │ SendText() │ │
│ │ processes inbound │ │ SendTemplate() │ │
│ │ WebhookRequest │ │ MarkAsRead() │ │
│ └──────────▲───────────┘ └────────┬──────────┘ │
│ │ │ │
│ ┌──────────┴───────────┐ ┌────────┴──────────┐ │
│ │ IrisWhatsApp.Webhook │ │ Out.Adapter │ │
│ │ (CSP REST handler) │ │ (HTTP → Meta API) │ │
│ │ │ │ │ │
│ │ GET /whatsapp │ │ TLS auto-create │ │
│ │ POST /whatsapp │ │ Proxy support │ │
│ └──────────▲───────────┘ └────────┬──────────┘ │
│ │ │ │
└─────────────┼────────────────────────┼──────────────┘
│ │
┌────────┴────────┐ ┌────────┴────────┐
│ Meta Webhook │ │ Meta Graph API │
│ (incoming msgs)│ │ (send msgs) │
└─────────────────┘ └─────────────────┘
| Class | Role |
|---|---|
IrisWhatsApp.Out.Adapter |
HTTP adapter for Meta Cloud API — handles auth, TLS, proxy, JSON payloads |
IrisWhatsApp.Out.Operation |
Business Operation — SendText, SendTemplate, SendInteractive, MarkAsRead |
IrisWhatsApp.In.Service |
Business Service — receives parsed webhook messages |
IrisWhatsApp.Webhook |
CSP REST handler — webhook verification + message forwarding |
IrisWhatsApp.Msg.TextRequest |
Ens.Request for sending text messages |
IrisWhatsApp.Msg.SendResponse |
Ens.Response with message ID and status |
IrisWhatsApp.Msg.WebhookRequest |
Ens.Request carrying an inbound WhatsApp message |
IrisWhatsApp.TLS |
Auto-creates an SSL/TLS client configuration when missing |
IrisWhatsApp.Utils |
Static helpers: stream reading, timestamps, exceptions |
IrisWhatsApp.Setup |
Creates the CSP app and sample production on first boot |
All settings are in Settings → IrisWhatsApp.Out.Adapter in the Management Portal, or via environment variables:
| Setting | Env Variable | Required | Default |
|---|---|---|---|
| AccessToken | WA_ACCESS_TOKEN |
Yes | — |
| PhoneNumberID | WA_PHONE_NUMBER_ID |
Yes | — |
| ApiVersion | — | No | v22.0 |
| SSLConfiguration | — | No | auto-created |
| ProxyServer | WA_PROXY |
No | — |
The verify token for webhooks is set via WA_VERIFY_TOKEN.
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /csp/whatsapp/IrisWhatsApp.Webhook.cls/whatsapp |
Meta verification handshake |
| POST | /csp/whatsapp/IrisWhatsApp.Webhook.cls/whatsapp |
Incoming message delivery |
| GET | /csp/whatsapp/IrisWhatsApp.Webhook.cls/test |
Health check |
MIT © 2026 foxchengyu