Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Sends WhatsApp messages and manages templates, WABAs, and phone numbers through the Telnyx WhatsApp Business API in Python.
32% 95%+64 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 7 of 22 without it.
Write Python code using the Telnyx Python library to send a standard SMS text message 'Your verification code is 4492' from phone number +19452940762 to recipient +18005551234.
Calls client.messages.create() method.
3 of 3 safety checks passed
pip install telnyx
import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"),
)
All examples below assume client is already initialized as shown above.
All API calls can fail with network errors, rate limits (429), validation errors (422), or authentication errors (401). Always handle errors in production code:
import telnyx
try:
response = client.messages.send_whatsapp(
from_="+19452940762",
to="+18005551234",
type_="WHATSAPP",
whatsapp_message={
"type": "text",
"text": {"body": "Hello from Telnyx!"}
},
)
except telnyx.APIError as e:
Published skills whose descriptions closely match this one, with their benchmark result.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.