Skip to content

Instantly share code, notes, and snippets.

View expressmailing's full-sized avatar

Express-Mailing expressmailing

View GitHub Profile
<?php
// Création du batch sms (1 contenu + 1 destinataire)
// --------------------------------------------------
$batch = array();
$batch['defaults'] = array("message" => "Hello world !");
$batch['recipients'] = array();
$batch['recipients'][] = array("target" => "0612345678", "countryCode": "FR");
// Préparation de l'appel à l'API Express-Mailing
{
"status": "ok",
"result": {
"batchId": 19,
"batchRef": null,
"created": "2018-09-26T07:36:28.000Z",
"updated": "2018-09-26T07:36:28.000Z",
"state": "creating",
"stateDetail": "Batch en cours de traitement."
}
@expressmailing
expressmailing / mon_premier_test_sms_batch.json
Last active December 27, 2018 15:36
POST /sms/ Envoyez votre 1er sms
{
"defaults": {
"message": "Mon premier test sms !"
},
"recipients": [
{
"target": "0612345678",
"countryCode": "FR"
}
]
@expressmailing
expressmailing / send_multi_recipients_sms_batch
Last active November 22, 2018 16:13
POST /sms/ Envois multiples
JSON BODY :
{
"message": "Hello world !",
"defaults": {
"countryCode": "FR"
},
"recipients": [
{ "target": "06xxxxxxx1" },
{ "target": "06xxxxxxx2" },
{ "target": "06xxxxxxx3" },
@expressmailing
expressmailing / send_voice_message_unit.cs
Created January 4, 2018 16:05
Exemple en C# d'envoi de message vocal unitaire
static void Main(string[] args)
{
// Récupération du document en base64
string filename = "test-audio.wav";
byte[] file = System.IO.File.ReadAllBytes(filename);
string binary = System.Convert.ToBase64String(file, 0, file.Length);
// Création du XML à poster
var xml = @"<request login=""your-login"" password=""your-password"">
@expressmailing
expressmailing / api_audio_unit_exemple_push.xml
Created January 4, 2018 16:00
API audio unitaire exemple push
<request login="your-login" password="your-password">
<push media="voice" type="on_demand" name="Envoi audio fixe ou mobile">
<message type="wav">
UklGRpw5AQBXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABA[...]gIB/gIB/gH+A
</message>
<voice_config sender_id="0199999999" />
<recipients>
<add target="+33 100000000" />
</recipients>
</push>
@expressmailing
expressmailing / api_audio_unit_exemple_push.php
Created January 4, 2018 15:32
API audio unitaire exemple push PHP
<?php
// Récupération du document en base64
$filename = 'test-audio.wav';
$binary = fread(fopen($filename, 'r'), filesize($filename));
$binary = base64_encode($binary);
// Création du XML à poster
$xml = '<request login="your-login" password="your-password">
<push media="voice" type="on_demand" name="Test API Audio PHP">
<message type="wav">'.$binary.'</message>
@expressmailing
expressmailing / api_audio_unit_exemple_push.xml
Created January 4, 2018 15:25
API audio unitaire exemple push
<request login="your-login" password="your-password">
<push media="voice" type="on_demand" name="Appel téléphonique en PHP">
<message type="wav">
UklGRpw5AQBXQVZFZm10I[...]gH+A
</message>
<recipients>
<add target="+33 100000000" />
</recipients>
</push>
</request>
@expressmailing
expressmailing / audio_add_redlist.xml
Created January 4, 2018 14:32
Structure de la commande
<personnal_redlist media="voice /messaging">
<add target="+33 123456790" comment="Le client s'est plaint par téléphone"/>
<remove target="+33 600111222"/>
</personnal_redlist>