Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twilio sending message Using twilio library

Sending twilio message from my api returns this error

Twilio sending message The requested resource /2010-04-01/Accounts//Messages.json was not found

this is how I send a message. anyone incountered a problem?

$this->client = new \Services_Twilio($sid, $token);
     return $this->client->account->messages->sendMessage($from ,$to, $message);

this is the documentation I followed

https://www.twilio.com/docs/api/rest/sending-sms

How do I create Messages.json

I used this https://github.com/twilio/twilio-php on laravel 4.2

like image 594
Nean Avatar asked Oct 04 '15 08:10

Nean


1 Answers

Another Twilio developer evangelist here. Think I might be able to help.

The error message you got was this:

The requested resource /2010-04-01/Accounts//Messages.json was not found

The key point is the URL, particularly the double slash in the middle. That is where your Account Sid should be, thus leading to the 404 error.

In this case, I would double check how you are setting $sid. Make sure it is assigned before you try to create the Twilio client object.

like image 132
philnash Avatar answered Oct 12 '22 05:10

philnash