![]() ![]() What's next for sending SMS with Node.js?Ĭongratulations on writing a short Node.js app to send a quick SMS to your phone! This was so wickedly quick, can you even believe it was possible? You’ll see the message SID of your newly generated message logged to your terminal, and in just a moment, you will get a ping on your personal phone with the SMS. Note, both of these numbers should be in e1.64 format as demonstrated in this code snippet: Send an SMS with Node.jsīack in your text editor, open your index.js file and copy and paste the following code, taking care to replace the value of the to key on line 11 with your personal phone number, and the value for the from key on line 12 with your Twilio phone number. After you confirm your purchase, take note of your new phone number and click the Close button. ![]() If you’d like to request a number from your region, you can enter your area code in the Number field.Ĭlick the Search button to see what numbers are available, and then click “Buy” for the number that you like from the results. In the Buy a Number screen you can select your country and check SMS in the capabilities field. Note that if you are using a free account you will be using your trial credit for this purchase. Still in the Twilio Console, select Phone Numbers, and then click on the red plus sign to buy a Twilio number. You’ll use the Twilio phone number to send an SMS to your personal phone number. Now it’s time to buy a Twilio phone number. Likewise, copy your Auth Token and add it as the value for the TWILIO_AUTH_TOKEN environment variable. ![]() Now, navigate back to your account dashboard on the Twilio Console and find your Account SID and Auth Token.Ĭopy your Account SID and add it as the value for the TWILIO_ACCOUNT_SID environment variable. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |