Octopus.Script exported 2020-04-14 by ryanrousseau belongs to ‘Twilio’ category.
Send an SMS using Twilio’s API. This script step is written in PowerShell.
Parameters
When steps based on the template are included in a project’s deployment process, the parameters below can be set.
SID
Twilio_SendMessage_AccountSID =
The Twilio account SID.
Auth Token
Twilio_SendMessage_AuthToken =
The Twilio AuthToken.
From Number
Twilio_SendMessage_FromNumber =
The number to send the message from. This is usually your Twilio number.
To Number
Twilio_SendMessage_ToNumber =
The number to send the message to.
Message
Twilio_SendMessage_Message =
The message to send.
Script body
Steps based on this template will execute the following PowerShell script.
$url = "https://api.twilio.com/2010-04-01/Accounts/$Twilio_SendMessage_AccountSID/Messages.json"
$params = @{
To = $Twilio_SendMessage_ToNumber;
From = $Twilio_SendMessage_FromNumber;
Body = $Twilio_SendMessage_Message
}
Write-Verbose "Creating Twilio credentials"
$secureToken = $Twilio_SendMessage_AuthToken | ConvertTo-SecureString -asPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential($Twilio_SendMessage_AccountSID, $secureToken)
Write-Verbose "Creating Twilio credentials"
Invoke-WebRequest $url -Method Post -Credential $credential -Body $params -UseBasicParsing
Provided under the Apache License version 2.0.
To use this template in Octopus Deploy, copy the JSON below and paste it into the Library → Step templates → Import dialog.
{
"Id": "3c3904a9-d08c-4f18-b86c-0304800bb541",
"Name": "Twilio - Send SMS (PowerShell)",
"Description": "Send an SMS using Twilio's API. This script step is written in PowerShell.",
"Version": 1,
"ExportedAt": "2020-04-14T15:25:44.139Z",
"ActionType": "Octopus.Script",
"Author": "ryanrousseau",
"Packages": [],
"Parameters": [
{
"Id": "392a1b09-0f79-48c2-95f8-679869383e39",
"Name": "Twilio_SendMessage_AccountSID",
"Label": "SID",
"HelpText": "The Twilio account SID.",
"DefaultValue": "",
"DisplaySettings": {
"Octopus.ControlType": "Sensitive"
}
},
{
"Id": "1c10d07a-f2fc-466d-ad2b-0d9800141e60",
"Name": "Twilio_SendMessage_AuthToken",
"Label": "Auth Token",
"HelpText": "The Twilio AuthToken.",
"DefaultValue": "",
"DisplaySettings": {
"Octopus.ControlType": "Sensitive"
}
},
{
"Id": "bdbd0b60-9544-41a5-a64d-b8544c6f1958",
"Name": "Twilio_SendMessage_FromNumber",
"Label": "From Number",
"HelpText": "The number to send the message from. This is usually your Twilio number.",
"DefaultValue": "",
"DisplaySettings": {
"Octopus.ControlType": "SingleLineText"
}
},
{
"Id": "fbb8e980-fd54-4c34-a149-848a1eebd560",
"Name": "Twilio_SendMessage_ToNumber",
"Label": "To Number",
"HelpText": "The number to send the message to.",
"DefaultValue": "",
"DisplaySettings": {
"Octopus.ControlType": "SingleLineText"
}
},
{
"Id": "d3674581-f589-4f9e-998c-f829ee9195f6",
"Name": "Twilio_SendMessage_Message",
"Label": "Message",
"HelpText": "The message to send.",
"DefaultValue": "",
"DisplaySettings": {
"Octopus.ControlType": "MultiLineText"
}
}
],
"Properties": {
"Octopus.Action.Script.ScriptSource": "Inline",
"Octopus.Action.Script.Syntax": "PowerShell",
"Octopus.Action.Script.ScriptBody": "$url = \"https://api.twilio.com/2010-04-01/Accounts/$Twilio_SendMessage_AccountSID/Messages.json\"\n$params = @{\n To = $Twilio_SendMessage_ToNumber;\n From = $Twilio_SendMessage_FromNumber;\n Body = $Twilio_SendMessage_Message\n}\n\nWrite-Verbose \"Creating Twilio credentials\"\n$secureToken = $Twilio_SendMessage_AuthToken | ConvertTo-SecureString -asPlainText -Force\n$credential = New-Object System.Management.Automation.PSCredential($Twilio_SendMessage_AccountSID, $secureToken)\n\nWrite-Verbose \"Creating Twilio credentials\"\nInvoke-WebRequest $url -Method Post -Credential $credential -Body $params -UseBasicParsing\n"
},
"Category": "Twilio",
"HistoryUrl": "https://github.com/OctopusDeploy/Library/commits/master/step-templates//opt/buildagent/work/75443764cd38076d/step-templates/twilio-send-sms-powershell.json",
"Website": "/step-templates/3c3904a9-d08c-4f18-b86c-0304800bb541",
"Logo": "iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAIAAAAiOjnJAAAAAXNSR0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GaHBCcV1jKBoVQDWUnPsdfzIhrCVq12+Uz00XDz7rtPdR6jCmYhjJlP7sIAwOyS1lpQ6hIBSHQnX87nKcyZawGql9dK1y8XLp+OnC6JTTlqcRBXdMSK2eEYphpmdfi7sn3ddwAS6rZ5xCRrjHwUlbHg7hFs5RBBeWPbIrLB/ep5/NX/l9Zfry3NnXSkdOFSePFIYO0PJ3/RcAfLZmOy36Dx3AZbgYH8EH8XE4YXeZxwrLogUrLIsWrLAsWrDCsmjBCsuiBSssixassCxasMKyaMEKy6IFKyyLFqywLFqwwrJowQrLogUrLIsWrLAsWrDCsmjBCsuiBSssixassCxasMKyaMEKy6IFKyyLFqywLFqwwrJowQrLooF79/4Lf2aNUcCDQTIAAAAASUVORK5CYII=",
"$Meta": {
"Type": "ActionTemplate"
}
}
Page updated on Tuesday, April 14, 2020