-
Notifications
You must be signed in to change notification settings - Fork 625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates for the new Email Activity API (beta) #587
Comments
Have these new endpoints been implemented in the PHP SDK? |
I am using the sendgrid api in my project and working fine but it's not returning the msg_id and also I don't found any documentation that how to get that msg_id in response when we send a email. Can you please, help me on this. Thanks in advance. |
@mudit1987100 It's a response header when sending mail: |
@childish-sambino Thanks for your response but this message id is not that id using which I can track the activity of the email. How I can get the sendgrid assigned ID so I can pass it into the activity API. I have checked the webhooks but for that we have to upgrade our servers which will be costly so is there any way we can get the ID in response and directly pass that ID into activity API. Please, help on this. |
@mudit1987100 This was discussed here with some examples: #948 |
@childish-sambino Thanks for your quick reply. I tried this way: https://api.sendgrid.com/v3/messages?limit=10&query=msg_id%3D%22iioCSRBVTmWWymThlO0kbA%25%22 e.g. msg_id = 'message_id%' but I am getting blank array: stdClass Object ( [messages] => Array ( ) ) |
@mudit1987100 Recommend trying this with cURL or Postman first to make sure the syntax is proper. |
@childish-sambino Many Thanks. I am using cURL to call this API here's the code below: $url = 'https://api.sendgrid.com/v3/messages?limit=10&query=msg_id%3D%22iioCSRBVTmWWymThlO0kbA%25%22';
$header = array();
$header[] = 'Authorization: Bearer <<My API Key Here>>';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$result = json_decode($response);
curl_close($ch); // Close the connection
print_r($result); |
@mudit1987100 You'll need to use |
@childish-sambino Many Many Thanks. It worked. Here's the final url I encoded may be it can help someone else: $url = 'https://api.sendgrid.com/v3/messages?limit=10&query=msg_id+LIKE+%22iioCHDBVTmWWymThlO5kbA%25%22' Below is the response: ( [messages] => Array ( [0] => stdClass Object ( [from_email] => [email protected] [msg_id] => iioCSRBVTmWWymThlO8kbA.filterdrecv-p3mdw1-75c584b9c6-jp7b2-18-5F15E2A1-X.0 [subject] => Sending with Twilio SendGrid is Fun [to_email] => [email protected] [status] => delivered [opens_count] => 3 [clicks_count] => 0 [last_event_time] => 2020-07-08T15:19:00Z ) ) ) Again Thanks @childish-sambino |
@childish-sambino is it possible to get the messade id using the SMTP email as I'm using SMTP protocol to send email but not getting the X-Message-ID in header. Please, help me on this. Many Thanks |
@mudit1987100 I'm not familiar with what data is available in the SMTP response. Best to reach out to support. |
@childish-sambino many thanks for the help |
SendGrid has added an API to download information from the Email Activity feed. There are four new endpoints:
A getting started doc for the API is here.
The following items need to be updated in this repo:
messages
folder with a filemessages.py
)The text was updated successfully, but these errors were encountered: