You can use the Reports API either synchronously or asynchronously to retrieve SMS message records.
Use this endpoint to retrieve SMS records synchronously, using one of the following approaches:
By message ID: Returns a single SMS record, if one is found that matches the provided
By time period: Returns multiple SMS records that were sent in a time window that you specify using the
date_endparameters, which cannot be more than 24 hours apart. These records are returned in JSON format in batches of up to 1,000 records. If more than 1,000 records match then the response will contain a link to the next batch.
Note: Set the
include_message parameter to
true in the request to return the message text.
If you are expecting many thousands of records, you should consider creating a report. This generates a compressed CSV file that contains all matching records. A link to the CSV file is returned in the response.