/ sms.py
sms.py
 1  import vonage
 2  def send_msg():
 3      client = vonage.Client(key="0f236922", secret="IYe8RRcortpNhS9e")
 4      sms = vonage.Sms(client)
 5      responseData = sms.send_message(
 6          {
 7              "from": "Vonage APIs",
 8              "to": "527712711009",  
 9              "text": "Se a detectado una persona",
10          }
11      )
12  
13      if responseData["messages"][0]["status"] == "0":
14          print("Message sent successfully.")
15      else:
16          print(f"Message failed with error: {responseData['messages'][0]['error-text']}")
17  if __name__=='__main__':
18      send_msg()