Please note that this API functionality has been deprecated in favour of our new Webhook API. Visit our Transactional API Migration page to learn more.
Overview
You can use this request to retrieve a transactional email with a specific ID.
Note: This is a restful API.
The Method
API | Method |
---|---|
GET | https://live20.everlytic.net/api/2.0/trans_mails/ |
Parameters
Property | Type | Default | Required |
---|---|---|---|
Transaction_id | integer | none | Yes |
Example Request
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "<URL>/api/2.0/trans_mails/5f14717e402fb0568a4a016b", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_POSTFIELDS => "", CURLOPT_HTTPHEADER => array( "Authorization: Basic <auth header>", "cache-control: no-cache" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
Example Response (Sent Email)
{ "links": [ { "title": "Self", "rel": "self", "href": "<URL>/api/2.0/trans_mails/5f14717e402fb0568a4a016b" }, { "title": "Home", "rel": "home", "href": "<URL>/api/2.0/" }, { "title": "ListTransactionalMails", "rel": "collection", "href": "<URL>/api/2.0/trans_mails" } ], "item": { "id": "5f14717e402fb0568a4a016b", "send_email_from": "[email protected]", "send_email_to": " [email protected]", "custom_headers": [], "group_id": 360, "send_status": "sent", "send_date": 1595175294, "opens": 0, "link_clicks": 0, "send_mta_status": "none" } }
Example Response (Bounced Email)
{ "links": [ { "title": "Self", "rel": "self", "href": "/api/2.0/trans_mails/5f14717e402fb0568a4a016b" }, { "title": "Home", "rel": "home", "href": "/api/2.0/" }, { "title": "ListTransactionalMails", "rel": "collection", "href": "/api/2.0/trans_mails" } ], "item": { "id": "5f14717e402fb0568a4a016b", "bounce_reason": "policy-related", "bounce_type": "hard", "subject": "Important Emails Notification", "send_email_from": "[email protected]", "send_email_to": "[email protected]", "group_id": 1, "send_status": "bounced", "send_date": 1595175294 } }
Note: When retrieving a bounced transaction, you’ll be able to view the bounce type (“bounce_type”) and bounce reason (“bounce_reason”) under the “item” section of the API response.