# Messages Calls

## Introduction

This is a key part of both APIs, since it is from here that you will be able to trigger transactional email.
The key Mailjet API resources in that section are `/send/message` and [`/message`](/docs/api-reference/email-api/categories/messages/).

Mailjet's Send API allows you to send transactional emails using our HTTP API, using POST requests. This solution is aimed at users needing a programmatically way to send messages.

Send API allows you to send single messages but also to mutualise the calls by leveraging templating and personalization of the content.

The API will return a simple response indicating if the message is ready to be processed by the Mailjet system. This makes the error management on your side simple and efficient.

Our Send API offers templating features, similar to the Mandrill one. Please refer to our [dedicated API guide](/docs/email-api/send-api-v31/send-basic-email/) here.

## Send

Info
Maps to /messages/send.json

Python
```python
from mailjet import Client
import os
api_key = os.environ['MJ_APIKEY_PUBLIC']
api_secret = os.environ['MJ_APIKEY_PRIVATE']
mailjet = Client(auth=(api_key, api_secret))
data = {
	'FromEmail': 'pilot@mailjet.com',
	'FromName': 'Mailjet Pilot',
	'Subject': 'Your email flight plan!',
	'Text-part': 'Dear passenger, welcome to Mailjet! May the delivery force be with you!',
	'Html-part': '<h3>Dear passenger, welcome to Mailjet!</h3><br />May the delivery force be with you!',
	'Recipients': [{'Email':'passenger@mailjet.com'}]
}
result = mailjet.send.create(data=data)
print result.status_code
print result.json()
```

Go
```go
/*
This calls sends an email to one recipient.
*/
package main
import (
	"fmt"
	. "github.com/mailjet/mailjet-apiv3-go"
	"github.com/mailjet/mailjet-apiv3-go/resources"
	"os"
)
func main () {
	mailjetClient := NewMailjetClient(os.Getenv("MJ_APIKEY_PUBLIC"), os.Getenv("MJ_APIKEY_PRIVATE"))
	email := &MailjetSendMail {
      FromEmail: "pilot@mailjet.com",
      FromName: "Mailjet Pilot",
      Subject: "Your email flight plan!",
      TextPart: "Dear passenger, welcome to Mailjet! May the delivery force be with you!",
      HtmlPart: "<h3>Dear passenger, welcome to Mailjet!</h3><br />May the delivery force be with you!",
      Recipients: []MailjetRecipient {
        MailjetRecipient {
          Email: "passenger@mailjet.com",
        },
      },
    }
	res, err := mailjetClient.SendMail(email)
	if err != nil {
			fmt.Println(err)
	} else {
			fmt.Println("Success")
			fmt.Println(res)
	}
}
```

PHP
```php
<?php
require 'vendor/autoload.php';
use \Mailjet\Resources;
$mj = new \Mailjet\Client(getenv('MJ_APIKEY_PUBLIC'), getenv('MJ_APIKEY_PRIVATE'));
$body = [
    'FromEmail' => "pilot@mailjet.com",
    'FromName' => "Mailjet Pilot",
    'Subject' => "Your email flight plan!",
    'Text-part' => "Dear passenger, welcome to Mailjet! May the delivery force be with you!",
    'Html-part' => "<h3>Dear passenger, welcome to Mailjet!</h3><br />May the delivery force be with you!",
    'Recipients' => [
        [
            'Email' => "passenger@mailjet.com"
        ]
    ]
];
$response = $mj->post(Resources::$Email, ['body' => $body]);
$response->success() && var_dump($response->getData());
?>
```

Ruby
```ruby
Mailjet.configure do |config|
  config.api_key = ENV['MJ_APIKEY_PUBLIC']
  config.secret_key = ENV['MJ_APIKEY_PRIVATE']
  config.default_from = 'your default sending address'
end
variable = Mailjet::Send.create(
		from_email: "pilot@mailjet.com",
		from_name: "Mailjet Pilot",
		subject: "Your email flight plan!",
		text_part: "Dear passenger, welcome to Mailjet! May the delivery force be with you!",
		html_part: "<h3>Dear passenger, welcome to Mailjet!</h3><br />May the delivery force be with you!",
		recipients: [{ 'Email'=> 'passenger@mailjet.com'}])
```

Java
```java
package MyClass;
import com.mailjet.client.errors.MailjetException;
import com.mailjet.client.MailjetClient;
import com.mailjet.client.MailjetRequest;
import com.mailjet.client.MailjetResponse;
import com.mailjet.client.resource.Email;
public class MyClass {
    /**
     * This calls sends an email to one recipient.
     */
    public static void main(String[] args) throws MailjetException {
      MailjetClient client;
      MailjetRequest request;
      MailjetResponse response;
      client = new MailjetClient("api key", "api secret");
      request = new MailjetRequest(Email.resource)
						.property(Email.FROMEMAIL, "pilot@mailjet.com")
						.property(Email.FROMNAME, "Mailjet Pilot")
						.property(Email.SUBJECT, "Your email flight plan!")
						.property(Email.TEXTPART, "Dear passenger, welcome to Mailjet! May the delivery force be with you!")
						.property(Email.HTMLPART, "<h3>Dear passenger, welcome to Mailjet!</h3><br />May the delivery force be with you!")
						.property(Email.RECIPIENTS, new JSONArray()
                .put(new JSONObject()
                    .put("Email", "passenger@mailjet.com")));
      response = client.post(request);
      System.out.println(response.getStatus());
      System.out.println(response.getData());
    }
}
```

Bash
```bash
# This calls sends an email to one recipient.
curl -s \
	-X POST \
	--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
	https://api.mailjet.com/v3/send \
	-H 'Content-Type: application/json' \
	-d '{
		"FromEmail":"pilot@mailjet.com",
		"FromName":"Mailjet Pilot",
		"Subject":"Your email flight plan!",
		"Text-part":"Dear passenger, welcome to Mailjet! May the delivery force be with you!",
		"Html-part":"<h3>Dear passenger, welcome to Mailjet!</h3><br />May the delivery force be with you!",
		"Recipients":[{"Email":"passenger@mailjet.com"}]
	}'
```

Node.js
```javascript
/**
 *
 * This calls sends an email to one recipient.
 *
 */
var mailjet = require('node-mailjet').connect(
  process.env.MJ_APIKEY_PUBLIC,
  process.env.MJ_APIKEY_PRIVATE
)
var request = mailjet.post('send').request({
  FromEmail: 'pilot@mailjet.com',
  FromName: 'Mailjet Pilot',
  Subject: 'Your email flight plan!',
  'Text-part':
    'Dear passenger, welcome to Mailjet! May the delivery force be with you!',
  'Html-part':
    '<h3>Dear passenger, welcome to Mailjet!</h3><br />May the delivery force be with you!',
  Recipients: [{ Email: 'passenger@mailjet.com' }],
})
request
  .on('success', function(response, body) {
    console.log(response.statusCode, body)
  })
  .on('error', function(err, response) {
    console.log(response.statusCode, err)
  })
```

```json
{
  "Sent": [
    {
      "Email": "passenger@mailjet.com",
      "MessageID": 111111111111111
    }
  ]
}
```

Here are the Mailjet Send API properties definitions, along with samples in all the languages we support through our official libraries.

| Property Name | Description |
|  --- | --- |
| FromEmail | Must be a valid, activated and registered sender for this account |
| May include the name part: `john@example.com` or `&lt;john@example.com&gt;` or `"John Doe" &lt;john@example.com&gt;` |  |
| **MANDATORY - MAX FROM: 1** |  |
| FromName | Must be a valid, activated and registered sender for this account |
| May include the name part: `john@example.com` or `&lt;john@example.com&gt;` or `"John Doe" &lt;john@example.com&gt;` |  |
| **MANDATORY - MAX FROM: 1** |  |
| Sender | This can be set only on given API Keys. Contact the [support team](https://app.mailjet.com/support/ticket) if you want us to enable this setting on your account. |
| Must be a valid active sender for this account. |  |
| Perform a simple GET on resource `/sender` to view a list of allowed senders for your account, or within the Mailjet Account Settings under [Sender Addresses](https://app.mailjet.com/account/sender) |  |
| **MAX SENDER: 1** |  |
| Recipients | List of recipients, must include at least a property `Email` in each element |
| Sample: `[{"Email":"passenger@mailjet.com","Name":"passenger"}]` |  |
| **MANDATORY** |  |
| To | May include the name part: `john@example.com` or `&lt;john@example.com&gt;` or `"John Doe" &lt;john@example.com&gt;` |
| If a recipient is specified twice (in the to, cc, or bcc), it is counted only once. |  |
| Can be a magic list @lists.mailjet.com. See the `Address` [contactslist](/docs/api-reference/email-api/categories/contacts/) property. |  |
| **MAX RECIPIENTS: 50** |  |
| Cc, Bcc | May include the name part: `john@example.com` or `&lt;john@example.com&gt;` or `"John Doe" &lt;john@example.com&gt;` |
| If one recipient is specified twice, it will be counted as one only (including to, cc, bcc) |  |
| **MAX RECIPIENTS: 50** |  |
| **Cc and Bcc can't be used in conjunction with Recipients property** |  |
| Subject | At least 1 char, maximum length is 255 chars |
| **MANDATORY - MAX SUBJECTS: 1** |  |
| Text-part | Provides the Text part of the message |
| Mandatory if the HTML param is not specified |  |
| **MANDATORY IF NO HTML - MAX PARTS: 1** |  |
| Html-part | Provides the HTML part of the message |
| Mandatory if the text param is not specified |  |
| **MANDATORY IF NO TEXT - MAX PARTS: 1** |  |
| Mj-TemplateID | The Template ID or Name to be used as content for this email. Overrides the HTML/Text parts if any. |
| **MANDATORY IF NO HTML/TEXT - MAX TEMPLATEID: 1** |  |
| Mj-TemplateLanguage | Activate the template language processing. By default the template language processing is desactivated. Use `True` to activate. |
| Equivalent to using the X-MJ-TemplateLanguage header through SMTP. |  |
| [More information](#use-the-template-in-send-api) |  |
| MJ-TemplateErrorReporting | Email Address where a carbon copy with error message is sent to. |
| Equivalent to using the X-MJ-TemplateErrorReporting header through SMTP. |  |
| [More information](#templates-error-management) |  |
| MJ-TemplateErrorDeliver | Define if the message is delivered if an error is discovered in the templating language. By default the delivery is desactivated. Use `deliver` to let the message be delivered to the recipient, `0` to stop it. |
| Equivalent to using the X-MJ-TemplateErrorDeliver header through SMTP. |  |
| [More information](#templates-error-management) |  |
| Attachments | Attach files automatically to this Email |
| Sum of all attachments, including inline may not exceed 15 MB total |  |
| Sample: [{"Content-type": "MIME TYPE", "Filename": "FILENAME.EXT", "content":"BASE64 ENCODED CONTENT"}] |  |
| Inline_attachments | Attach a file for inline use via `cid:FILENAME.EXT` |
| Sum of all attachements, including inline may not exceed 15 MB total |  |
| Sample: [{"Content-type": "MIME TYPE", "Filename": "FILENAME.EXT", "content":"BASE64 ENCODED CONTENT"}] |  |
| Mj-prio | Manage message processing priority inside your account (API key) scheduling queue. |
| Default is `2` as in the SMTP submission. |  |
| Equivalent of using `X-Mailjet-Prio` header through SMTP |  |
| [More information](https://app.mailjet.com/docs/email-priority-management) |  |
| Mj-campaign | Groups multiple messages in one campaign |
| Equivalent of using `X-Mailjet-Campaign` header through SMTP. |  |
| [More information](https://app.mailjet.com/docs/emails_headers) |  |
| Mj-deduplicatecampaign | Block/unblock messages to be sent multiple times inside one campaign to the same contact. |
| 0: unblocked (default behavior) - 1: blocked |  |
| Equivalent of using `X-Mailjet-DeduplicateCampaign` header through SMTP. |  |
| Can only be used if mj-campaign is specified. |  |
| [More information](https://app.mailjet.com/docs/emails_headers) |  |
| Mj-trackopen | Force or disable open tracking on this message, overriding preferences. |
| Equivalent of using `X-Mailjet-TrackOpen` header through SMTP. |  |
| Can only be used with a HTML part. |  |
| [More information](https://app.mailjet.com/docs/emails_headers) |  |
| Mj-trackclick | Force or disable click tracking on this message, overriding preferences. |
| Equivalent to using the `X-Mailjet-TrackClick` header through SMTP. |  |
| Can only be specified if the HTML part is provided. |  |
| [More information](https://app.mailjet.com/docs/emails_headers) |  |
| Mj-CustomID | Attach a custom ID to the message |
| Equivalent to using the X-MJ-CustomID header through SMTP. |  |
| [More information](#sending-an-email-with-a-custom-id) |  |
| Mj-EventPayLoad | Attach a payload to the message |
| Equivalent to using the X-MJ-EventPayload header through SMTP. |  |
| [More information](#sending-an-email-with-a-payload) |  |
| Headers | Add lines to the email headers |
| List of headers as `"property":"value"` pairs |  |
| Notice: overriding values of header properties (ie: subject) |  |
| Sample: `{"X-My-Header":"my own value", "X-My-Header-2":"my own value 2"}` |  |
| Vars | Global variables used for personalisation |
| Messages | List of messages |
| Used for bulk emailing. |  |
| [More information](#sending-in-bulk) |  |


## Send-Template

Info
Maps to /messages/send-template.json

Java
```java
package MyClass;
import com.mailjet.client.errors.MailjetException;
import com.mailjet.client.errors.MailjetClient;
import com.mailjet.client.errors.MailjetRequest;
import com.mailjet.client.errors.MailjetResponse;
import com.mailjet.client.resource.Email;
public class MyClass {
    /**
     * This calls sends an email to one recipient.
     */
    public static void main(String[] args) throws MailjetException {
      MailjetClient client;
      MailjetRequest request;
      MailjetResponse response;
      client = new MailjetClient("api key", "api secret");
      request = new MailjetRequest(Email.resource)
						.property(Email.FROMEMAIL, "pilot@mailjet.com")
						.property(Email.FROMNAME, "Mailjet Pilot")
						.property(Email.MJTEMPLATEID, 1)
						.property(Email.MJTEMPLATELANGUAGE, true)
						.property(Email.SUBJECT, "Your email flight plan!")
						.property(Email.RECIPIENTS, new JSONArray()
                .put(new JSONObject()
                    .put("Email", "passenger@mailjet.com")))
						.property(Email.MJEVENTPAYLOAD, "Eticket,1234,row,15,seat,B");
      response = client.post(request);
      System.out.println(response.getStatus());
      System.out.println(response.getData());
    }
}
```

PHP
```php
<?php
require 'vendor/autoload.php';
use \Mailjet\Resources;
$mj = new \Mailjet\Client(getenv('MJ_APIKEY_PUBLIC'), getenv('MJ_APIKEY_PRIVATE'));
$body = [
    'FromEmail' => "pilot@mailjet.com",
    'FromName' => "Mailjet Pilot",
    'Subject' => "Your email flight plan!",
    'MJ-TemplateID' => 1,
    'MJ-TemplateLanguage' => true,
    'Recipients' => [['Email' => "passenger@mailjet.com"]]
];
$response = $mj->post(Resources::$Email, ['body' => $body]);
$response->success() && var_dump($response->getData());
?>
```

Bash
```bash
# This calls sends an email to one recipient.
curl -s \
	-X POST \
	--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
	https://api.mailjet.com/v3/send \
	-H 'Content-Type: application/json' \
	-d '{
		"FromEmail":"pilot@mailjet.com",
		"FromName":"Mailjet Pilot",
		"Subject":"Your email flight plan!",
		"MJ-TemplateID":"1",
		"MJ-TemplateLanguage":true,
		"Recipients":[
				{
						"Email": "passenger@mailjet.com"
				}
		]
	}'
```

Node.js
```javascript
/**
 *
 * This calls sends an email to one recipient.
 *
 */
var mailjet = require('node-mailjet').connect(
  process.env.MJ_APIKEY_PUBLIC,
  process.env.MJ_APIKEY_PRIVATE
)
var request = mailjet.post('send').request({
  FromEmail: 'pilot@mailjet.com',
  FromName: 'Mailjet Pilot',
  Subject: 'Your email flight plan!',
  'MJ-TemplateID': '1',
  'MJ-TemplateLanguage': 'true',
  Recipients: [
    {
      Email: 'passenger@mailjet.com',
    },
  ],
})
request
  .on('success', function(response, body) {
    console.log(response.statusCode, body)
  })
  .on('error', function(err, response) {
    console.log(response.statusCode, err)
  })
```

Ruby
```ruby
# This calls sends an email to one recipient.
Mailjet.configure do |config|
  config.api_key = ENV['MJ_APIKEY_PUBLIC']
  config.secret_key = ENV['MJ_APIKEY_PRIVATE']
  config.default_from = 'your default sending address'
end
variable = Mailjet::Send.create(
  from_email: "pilot@mailjet.com",
  from_name: "Mailjet Pilot",
  subject: "Your email flight plan!",
  "Mj-TemplateID": "1",
  "Mj-TemplateLanguage": true,
  recipients: [{ 'Email'=> 'passenger@mailjet.com'}]
)
```

Python
```python
"""
This calls sends an email to one recipient.
"""
from mailjet import Client
import os
api_key = os.environ['MJ_APIKEY_PUBLIC']
api_secret = os.environ['MJ_APIKEY_PRIVATE']
mailjet = Client(auth=(api_key, api_secret))
data = {
  'FromEmail': 'pilot@mailjet.com',
  'FromName': 'Mailjet Pilot',
  'Subject': 'Your email flight plan!',
  'MJ-TemplateID': '1',
  'MJ-TemplateLanguage': true,
  'Recipients': [
				{
						"Email": "passenger@mailjet.com"
				}
		]
}
result = mailjet.send.create(data=data)
print result.status_code
print result.json()
```

Go
```go
/*
This calls sends an email to one recipient.
*/
package main
import (
	"fmt"
	. "github.com/mailjet/mailjet-apiv3-go"
	"os"
)
func main () {
	mailjetClient := NewMailjetClient(os.Getenv("MJ_APIKEY_PUBLIC"), os.Getenv("MJ_APIKEY_PRIVATE"))
	email := &MailjetSendMail {
      FromEmail: "pilot@mailjet.com",
      FromName: "Mailjet Pilot",
      Subject: "Your email flight plan!",
      MJTemplateID: 1,
      MJTemplateLanguage: "true",
      Recipients: []MailjetRecipient {
        MailjetRecipient {
          Email: "passenger@mailjet.com",
        },
      },
    },
	res, err := mailjetClient.SendMail(email)
	if err != nil {
			fmt.Println(err)
	} else {
			fmt.Println("Success")
			fmt.Println(res)
	}
}
```

```json
{
  "Sent": [
    {
      "Email": "passenger@mailjet.com",
      "MessageID": 111111111111111
    }
  ]
}
```

First, please visit our [Templates](http://10.0.10.150:4567/#templates-calls) dedicated section to learn how to create and store templates with the Mailjet API.

Use the `Mj-TemplateID` property in your Send API payload to specify the `ID` of the the template you created.

You must set the `Mj-TemplateLanguage` property in the payload at `true` to have the templating language interpreted.

Mailjet offers a templating language to customize the content of your messages, based on conditions and loops. Please visit our dedicated [API guide section](/docs/email-api/template_language/template_lang_overview/) to learn more.

## Search

Info
Maps to /messages/search.json

The response payload of a Send API call will provide you with the `MessageID` of your messages. You can use this `MessageID` to access information and statistics about the message.

PHP
```php
<?php
require 'vendor/autoload.php';
use \Mailjet\Resources;
$mj = new \Mailjet\Client(getenv('MJ_APIKEY_PUBLIC'), getenv('MJ_APIKEY_PRIVATE'));
$response = $mj->get(Resources::$Message, ['id' => $id]);
$response->success() && var_dump($response->getData());
?>
```

Bash
```bash
# View : Details of a specific Message (e-mail) processed by Mailjet
curl -s \
	-X GET \
	--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
	https://api.mailjet.com/v3/REST/message/$ID_MESSAGE
```

Node.js
```javascript
/**
 *
 * View : Details of a specific Message (e-mail) processed by Mailjet
 *
 */
var mailjet = require('node-mailjet').connect(
  process.env.MJ_APIKEY_PUBLIC,
  process.env.MJ_APIKEY_PRIVATE
)
var request = mailjet
  .get('message')
  .id($ID_MESSAGE)
  .request()
request
  .on('success', function(response, body) {
    console.log(response.statusCode, body)
  })
  .on('error', function(err, response) {
    console.log(response.statusCode, err)
  })
```

Ruby
```ruby
# View : Details of a specific Message (e-mail) processed by Mailjet
Mailjet.configure do |config|
  config.api_key = ENV['MJ_APIKEY_PUBLIC']
  config.secret_key = ENV['MJ_APIKEY_PRIVATE']
  config.default_from = 'your default sending address'
end
variable = Mailjet::Message.find($ID_MESSAGE)
```

Python
```python
"""
View : Details of a specific Message (e-mail) processed by Mailjet
"""
from mailjet_rest import Client
import os
api_key = os.environ['MJ_APIKEY_PUBLIC']
api_secret = os.environ['MJ_APIKEY_PRIVATE']
mailjet = Client(auth=(api_key, api_secret))
id = '$ID_MESSAGE'
result = mailjet.message.get(id=id)
print result.status_code
print result.json()
```

Go
```go
/*
View : Details of a specific Message (e-mail) processed by Mailjet
*/
package main
import (
	"fmt"
	. "github.com/mailjet/mailjet-apiv3-go"
	"github.com/mailjet/mailjet-apiv3-go/resources"
	"os"
)
func main () {
	mailjetClient := NewMailjetClient(os.Getenv("MJ_APIKEY_PUBLIC"), os.Getenv("MJ_APIKEY_PRIVATE"))
	var data []resources.Message
	mr := &MailjetRequest{
	  Resource: "message",
	  ID: RESOURCE_ID,
	}
	err := mailjetClient.Get(mr, &data)
	if err != nil {
	  fmt.Println(err)
	}
	fmt.Printf("Data array: %+v\n", data)
}
```

Java
```java
package com.my.project;
import com.mailjet.client.errors.MailjetException;
import com.mailjet.client.MailjetClient;
import com.mailjet.client.MailjetRequest;
import com.mailjet.client.MailjetResponse;
import com.mailjet.client.resource.Message;
public class MyClass {
    /**
     * View : Details of a specific Message (e-mail) processed by Mailjet
     */
    public static void main(String[] args) throws MailjetException {
      MailjetClient client;
      MailjetRequest request;
      MailjetResponse response;
      client = new MailjetClient("api key", "api secret");
      request = new MailjetRequest(Message.resource, ID);
      response = client.get(request);
      System.out.println(response.getStatus());
      System.out.println(response.getData());
    }
}
```

```json
{
  "Count": 1,
  "Data": [
    {
      "ArrivedAt": "2015-07-06T07:10:24Z",
      "AttachmentCount": "0",
      "AttemptCount": "0",
      "CampaignID": "51",
      "ContactID": "45",
      "Delay": "0",
      "DestinationID": "14",
      "FilterTime": "61",
      "FromID": "1",
      "ID": "16888509234525280",
      "IsClickTracked": "false",
      "IsHTMLPartIncluded": "false",
      "IsOpenTracked": "false",
      "IsTextPartIncluded": "false",
      "IsUnsubTracked": "false",
      "MessageSize": "20248",
      "SpamassassinScore": "0",
      "SpamassRules": "",
      "StateID": "0",
      "StatePermanent": "false",
      "Status": "sent"
    }
  ],
  "Total": 1
}
```

Perform a GET on `[/message](/docs/api-reference/email-api/categories/messages/)` to get basic information about a message, such as the contact it was sent to, who it was sent by, if there were any attachments and how large the message was.

The `StateID` property shows the current status the messages are in.

## Search-Time-Series

Info
Maps to /messages/search-time-series.json

### Filter by time range

Leveraging the `FromTs` and `ToTs` query filters of the [`message`](/docs/api-reference/email-api/categories/messages/) API resource, you can find messages matching the period. These filters expect UNIX epoch timestamp.

### Filter by tag (custom ID)

You can find all the messages associated to a given custom ID (limited to 1 per message at the moment) through the `CustomID` query filter of the [`messagesentstatistics`](/docs/api-reference/email-api/categories/messages/) resource.

### Filter by sender domain

You can filter all the messages sent from a given domain using the `FromID` query filter of the [`messagesentstatistics`](/docs/api-reference/email-api/categories/messages/) resource. The ID refers to a valid [sender](/docs/api-reference/email-api/categories/sender-addresses-and-domains/) resource

## Info

Info
Maps to /messages/info.json

PHP
```php
<?php
require 'vendor/autoload.php';
use \Mailjet\Resources;
$mj = new \Mailjet\Client(getenv('MJ_APIKEY_PUBLIC'), getenv('MJ_APIKEY_PRIVATE'));
$response = $mj->get(Resources::$Message, ['id' => $id]);
$response->success() && var_dump($response->getData());
?>
```

Bash
```bash
# View : Details of a specific Message (e-mail) processed by Mailjet
curl -s \
	-X GET \
	--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
	https://api.mailjet.com/v3/REST/message/$ID_MESSAGE
```

Node.js
```javascript
/**
 *
 * View : Details of a specific Message (e-mail) processed by Mailjet
 *
 */
var mailjet = require ('node-mailjet')
	.connect(process.env.MJ_APIKEY_PUBLIC, process.env.MJ_APIKEY_PRIVATE)
var request = mailjet
	.get("message")
	.id($ID_MESSAGE)
	.request();
request
	.on('success', function (response, body) {
		console.log (response.statusCode, body);
	})
	.on('error', function (err, response) {
		console.log (response.statusCode, err);
	});
```

Ruby
```ruby
# View : Details of a specific Message (e-mail) processed by Mailjet
Mailjet.configure do |config|
  config.api_key = ENV['MJ_APIKEY_PUBLIC']
  config.secret_key = ENV['MJ_APIKEY_PRIVATE']
  config.default_from = 'your default sending address'
end
variable = Mailjet::Message.find($ID_MESSAGE)
```

Python
```python
"""
View : Details of a specific Message (e-mail) processed by Mailjet
"""
from mailjet_rest import Client
import os
api_key = os.environ['MJ_APIKEY_PUBLIC']
api_secret = os.environ['MJ_APIKEY_PRIVATE']
mailjet = Client(auth=(api_key, api_secret))
id = '$ID_MESSAGE'
result = mailjet.message.get(id=id)
print result.status_code
print result.json()
```

Go
```go
/*
View : Details of a specific Message (e-mail) processed by Mailjet
*/
package main
import (
	"fmt"
	. "github.com/mailjet/mailjet-apiv3-go"
	"github.com/mailjet/mailjet-apiv3-go/resources"
	"os"
)
func main () {
	mailjetClient := NewMailjetClient(os.Getenv("MJ_APIKEY_PUBLIC"), os.Getenv("MJ_APIKEY_PRIVATE"))
	var data []resources.Message
	mr := &MailjetRequest{
	  Resource: "message",
	  ID: RESOURCE_ID,
	}
	err := mailjetClient.Get(mr, &data)
	if err != nil {
	  fmt.Println(err)
	}
	fmt.Printf("Data array: %+v\n", data)
}
```

Java
```java
package com.my.project;
import com.mailjet.client.errors.MailjetException;
import com.mailjet.client.MailjetClient;
import com.mailjet.client.MailjetRequest;
import com.mailjet.client.MailjetResponse;
import com.mailjet.client.resource.Message;
public class MyClass {
    /**
     * View : Details of a specific Message (e-mail) processed by Mailjet
     */
    public static void main(String[] args) throws MailjetException {
      MailjetClient client;
      MailjetRequest request;
      MailjetResponse response;
      client = new MailjetClient("api key", "api secret");
      request = new MailjetRequest(Message.resource, ID);
      response = client.get(request);
      System.out.println(response.getStatus());
      System.out.println(response.getData());
    }
}
```

```json
{
  "Count": 1,
  "Data": [
    {
      "ArrivedAt": "2015-07-06T07:10:24Z",
      "AttachmentCount": "0",
      "AttemptCount": "0",
      "CampaignID": "51",
      "ContactID": "45",
      "Delay": "0",
      "DestinationID": "14",
      "FilterTime": "61",
      "FromID": "1",
      "ID": "16888509234525280",
      "IsClickTracked": "false",
      "IsHTMLPartIncluded": "false",
      "IsOpenTracked": "false",
      "IsTextPartIncluded": "false",
      "IsUnsubTracked": "false",
      "MessageSize": "20248",
      "SpamassassinScore": "0",
      "SpamassRules": "",
      "StateID": "0",
      "StatePermanent": "false",
      "Status": "sent"
    }
  ],
  "Total": 1
}
```

Issue a GET request to [`message`](/docs/api-reference/email-api/categories/messages/) containing the ID which was returned by our Send API