Programmatic WhatsApp Sender (Chat-API)
Overview
A second, working pass at programmatic WhatsApp messaging, this time on the mgp25/Chat-API PHP library (the maintained successor to WhatsAPI). It includes a custom callmatic.php script that authenticates and sends a message from the command line. Dated April 2015.
Why It Exists
Following the earlier WhatsAPI build, this revisits automated WhatsApp messaging with an actively-maintained library that added an auto token-updater and randomised identity generation, needed because WhatsApp kept changing its handshake.
What We Built
On top of the vendored Chat-API library (src/whatsprot.class.php, examples, tests, Composer setup), the developer wrote callmatic.php: a configurable CLI sender that sets the Bucharest timezone, supplies a country-coded phone number / generated password / nickname and a target number, opens a STDIN read loop, and dispatches a message through the WhatsApp protocol class. The header comment notes credentials must not be committed, basic operational hygiene.
Technologies & Approach
PHP with the mgp25/Chat-API library implementing WhatsApp’s FunXMPP protocol, plus a small original driver script for sending. Honest framing: the protocol stack is the OSS library; the original contribution is the integration/automation script around it.
Outcome / Impact
A functional automated-messaging build, it could actually log in and send WhatsApp messages, advancing past the read-only whatapp exploration. The “callmatic” naming ties it to the contemporaneous mobile calling-app build.
Capabilities Demonstrated
- Automated messaging via third-party API integration
- CLI scripting with credential/config separation
- Working with reverse-engineered, frequently-changing protocols