The destination phone number. Format with a '+' and country code e.g., +16175551212 (E.164 format).
A Twilio phone number (in E.164 format) or alphanumeric sender ID enabled for the type of message you wish to send. Phone numbers or short codes purchased from Twilio work here. You cannot (for example) spoof messages from your own cell phone number.
The text of the message you want to send, limited to 1600 characters.
async
(params, auths) => {
}
// Read the Twilio docs at https://www.twilio.com/docs/sms/api/message-resource#create-a-message-resource
const data = {
To: params.To,
From: params.From,
MessagingServiceSid: params.MessagingServiceSid,
Body: params.Body,
MediaUrl: params.MediaUrl,
}
const config = {
method: "post",
url: `https://api.twilio.com/2010-04-01/Accounts/${auths.twilio.AccountSid}/Messages.json`,
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
auth: {
username: auths.twilio.Sid,
password: auths.twilio.Secret,
},
data: require("qs").stringify(data),
}
return await require("@pipedreamhq/platform").axios(this, config)