Besoin d'aide ?

API : Méthodes sur les abonnées

 

Méthode : get_subscriber

 

Champ Type Description
id integer Identifiant de votre contact
Si ce paramètre est définit, vos autres paramètres ne seront pas pris en compte(Optionnel)
nom string Nom de votre contact(Optionnel)
prenom string Prénom de votre contact(Optionnel)
email string Email de votre contact(Optionnel)
actif integer Etat de l'abonné
0 : Non actif
1 : actif
2 : Résilié
5 : Invalide(Optionnel)
listeid integer Liste contenant votre contact(Optionnel)
dateactif string Date de dernière action de votre contact
Format AAAA-MM-JJ(Optionnel)
inscription_liste string Date d'inscription de votre contact dans votre liste
Format AAAA-MM-JJ ou AAAA-MM(Optionnel)
inscription_compte string Date d'inscription de votre contact sur votre compte
Format AAAA-MM-JJ ou AAAA-MM(Optionnel)
limite array Limite de récupération de données.
Format [0,50](Optionnel)
details boolean Récupère TOUTES les données de votre contacts ou juste le strict minimum.
Format true|false(Optionnel, défaut: false)
                                        
                                           
// Recherche de John Doe, actif, dans la liste 12345.  $sgApi ->set('listeid', 12345) ->set('nom', 'Doe') ->set('prenom', 'John') ->set('actif', 1); //Appel de la méthode  $call = $sgApi->call('get_subscriber');

 

Méthode : set_subscriber

 

Cette méthode sert à inscrire ou mettre un jour un contact.

Pour réinscrire un abonné afin qu'il puisse recevoir à nouveau votre séquence d'email :
  • Supprimez cet abonné avec la méthode del_subscriber et le paramètre : motifdesabonnement -> 'api_sg'
  • Ajoutez à nouveau les coordonnées de votre contact avec la méthode set_subscriber
  • Pour forcer la date d'inscription : 
    • Mettre comme valeur pour le champ 15 : 'forcerladate' ( ->set('champs_15', 'forcerladate') )
    • Mettre comme valeur pour le champ 16 : Votre date au format 'yyyy-mm-dd' ( ->set('champs_16', '1970-01-01') )

 

Champ Type Description
email string Adresse email à inscrire
Paramètre requis
listeid integer Liste de destination
Paramètre requis
prenom string Prénom de votre contact(Optionnel)
nom string Prénom de votre contact(Optionnel)
civilite string Civilité de votre contact(Optionnel)
adresse string Adresse postale de votre contact(Optionnel)
codepostal integer Code postal de votre contact(Optionnel)
ville string Ville de votre contact(Optionnel)
pays string Pays de votre contact(Optionnel)
siteweb string Site web de votre contact(Optionnel)
telephone string Téléphone fixe de votre contact(Optionnel)
mobile string Téléphone mobile de votre contact(Optionnel)
skype string Adresse skype de votre contact(Optionnel)
pseudo string Pseudo de votre contact(Optionnel)
datenaissance string Date de naissance de votre contact
Type AAAA-MM-JJ(Optionnel)
ip string Adresse IP de votre contact
Paramètre requis
Sinon, ce sera l'adresse IP de votre serveur qui sera enregistrée comme appartenant à votre contact. Hors, notre système de sécurité applique par défaut une restriction de 50 inscriptions par adresse IP (sauf dérogation exceptionnelle).(Optionnel)
parrain string Parrain de votre contact(Optionnel)
champs_1 string Champ personnalisé 1(Optionnel)
champs_2 string Champ personnalisé 2(Optionnel)
champs_3 string Champ personnalisé 3(Optionnel)
champs_4 string Champ personnalisé 4(Optionnel)
champs_5 string Champ personnalisé 5(Optionnel)
champs_6 string Champ personnalisé 6(Optionnel)
champs_7 string Champ personnalisé 7(Optionnel)
champs_8 string Champ personnalisé 8(Optionnel)
champs_9 string Champ personnalisé 9(Optionnel)
champs_10 string Champ personnalisé 10(Optionnel)
champs_11 string Champ personnalisé 11(Optionnel)
champs_12 string Champ personnalisé 12(Optionnel)
champs_13 string Champ personnalisé 13(Optionnel)
champs_14 string Champ personnalisé 14(Optionnel)
champs_15 string Champ personnalisé 15(Optionnel)
champs_16 string Champ personnalisé 16(Optionnel)
urlvisite string Provenance de votre contact (Optionnel)
                                        
                                           
// Ajout de John Doe dans la liste 12345. $sgApi ->set('listeid', 12345) ->set('nom', 'Doe') ->set('prenom', 'John') ->set('email', 'John.Doe@domain.ext') ->set('champs_1', 'test') ->set('ip', $_SERVER["REMOTE_ADDR"]); $call = $sgApi->call('set_subscriber');

Méthode : del_subscriber

 

Cette méthode sert à désinscrire un contact.

 

Champ Type Description
email string Adresse email à inscrire
Paramètre requis
listeid integer Liste de destination
Paramètre requis
motifdesabonnement string Motif de désabonnement :
plus_interesse
trop_de_messages
pas_le_temps
spam
api_sg
autre
duree_desinscription integer Durée de la désinscription (en jours)
0 = Désinscription définitive
force type Booléen Sert à supprimer le contact
                                        
                                           
// Suppression de John Doe de la liste 12345. $sgApi ->set('listeid', 12345) ->set('email', 'John.Doe@domain.ext') ->set('force', true); $call = $sgApi->call('del_subscriber');

Questions relatives