import requests import json
Set up the API endpoint and API key
courier_url = "https://api.courier.com/v1/messages" api_key = "YOUR_API_KEY"
Define the message and recipient
message = { "text": "This is a secret message." } recipient = "+1234567890"
Send the message
response = requests.post(courier_url, json={ "message": message, "recipient": recipient }, headers={ "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" })
Check the response
if response.status_code == 201: print("Message sent successfully!") else: print("Error sending message:", response.text)

Log in or sign up for Devpost to join the conversation.