twilio
twilio copied to clipboard
"[HTTP 401] Unable to create record: Authenticate"
What am I doing wrong here?
.env:
TWILIO_SID=[Valid SID]
TWILIO_AUTH_TOKEN=[Valid Token]
TWILIO_NUMBER=[Valid Number]
TWILIO_APPLICATION_SID=[Valid App SID]
TWILIO_API_KEY=[Valid API Key]
TWILIO_API_SECRET=[Valid API Secret]
TWILIO_ACCOUNT_SID=[Valid Account SID]
Notification Class:
public function via($notifiable)
{
return ['mail', 'database', TwilioChannel::class];
}
public function toTwilio($notifiable)
{
return (new TwilioMmsMessage())
->content('Your service request for ' . $this->subscription->service->name . ' has been updated to the ' . $this->subscription->status . ' status')
->mediaUrl(route('services'));
}
Controller:
$subscription->client->notify((new ServiceUpdated($subscription))->afterCommit());
Did you fixed this? I think is related to notifications that are sent into queues maybe?
No, I scratched it.
The problem is that this package expects the account SID to be used as the method of authentication rather than an API key. This PR would fix it for you: https://github.com/laravel-notification-channels/twilio/pull/135