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 SMS records with the IDs specified in the
idparameter. To retrieve multiple records, supply a comma-separated list of up to 20 IDs. If any IDs you request are not found they are listed in
ids_not_foundin the response.
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.