Skip to content

List Messages

Gets a paginated list of all messages sent through the platform.

ParameterTypeRequiredDescription
pagenumberNoPage number (default: 1)
limitnumberNoItems per page (default: 20, max: 100)
typestringNoFilter by type: sms or email
statusstringNoFilter by status: PENDING, SENT, DELIVERED, FAILED
startDatestringNoStart date filter (ISO 8601)
endDatestringNoEnd date filter (ISO 8601)
searchstringNoSearch in message content
{
"data": [
{
"id": "msg-uuid-123",
"type": "sms",
"message": "Welcome to our service!",
"status": "DELIVERED",
"recipient": "3001234567",
"countryCode": "57",
"sentAt": "2024-01-15T10:30:00.000Z",
"deliveredAt": "2024-01-15T10:30:15.000Z",
"organizationId": "org-uuid",
"createdAt": "2024-01-15T10:30:00.000Z"
},
{
"id": "msg-uuid-456",
"type": "email",
"subject": "Welcome Email",
"message": "Welcome to our platform!",
"status": "SENT",
"recipient": "[email protected]",
"sentAt": "2024-01-15T09:15:00.000Z",
"organizationId": "org-uuid",
"createdAt": "2024-01-15T09:15:00.000Z"
}
],
"pagination": {
"currentPage": 1,
"totalPages": 5,
"totalItems": 87,
"itemsPerPage": 20,
"hasNextPage": true,
"hasPreviousPage": false
}
}
CodeDescription
400Invalid query parameters
401Missing or invalid API Key
422Validation errors in filters
500Internal server error
Ventana de terminal
curl -X GET "https://app.sendme123.com/api/messages?page=1&limit=20&type=sms" \
-H "api-key: your-api-key-here" \
-H "Content-Type: application/json"
const getRecentSMS = async () => {
try {
const response = await axios.get('https://app.sendme123.com/api/messages', {
params: {
type: 'sms',
limit: 10,
status: 'DELIVERED'
},
headers: { 'api-key': 'your-api-key-here' }
});
console.log('Recent SMS messages:', response.data.data);
return response.data.data;
} catch (error) {
console.error('Error getting recent SMS:', error.response?.data || error.message);
throw error;
}
};
const searchMessages = async (searchTerm) => {
try {
const response = await axios.get('https://app.sendme123.com/api/messages', {
params: {
search: searchTerm,
limit: 50
},
headers: { 'api-key': 'your-api-key-here' }
});
console.log(`Messages containing "${searchTerm}":`, response.data.data);
return response.data.data;
} catch (error) {
console.error('Error searching messages:', error.response?.data || error.message);
throw error;
}
};