Subscribe to Webhooks to get notifications about messages your business receives and customer profile updates.
Before you can start receiving notifications you will need to create an endpoint on your server to receive notifications.
Your endpoint must be able to process two types of HTTPS requests: Verification Requests and Event Notifications. Since both requests use HTTPs, your server must have a valid TLS or SSL certificate correctly configured and installed. Self-signed certificates are not supported.
When you configure the Webhook in the WhatsApp Settings, you must define the endpoint where is listening your server and a Token that can be any value, this token is used when registering the webhook endpoint and verify the subscriber is valid.
oClient := TsgcWhatsapp_Client.Create(nil);
oClient.ServerOptions.WebhookOptions.Endpoint := '/webhook';
oClient.ServerOptions.WebhookOptions.Token := 'MySecretToken';
oClient.StartServer();
Once the Webhook is configured, subscribe to Messages Webhook Fields to be notified every time a new message is received.
You can read more about configuring SSL Server.