Created
July 29, 2020 19:56
-
-
Save evanwinter/b92667f1b9ede79eaca1f7855aa8d461 to your computer and use it in GitHub Desktop.
Send an SMS text message using the Twilio API and Node.js SDK.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const twilio = require("twilio") | |
const accountSid = "<MY_TWILIO_ACCOUNT_SID>" | |
const authToken = "<MY_TWILIO_AUTH_TOKEN>" | |
const client = new twilio(accountSid, authToken) | |
client.messages.create({ | |
body: "Hello from Node.js", | |
to: "<TARGET_PHONE_NUMBER>", | |
from: "<MY_TWILIO_PHONE_NUMBER>" | |
}).then((message) => console.log(message.sid)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment