curl -X GET 'https://api.weir.ai/console/mail/status/email_123456789' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console'
{
"data": {
"emailId": "email_123456789",
"to": "[email protected]",
"subject": "Welcome to the team",
"status": "delivered",
"sentAt": "2024-01-22T15:30:00Z",
"deliveredAt": "2024-01-22T15:30:15Z",
"opened": true,
"openedAt": "2024-01-22T16:00:00Z"
},
"message": "Email status retrieved successfully",
"status": "success"
}
Check the delivery status of a sent email
curl -X GET 'https://api.weir.ai/console/mail/status/email_123456789' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console'
{
"data": {
"emailId": "email_123456789",
"to": "[email protected]",
"subject": "Welcome to the team",
"status": "delivered",
"sentAt": "2024-01-22T15:30:00Z",
"deliveredAt": "2024-01-22T15:30:15Z",
"opened": true,
"openedAt": "2024-01-22T16:00:00Z"
},
"message": "Email status retrieved successfully",
"status": "success"
}
curl -X GET 'https://api.weir.ai/console/mail/status/email_123456789' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console'
{
"data": {
"emailId": "email_123456789",
"to": "[email protected]",
"subject": "Welcome to the team",
"status": "delivered",
"sentAt": "2024-01-22T15:30:00Z",
"deliveredAt": "2024-01-22T15:30:15Z",
"opened": true,
"openedAt": "2024-01-22T16:00:00Z"
},
"message": "Email status retrieved successfully",
"status": "success"
}
const getEmailStatus = async (emailId, accessToken) => {
const response = await fetch(`https://api.weir.ai/console/mail/status/${emailId}`, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'x-source': 'console'
}
});
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
return await response.json();
};
Was this page helpful?