I am trying netflie/laravel-notification-whatsapp and getting following error when I access the URL http::localhost:8000/wa
Unsupported post request. Object with ID '+919xxxxxxx' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api
namespace App\Notifications;
use DateTimeImmutable;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use NotificationChannels\WhatsApp\Component;
use NotificationChannels\WhatsApp\WhatsAppChannel;
use NotificationChannels\WhatsApp\WhatsAppTemplate;
class TestNotification extends Notification
{
use Queueable;
/**
* Get the notification's delivery channels.
*
* @return array
*/
public function via(): array
{
return [WhatsAppChannel::class];
}
/**
* Get the array representation of the notification.
*
* @return WhatsAppTemplate
*/
public function toWhatsapp(): WhatsAppTemplate
{
return WhatsAppTemplate::create()
->name('app_notification')
->body(Component::dateTime(new DateTimeImmutable()))
->body(Component::text('Hi there.'))
->to('+91xxxxxxxxx');
}
}
add a route entry for testing (routes/web.php)
<?php
use Illuminate\Support\Facades\Notification;
use App\Notifications\TestNotification;
Notification::route('whatsapp', '/wa')->notify(new TestNotification());
I am trying
netflie/laravel-notification-whatsapp
and getting following error when I access the URLhttp::localhost:8000/wa
Unsupported post request. Object with ID '+919xxxxxxx' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api
Unable to resolve the issue. Please help.
What I have done: