Read multiple Message resources
Read multiple Message resources by sending a GET request to your Account's Messages list URI.
Results are sorted by theDateSent
field, with the most recent messages appearing first.If you are using the Whoosh REST API and plan on requesting more records than will fit on a single page, you may want to use the response's nextpageuri property. We are 100% Twilio compatible, check out how Twilio handles paging . Requesting this URI ensures that your next request picks up where it left off and can prevent you from retrieving duplicate data if you are actively sending or receiving messages.
This is not necessary if you are using one of the Helper Libraries, which automatically handle pagination. Take a look at the Twilio Helper Library documentation for more information.
You can also filter the Messages list by providing the following query string parameters to the listing resource:
Parameters
to
Optional
GETphone_number
PII MTL: 120 DAYSFilter by recipient. For example: Set this
to
parameter to +15558881111
to retrieve a list of Message resources with to
properties of +15558881111
from
Optional
GETphone_number
PII MTL: 120 DAYSFilter by sender. For example: Set this
from
parameter to +15552229999
to retrieve a list of Message resources with from
properties of +15552229999
date_sent
Optional
GETdate_time_inequality<iso8601>
Not PII Filter by Message
sent_date
. Accepts GMT dates in the following formats: YYYY-MM-DD
(to find Messages with a specific sent_date
), <=YYYY-MM-DD
(to find Messages with sent_date
s on and before a specific date), and >=YYYY-MM-DD
(to find Messages with sent_dates
on and after a specific date).