def message_list(twilioID, twilioNumber, twilioKey, df, userID, message):
    client = Client(twilioID, twilioKey)
    messageLog = []
    for i, row in df.iterrows():
        message = client.messages.create(
            to=row['number'],
            from=twilioNumber,
            body = messages
        )
        print(dir(message))
        messageLog.append({
            'id': message.sid,
            'to': row['number'],
        })
    log = {
        'userID': userID,
        'from': twilioNumber,
        'time': datetime.now(),
        'messages': messageLog
    }
    return log
Ejemplo n.º 2
0
# Get the Python helper library from https://twilio.com/docs/libraries/python
from Twilio.rest import Client

# Get your Account SID and Auth Token from https://twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

fleet_sid = 'FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
fleet_service = client.preview.deployed_devices.fleets(fleet_sid)

was_deleted = fleet_service.devices("THXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")\
                           .delete()

print(was_deleted)