Search code examples
node.jsmailjet

Get list of emails and statuses of Campaigns


I'm using the node-mailjet api, and I'm trying to use it to get a list of email statuses for each marketing campaign.

If you go on a sent marketing campaign in Mailjet itself, there's a place where you can download a csv, the list of all contacts the campaign was sent to, and the status of each email ( delivered/opened/clicked/bounce/spam/ etc.)

So, using the API, I'm currently able to get a list of all the marketing campaigns, but I don't see a way of getting the same data as the csv I described above.

I've been looking at the documentation here, no luck so far.


Solution

  • You would have to use the /message resource in this case with a combination of some filters like the CampaignID one were you would give the Campaign for which you would like to check all the messages within.

    That would give you an digest stats for all the messages generated by the Campaign. Within the response you would be able to see the Contact as well as the Status of the message, exactly like the CSV that you would download from front-end. You could also filter upon Status as well using the /message resource.

    Here is the Reference to the resource along with all the available filters.