By Admin on Tuesday, 04 November 2025
Category: All

Whatsapp Delphi Component

The sgcWebSockets WhatsApp component empowers Delphi teams to deliver instant, personalized conversations at scale. Whether you build CRM integrations, help-desk portals or transactional notification services, the component provides a secure, resilient and fully supported bridge to WhatsApp Business messaging. This article combines the commercial value with the technical detail you need to deliver production-ready chat flows quickly. 

Business Impact at a Glance

​Architecture Overview

The component encapsulates the WhatsApp Business API REST endpoints and WebSocket callbacks into a Delphi-friendly interface. It manages token refreshes, message formatting (text, templates, media) and asynchronous delivery reports. Internally it relies on sgcWebSockets core transports, so you benefit from the same TLS, reconnection and threading model used throughout the framework. 

Prerequisites

Component Configuration in Delphi

Drop the TsgcWhatsAppClient component onto your data module or service form. Configure the essential properties inside the Object Inspector or in code during initialization.

Design-Time Settings

  1. Fill PhoneNumberID with the sender phone ID provided by Meta.
  2. Assign AccessToken and optionally the AppSecretProof if you enforce signed requests.
  3. Enable AutoReconnect to true to keep the WebSocket channel alive.
  4. Attach the OnMessageStatus and OnIncomingMessage events for delivery receipts and inbound chat handling.

Sending Messages

Use the SendText and SendTemplate helper methods for high-level scenarios, or access the Messages collection for advanced payloads.

Receiving and Automating Responses

The component includes a built-in webhook listener leveraging sgcWebSockets HTTP server features. Map the webhook path to your published endpoint and process replies inside event handlers. 

Advanced Configuration

Advantages of Using the WhatsApp Component

Related Posts