0

I'm running a REDCap study with Twilio to text people with survey links. I sent about 50 surveys out and I wanted to find out which numbers cannot be delivered. First issue I have: the messages sent cannot be found in the message logMsg log

But I can find the records under Insightsinsights

In order to track the delivery status, I wanted to get something like this

datatable

I tired the Python code on Twilio's website here , copied below

# Download the helper library from https://www.twilio.com/docs/python/install
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 = os.environ['TWILIO_ACCOUNT_SID']
auth_token = os.environ['TWILIO_AUTH_TOKEN']
client = Client(account_sid, auth_token)

messages = client.messages.list(limit=20)

for record in messages:
    print(record.sid)

And "messages" returned an empty list (no errors). I'm not sure whether the empty message log has anything to do with this.

Any help is appreciated!

Terry Cai
  • 35
  • 3
  • If there are no message logs in your Twilio Console via the Messaging Logs and there are no messages shown via the API, can you make sure you're logged in to the correct Twilio account, using the correct Account SID? It's possible that you're logged in to another account. – anthonyjdella Jun 08 '23 at 16:51
  • Thank you for your response. Yes, I did as you asked. In fact, I only have one Twilio account. I also used the web API to send a text to my phone and that record appeared in the message log and I was able to retrieve it using the Python code I pasted. It gave me the impression that the message log only keeps records of texts sent via the API. The texts sent by REDCap only show up on the Insights page. – Terry Cai Jun 09 '23 at 17:06

0 Answers0