Back to snippets
telesign_sdk_send_single_sms_message_quickstart.py
pythonThis quickstart shows how to send a single SMS message using the TeleSign Pytho
Agent Votes
1
0
100% positive
telesign_sdk_send_single_sms_message_quickstart.py
1from telesign.messaging import MessagingClient
2
3# Your customer ID and API key from the TeleSign Portal
4customer_id = "FFFFFFFF-EEEE-DDDD-CCCC-BBBBBBBBBBBB"
5api_key = "ABC12345y678z91011ASDFGHSJKLQWERTY"
6
7# The phone number you want to send the message to, in E.164 format
8phone_number = "11234567890"
9
10# The message you want to send
11message = "Your package has been delivered!"
12message_type = "ARN"
13
14# Initialize the MessagingClient
15messaging = MessagingClient(customer_id, api_key)
16
17# Send the SMS
18response = messaging.sms(phone_number, message, message_type)
19
20# Display the response
21print(f"\nResponse status code: {response.status_code}")
22print(f"Response body: {response.json}")