1. Mailjet
  2. Support
  3. Documentation

Documentation API

Mailjet Web API

Les communications de et vers notre API passent par des requêtes HTTP(S) GET et POST. Nous utilisons différents formats au choix selon vos affinités : JSON, XML, PHP sérialisé, et CSV pour certaines fonctions d'export. Vous pouvez accéder à notre API depuis à peu près n'importe quel langage de programmation, et ce seulement en quelques minutes grâce à nos librairies prêtes à l'emploi.

Téléchargement

PHP 5.x et supérieur

v0.1 Classe API Publique (.php)
v0.1 Event Api class (.php)

Fonctionnement

1. Éditez vos clefs API dans la classe Mailjet.
2. Effectuez un premier appel rapide pour confirmer que tout fonctionne bien !

userInfos(); // Display your firstname echo $me->infos->firstname; ?>

Urls

The can send or get data via our API functions via two types of requests: GET and POST. Each request made match a method of the API on our servers.
To make the best use of the public API (the one you may have downloaded and installed on your own server), you should understand the difference between GET and POST methods, in which cases and how to use them.

Our public API has been developed to help you formatting queries and interpreting the results (or errors) with the least effort possible.
Still, this documentation will be even more necessary if you want to use your own scripts.

GET Requests

Data recovery is done via GET requests. This means you can specify all the information and options directly into the url.
Your need to specify the method and the function and if needed options necessary for your request.
The URL looks like this :

api.mailjet.com/0.1/methodFunction?option=value

For example, if your want to get the statistics of your message with the ID 123, The final built URL must be :

api.mailjet.com/0.1/campaignStatistics?id=123

POST Requests

Inserting, updating, or deleting data works via the POST methods. These more sensitive methods require authentication via HTTP_AUTH.
POST requests work much like the GET request, the only difference being that the variables passed as parameters must be submitted via a POST request, and will not be visible in the url.

Status code

Essayer Mailjet maintenant ?
Créez un compte - sans engagement, sans frais cachés