Search for an email
Users can search for emails sent by their application using Transactional Email Service. Search results are filtered by time sent, the recipient (email address), and event type(s).
Only emails sent in within 30 days of your search date can be retrieved. The API can return a maximum of 300 events, even if additional events over 300 are available. We recommend refining the search results using filtering values.
To use search:
- API Call:
GET {baseUrl}/messages/events
-
HEADER:
- Include TID OAuth Bearer token for your application
- Add a Content-Type of application/JSON.
-
PARAMETERS:
-
message_id- The message ID as provided in the Send Email ID API response. -
start_time- Start time of email event, as a Unix timestamp. -
end_time- End time of email event, as a Unix timestamp. -
recipient- The recipient’s email address. -
event_type- The type of event that you’re searching for. Values include:Delivered- The email was delivered to the recipient, but no action has been taken. Email may be in spam or junk.Failed- The recipient did not received the email. For more information, refer to a list of Common SMTP Errors.
-
Example query
https://cloud.stage.api.trimblecloud.com/utilities/email/1.0/messages/events?start_time=1587020400&end_time=1598280400&recipient=john_example@example-net.comExample response
{ "events": [ { "recipient": "user1@trimble.com", "sender": "Trimble Identity <no-reply@account.trimble.com>", "message_subject": "Trimble Account Creation Notification", "message_id": "2301d49988b441aeb50a1a8770a57a09", "event_id": "672186e773a643228159ed968516b426", "event_type": "failed", "timestamp": 1597346776, "template_id": "651c4ff3c7e244fe88e9e0a82275b8f0" }, { "recipient": "user2@trimble.com", "sender": "Trimble Identity <no-reply@account.trimble.com>", "message_subject": "Trimble Account Creation Notification", "message_id": "247416f881b241cdaf73645f976419f0", "event_id": "3ba233b17c05482990e661968571354d", "event_type": "delivered", "timestamp": 1597346777, "template_id": "651c4ff3c7e244fe88e9e0a82275b8f0" } ]}