twilio icon indicating copy to clipboard operation
twilio copied to clipboard

"[HTTP 401] Unable to create record: Authenticate"

Open LyndonMcjohnson opened this issue 3 years ago • 3 comments

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());

LyndonMcjohnson avatar Feb 15 '22 11:02 LyndonMcjohnson

Did you fixed this? I think is related to notifications that are sent into queues maybe?

AlsonicTech avatar Mar 24 '22 09:03 AlsonicTech

No, I scratched it.

LyndonMcjohnson avatar Apr 02 '22 11:04 LyndonMcjohnson

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

edgrosvenor avatar May 02 '22 15:05 edgrosvenor