Skip to content
Last updated

Retrieve Sent Message

Retrieving a sent message allows you to view the status of the sent message and its configuration specifics.

Example

# Run :
curl -s \
	-X GET \
	--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
	https://api.mailjet.com/v3/REST/message/$MESSAGE_ID

API Response Example

{
  "Count": "1",
  "Data": [
    {
      "ArrivedAt": "2018-01-01T00:00:00",
      "AttachmentCount": "1",
      "AttemptCount": "1",
      "CampaignID": "123456789",
      "ContactAlt": "",
      "ContactID": "987654",
      "FilterTime": "111",
      "ID": "1234567890987654321",
      "Status": "clicked",
      "Subject": "",
      "UUID": "1ab23cd4-e567-8901-2345-6789f0gh1i2j"
      "........................."
    }
  ],
  "Total": "1"
}

As you can see, the information about the message is quite detailed and includes, among other things:

  • The time the message arrived
  • The contact, to which it was sent
  • Message size
  • Number of attachments
  • Current message status (e.g. sent, opened, clicked, etc.)

In case you want to view the contact email address, or the Subject of the email, add the ShowContactAlt=true and ShowSubject=true as query parameters, respectively.

Alternatively, you can retrieve messages sent to a specific recipient email address, using a query parameter:

# Run :
curl -s \
	-X GET \
	--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
	https://api.mailjet.com/v3/REST/message?ContactAlt=$RECIPIENT_EMAIL