WhatsApp Cloud API
Send template, text, media and interactive messages through the WhatsApp Cloud API from Delphi/C++Builder. Includes a built-in HTTPS Webhook listener for inbound events.
Send template, text, media and interactive messages through the WhatsApp Cloud API from Delphi/C++Builder. Includes a built-in HTTPS Webhook listener for inbound events.
Delphi/C++Builder client for the WhatsApp Business Cloud API. Send messages over HTTPS, host a Webhook endpoint for delivery and status events.
TsgcWhatsApp_Client
Windows, macOS, Linux, iOS, Android
Standard / Professional / Enterprise
Set AccessToken and PhoneNumberId, bind the WebHook server to a TsgcWebSocketHTTPServer, then SendMessage for outbound and OnInboundMessage for replies.
uses
sgcLibs;
var
WA: TsgcWhatsApp_Client;
begin
WA := TsgcWhatsApp_Client.Create(nil);
WA.CloudOptions.AccessToken := 'EAAG...';
WA.CloudOptions.PhoneNumberId := '123456789012345';
WA.CloudOptions.VerifyToken := 'my-webhook-secret';
WA.OnInboundMessage := procedure(Sender: TObject;
const aFrom, aText: string)
begin
Memo1.Lines.Add(aFrom + ': ' + aText);
end;
WA.Active := True;
WA.SendTextMessage('+34666555444', 'hello from Delphi');
end;
// uses: sgcLibs
TsgcWhatsApp_Client *WA = new TsgcWhatsApp_Client(this);
WA->CloudOptions->AccessToken = "EAAG...";
WA->CloudOptions->PhoneNumberId = "123456789012345";
WA->Active = true;
WA->SendTextMessage("+34666555444", "hello from Delphi");
Combines an HTTPS Cloud API client with a built-in Webhook HTTPS server so a single Delphi process handles outbound and inbound traffic.
SendTextMessage, SendTemplateMessage, SendMediaMessage, SendInteractiveMessage, SendLocationMessage and SendContactMessage cover the main Cloud API content types.
The component embeds a TsgcWebSocketHTTPServer to host the verification + delivery webhook required by Meta. OnInboundMessage and OnStatusUpdate deliver typed events.
OAuth Bearer authentication via CloudOptions.AccessToken; verify-token check happens automatically against CloudOptions.VerifyToken on the first webhook GET probe.
SendTemplateMessage accepts named/positional parameters, language code and the component sets the typed structure Meta requires.
The component handles the multi-step Cloud API media upload (upload → obtain media-id → reference in send) when you call SendMediaMessage with a local file path.
Configure the embedded server's SSLOptions for HTTPS — Meta requires the Webhook to be reachable over TLS. WatchDog handles port re-binding on certificate rotation.
Authoritative sources for the API this component implements.
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.
| Online Help — API_Whatsapp Full property, method and event reference for this component. | Open | |
| Demo Project — Demos\50.Other\05.WhatsApp Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below. | Open | |
| Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |