Twilio
Twilio powers personalized interactions and trusted global communications to connect you with customers.
Official Websitehttps://www.twilio.com/
Tagssmsphoneemail
- JavaScript
- Python
Documentationhttps://www.twilio.com/docs/api
NodeJS packagehttps://www.npmjs.com/package/twilio
Version4.7.2
Source Codehttps://github.com/twilio/twilio-node
Documentationhttps://www.twilio.com/docs/api
Pypi packagehttps://pypi.org/project/twilio/
Version8.11.1
Source Codehttps://github.com/twilio/twilio-python
Credential configuration
To configure this credential, you need your Twilio Account SID
and the Auth Token
.
You can find both in the main page when you log in to Twilio.
Optionally, you can set any of the extra config parameters you can see here, in the opts object.
Here is an example of a filled credential configuration form in YepCode:
Twilio Snippets available in Editor
note
The title is the triggering text for YepCode to autocomplete the script.
- JavaScript
- Python
Integration
New integration from credential
const twilio = yepcode.integration.twilio('credential-slug');
New integration from plain authentication data
const twilio = require('twilio')('your-account-SID', 'your-auth-token');
Send SMS Message
Send SMS message
twilio.messages
.create({
body: "SMS content",
messagingServiceSid: "messagingServiceSid",
to: "Phone number in international format",
})
.then((message) => console.log(message))
.done();
Send Whatsapp Message
Send Whatsapp message
twilio.messages
.create({
body: "Whatsapp content",
from: "whatsapp:Your twilio phone number in international format",
to: "whatsapp:Destination phone number in international format",
})
.then((message) => console.log(message))
.done();
Integration
New integration from credential
twilio = yepcode.integration.twilio('credential-slug')
New integration from plain authentication data
from twilio.rest import Client
twilio = Client('your-account-SID', 'your-auth-token')
Send SMS Message
Send SMS message
message = twilio.messages.create(
body='SMS content',
from='Your twilio phone number in international format',
to='Destination phone number in international format'
)
print(message.sid)
Send Whatsapp Message
Send Whatsapp message
message = twilio.messages.create(
body='Whatsapp content',
from='whatsapp:Your twilio phone number in international format',
to='Destination phone number in international format'
)
print(message.sid)