Exemples d'API

Requête POST
Méthode sans CURL avec PHP

<?php
$url = 'https://rsXXX-api.realsender.com/mail/send';
$data = array('apiuser' => 'the one we provided you', 'apipass' => 'the one we provided you', 'from' => 'sender@example.com', 'to' => 'recipient@example.com', 'subject' => 'subject of the message', 'text' => 'email body in plain text', 'html' => 'email body in HTML format');

// use key 'http' even if you send the request to https://...
$options = array(
    'http' => array(
        'header'  => "Content-type: application/x-www-form-urlencoded\r\n",
        'method'  => 'POST',
        'content' => http_build_query($data),
    ),
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

var_dump($result);
?>

Requête POST
Méthode CURL

curl -d 'apiuser=celui que nous vous avons fourni&apipass=celui que nous vous avons fourni you&from=sender@example.com&to=recipient@example.com&subject=objet du message&text=corps de l'e-mail en texte brut&html=corps de l'e-mail au format HTML'https://rsXXX-api.realsender.com/mail/send

Exemples d'API avec pièces jointes