2022.8.03 twilio send message

정성우·2022년 8월 3일
0

학습내용
차후에 번호판 식별 및 ocr 고도화시에
1분이상 같은장소에 정차중일경우에 주차로 판단하여 주차구역을
갖고있는 회원정보db를 이용해 휴대폰 문자메시지로 보낸다고 가정

문자메시지를 보내는 코드를 작성해보았다.

import os
from twilio.rest import Client


# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = 'account_sid'
auth_token = 'auth_token'
client = Client(account_sid, auth_token)

message = client.messages \
                .create(
                     body="your parking lot number is h3  ",
                     from_='virtualnumber',
                     to='+82010xxxxxxxx'
                 )

print(message.sid)

실행결과

학습한 내용 중 어려웠던 점 또는 해결못한 것들

해결방법 작성

학습 소감
무료버전이라 자기휴대폰으로만 보낼수 있는점이 아쉽다.

0개의 댓글