netflie / whatsapp-cloud-api

The first PHP API to send and receive messages using a cloud-hosted version of the WhatsApp Business Platform
https://netflie.es/portfolio/whatsapp-business-cloud-api-php-sdk/
MIT License
428 stars 151 forks source link

How to use webhook response instance #159

Closed dontKnew closed 3 months ago

dontKnew commented 7 months ago

The Webhook::read function will return a Notification instance. Please, explore the different notifications availables.

I am getting the instance , but those properties are private, i can access directly, So how can i access that properties.. ??

derrickobedgiu1 commented 7 months ago

There are public methods provided to access the entries. Follow the location where those properties have been declared and you'll find the methods to use. Some examples for Text instance:

$message_text = $webhook->message();
$userid = $webhook->customer()->id();
$user_name = $webhook->customer()->name();
$messageid = $webhook->id();