Réservez votre domaine






Automatisation par batch-mail


Ce système vous permet de convertir vos points en commandes et d'effectuer des opérations sur vos services.

Le procédé de conversion se fait par l'envoi d'un mail formaté à l'adresse batch@ovh.com, ou par l'utlisation de SOAPI. Ce mail devra correspondre à une syntaxe définie ci-dessous et être authentifié par une des méthode suivante : mot de passe, signature MD5, PGP ou SMIME.

Synoptique à suivre:
  • 1. créez votre commande/opération en suivant la syntaxe définie ci-dessous
  • 2. authentifiez votre commande par une des méthodes suivantes : mot de passe, signature MD5, PGP ou SMIME
  • 3. envoyez votre commande/opération par mail à batch@ovh.com
    (utilisez batch-test@ovh.com si vous voulez effectuer un test)

Pour créer votre mail, voici les règles à respecter:
  • Le système de pré-paiement ne comprend que les mails formatés et envoyés en text/plain sur batch@ovh.com
  • Si vous utilisez l'authentification MD5, les signatures doivent être ajoutées à la fin de l'email en text/plain.
  • N'attachez pas de pièce jointe.

N'hésitez pas à utiliser l'adresse batch-test@ovh.com qui vous permet de simuler la commande/opération et donc de vous familiariser avec le système de mails.

Un assistant générateur de batch-mail est à votre disposition dans le manager, section Administration > Espace fidélité/revendeur > Outils d'automatisations.






Liste des commandes/opérations disponibles


Création d'un domaine / Rapatriement d'un domaine

## this section specify batch options

batch.version: 4.0
batch.account: XXXXX-ovh
batch.referer: ma-ref-123456
batch.type: orderDomain
batch.auth.method: md5
batch.autopayment: yes

## this section specify order

order.domain.name: ovh.com
order.domain.command: create    # can be: create | transfer | renew
order.hosting.type: 720plan     # can be: none | 90plan | 720plan | xxlplan | mediaplan 
order.offer: gold               # can be: gold | platine | diamond
order.resellerProfile: agent    # can be: none | whiteLabel | agent

## this section specify owner

# give either contact.owner.id or contact.owner.<name|firstname|...>
contact.owner.legalform: corporation # can be: corporation | individual | association | other
contact.owner.vat:
contact.owner.name: XXXX
contact.owner.firstname: XXXXX
contact.owner.organisation: XXX
contact.owner.email: XXX@XXXX.net
contact.owner.address: XXX XXX XXX XXX
contact.owner.city: XXXXXX
contact.owner.zip: XXXXX
contact.owner.country: FR
contact.owner.language: fr
contact.owner.phone: +33.XXXXXXXX
contact.owner.fax:

## this section specify contacts

contact.tech.id: ve174-ovh
# give either contact.tech.id or contact.tech.<name|firstname|...>
contact.admin.id: ve174-ovh
# give either contact.admin.id or contact.admin.<name|firstname|...>
contact.billing.id: ve174-ovh
# give either contact.billing.id or contact.billing.<name|firstname|...>

## this section is mandatory for .fr

option.identification.method: birthPlace # can be: siren | inpi | birthPlace | afnicIdent
option.identification.legalName: XXX
option.identification.legalNumber: 123456789
option.identification.afnicIdent:
option.identification.birthDate: 01/01/2008
option.identification.birthCity: XXXXXX
option.identification.birthDepartement: XX
option.identification.birthCountry: FR

## this section let you specify dns, not needed if you take a sharedHosting

option.dns.group: hosting # can be: hosting | dedicated | external
option.dns.master: dns12.ovh.net
option.dns.slave1: ns12.ovh.net
option.dns.slave2: XXXX.ovh.net 127.0.0.1
option.dns.slave3:
option.dns.slave4:

## authinfo code for gTlds and .pl transfer

option.domain.authinfo: XXXXXXXXXXXXXXX

## allow you protect your whois data in gtlds domain names

option.owo: yes
    
  






Renouvellement d'un domaine

batch.version: 4.0
batch.account: XXXXX-ovh
batch.referer: ma-ref-123456
batch.type: orderDomain
batch.auth.method: md5
batch.autopayment: yes

order.domain.name: ovh.com
order.domain.command: renew

batch.auth.md5: b0a24f10d535d1b9ef40e50e97a0c312
    
  






Appel à une fonction SOAPI : Changement des DNS d'un domaine

    batch.version: 4.0
    batch.account: XXXXXX-ovh
    batch.referer: ma-ref-123456
    batch.type: soapi
    batch.auth.method: md5
    batch.autopayment: yes

    soapi.method: domainDnsUpdate
    soapi.param.domain: ovh.com
    soapi.param.dns1: dns12.ovh.net 
    soapi.param.dns2: ns12.ovh.net
    
  






Explication des méthodes d'authentification




Signature en MD5


C'est une méthode qui se base sur le calcul du hash MD5 de l'email que vous envoyez et de la passphrase que vous avez saisi dans le manager. Pour utiliser cette méthode il suffit de :
  • indiquer que vous souhaitez utiliser la méthode MD5
    batch.auth.method: md5
  • calculer le hash en MD5 de cet email. Vous pouvez utiliser un des scripts, en perl ou en PHP, fournis ci-dessous

  • ajouter à la fin de l'email le hash
    batch.auth.md5: 9b02cb2890ce787fdfeef72473a7a149

Script de génération du MD5 en perl

 #!/usr/bin/perl
 use strict;
 use Digest::MD5 qw(md5_hex);

 # fichier à signer
 my $file = "email.txt";
 
 my $body;
 open (F, $file);
 while(<F>) {
    $body.=$_;
    print $_;
 }
 close(F);

 my $passphrase = "MaPassPhraseQuiEstUnique";
 my $texte_a_hasher = $passphrase.$body;
 $texte_a_hasher =~ s/\s//g;

 # génération du MD5
 my $signature = md5_hex($texte_a_hasher);

 $body .= "batch.auth.md5: $signature\n";
 print $body;
	      
	      


Script de génération du MD5 en PHP

 <?
 // ouverture du fichier source
 $body = @file_get_contents("email.txt");

 // PassPhrase saisie dans le MANAGER
 $passphrase = 'MaPassPhraseQuiEstUnique';

 $texte_a_hasher = preg_replace('/\s/','',$passphrase.$body);

 //génération du MD5
 $signature = md5($texte_a_hasher);
 $body .= 'batch.auth.md5: '.$signature;

 // Affichage du Mail à envoyer
 echo "$body\n" ;
 ?>