const client = require("twilio")(accountSid, authToken);client.messages.create({ body: "Hello from Twilio!", from: "+1234567890", to: "+0987654321"});
from twilio.rest import Clientclient = Client(account_sid, auth_token)message = client.messages.create( body="Hello from Twilio!", from_="+1234567890", to="+0987654321")
curl -X POST "https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/Messages.json" \--data-urlencode "Body=Hello from Twilio!" \--data-urlencode "From=+1234567890" \--data-urlencode "To=+0987654321" \-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
`; } // Formatted copy example const formattedCopyContainer = document.getElementById("formatted-copy-demo"); if (formattedCopyContainer) { formattedCopyContainer.innerHTML = `
package.json
{ "name": "my-twilio-app", "version": "1.0.0", "dependencies": { "twilio": "^4.0.0" }}
`; } }); // Tab functionality function showTab(evt, tabName) { const tabContents = document.getElementsByClassName("tab-content"); for (let i = 0; i < tabContents.length; i++) { tabContents[i].style.display = "none"; } const tabButtons = document.getElementsByClassName("tab-button"); for (let i = 0; i < tabButtons.length; i++) { tabButtons[i].classList.remove("active"); tabButtons[i].style.background = "transparent"; } document.getElementById(tabName).style.display = "block"; evt.currentTarget.classList.add("active"); evt.currentTarget.style.background = "#fff"; } // Copy functionality function copyFormattedText() { const textToCopy = `{ "name": "my-twilio-app", "version": "1.0.0", "dependencies": { "twilio": "^4.0.0" }}`; navigator.clipboard.writeText(textToCopy).then(() => { const button = event.target; const originalText = button.textContent; button.textContent = "Copied!"; button.style.background = "#14b8a6"; setTimeout(() => { button.textContent = originalText; button.style.background = "#0263e0"; }, 2000); }); } ' width="100%" height="1200" frameborder="0" sandbox="allow-scripts allow-same-origin allow-popups">