Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
datadude
Regular Visitor

Twilio Content Pack 50 message limit (pagination)

The Twilio API limits the number of returned items to 50 by default, up to a maximum of 1000 per call. There is the usual embedded next page URI so you can request more data, but I've found no guidance on how to accomplish this in Power BI. Even in the demo for this package, you can see that there are only 50 messages in the dataset. It's a neat content pack, that would be very useful, but data on only 50 messages at a time is not very useful.

 

Does anyone have ideas or workarounds for retrieving additional data? I'm more of an R/python/Tableau user, so I'm very inexperienced with Power BI at the moment.

9 REPLIES 9
Anonymous
Not applicable

You can use the twilio API in a python script to get the full data. 

If you want this to be available on Power BI Service, however, I believe you will need to run the query through a personal gateway as well as hard code the Twilio credentials (which is, generally, not a good idea) into your script as is discussed in regards to the Zendesk API here. 

You will also need to install the Twilio API Python SDK

You could also try to construct the API request in an R script, but using the Python SDK is much easier. This works for me:

from twilio.rest import Client
import pandas as pd


account_sid = 'YOUR_ACCOUNT_SID_HERE'
auth_token = 'YOUR_AUTH_TOKEN_HERE'
client = Client(account_sid, auth_token)

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

frame = pd.DataFrame(columns=['sid','date_sent','account_sid','to','from','body','status',
'num_segments','num_media','direction','price','error_code','error_message','date_created','date_updated'])

for record in messages:
    frame = frame.append({'sid':record.sid,'date_sent':record.date_sent,'account_sid':record.account_sid,
    'to':record.to,'from':record.from_,'body':record.body,'status':record.status,'num_segments':record.num_segments,
    'num_media':record.num_media,'direction':record.direction,'price':record.price,'error_code':record.error_code,
    'error_message':record.error_message,'date_created':record.date_created,'date_updated':record.date_updated},ignore_index=True)
nobrien
Regular Visitor

Has anyone found a fix or workaround for this 50 message limitation?

Any update on this?

I'm hitting this issue too. Given how long ago this was reported I would have expected an update by now...

vincemin
Frequent Visitor

Same problem here, for SMS reporting, only limits 50 rows of data.  Please advise on fix!

schaefferw
New Member

I am having the same problem... I have connected Twilio's API to Power BI service and each time I try and use the Monthly message count it will not allow me to show more than 50 results even though I have around 15k messages sent this month... When I log into Twilio, there is a pagination when I look at the message logs and it only shows me 50 at a time so I am assuming that this is the reason it is not working properly. Can we please get a fix for this!

Youssef
Employee
Employee

Hi,

 

I just want to make sure I understand the problem correctly. You are using the Twilio content pack on PowerBI.com not the Twilio connector in the Power BI Desktop application. Is that understanding correct? If so, then pagination should be implemented and if you are not seeing that, then it's likely a regression or a bug on our side.

We'll look into it as soon as possible, but it will be good if you can confirm the scenario.

 

Youssef Shoukry
Product Manager, Power BI

In the online version, total message count will show a value that should be correct amount, ~5K. But every other value (last 30 days) is always stuck at 50, and I can't see anywhere to fetch more values.

bump

My apologies, I seem to have missed the email alert that I had received a reply. I'm using both online and desktop versions. If you say the feature should be there, I will have a second look and respond. Thank you for your patience and assistance.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors