0

It should be with message events API but I don't see a solution.

Could someone give me a hint?

Best regards, Nedim

Nedim
  • 563
  • 1
  • 11
  • 23
  • The only solution I can see is to get records from suppresion list (https://api.sparkpost.com/api/v1/suppression-list/) and after that compare. Every email who is not listed in suppresion list is delivered. Is there a better way to handle this? – Nedim Jun 10 '16 at 13:10

1 Answers1

1

The suppression list is only a list of emails that are blocked from being sent to in the future. I would not use this as a method to detect delivery. Email addresses you send to that result in a hard bounce, spam complaint, link unsubscribe, or list unsubscribe are automatically added to your suppression list so you can't send to those emails again.

You can definitely use the message events API to get what you are looking for. You can filter the events shown by the delivery event type using the events parameter. You'll also want to supply the from parameter and set it to three days ago. Here's an example call using cURL:

curl -X GET -H "Accept: application/json" -H "Authorization: <your-api-key>" "https://api.sparkpost.com/api/v1/message-events?from=2016-06-07T00:00&events=delivery"

Documentation for the message events API can be found here:

Additionally, there are endpoints for both documentation of all the fields returned as well as sample endpoints:

richleland
  • 1,442
  • 9
  • 13
  • Thanks for your answer. I've tried that too, but there is an unusual problem. It always returns as I haven't sent any email: https://api.sparkpost.com/api/v1/message-events?from=2016-01-01T00:00&events=delivery Response: `{ "results": [], "total_count": 0, "links": [] }` And I sent an email a minute ago to my Gmail account: "via sparkpostmail1.com 3:50 PM (1 minute ago)" EDIT: Now it works, but it's really slow. It takes 8 seconds to get a request. – Nedim Jun 10 '16 at 13:51
  • Also note that message events data is only available for the last 10 days – cfs Jun 10 '16 at 13:57