I'm trying to send a message to my phone with curl:
curl -X POST 'https://api.twilio.com/2010-04-01/Accounts/<my-trial-sid>/Messages.json' \
--data-urlencode 'To=+<my-phone-number>' \
--data-urlencode 'From=+15005550006' \
--data-urlencode 'Body=Hello from twilio' \
-u <my-trial-sid>:<my-trial-token>
However I never get the message on the phone. The response show status as 'queued'. What's keeping it from being sent?
The complete response I get:
{"sid": "SM18ce5f04a0ed4d6e8bfdc91d862d7b7f", "date_created": "Wed, 08 Mar 2017 01:59:07 +0000", "date_updated": "Wed, 08 Mar 2017 01:59:07 +0000", "date_sent": null, "account_sid": "<my-trial-sid>", "to": "+<my-phone-number>", "from": "+15005550006", "messaging_service_sid": null, "body": "Sent from your Twilio trial account - Hello from twilio", "status": "queued", "num_segments": "1", "num_media": "0", "direction": "outbound-api", "api_version": "2010-04-01", "price": null, "price_unit": "USD", "error_code": null, "error_message": null, "uri": "/2010-04-01/Accounts/<my-trial-sid>/Messages/SM18ce5f04a0ed4d6e8bfdc91d862d7b7f.json", "subresource_uris": {"media": "/2010-04-01/Accounts/<my-trial-sid>/Messages/SM18ce5f04a0ed4d6e8bfdc91d862d7b7f/Media.json"}}%
Can't find any relevant log entries on the console either. What am I missing?
Twilio developer evangelist here.
It looks like you are using your test credentials here. Test credentials will never actually send an SMS, they just allow you to make sure you are making the API request correctly.
You should do make the same API call but with your regular credentials and messages will be sent. If you are still on a trial account then this message will not cost you anything.
As of 2023, you may also be running into weird A2P/10DLC issues depending on the registration status of your campaign, or various "number not associated with registered campaign" issues.
Take a look at "Monitor => Logs => Messaging"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With