Skip to content

Instantly share code, notes, and snippets.

Avatar

Express-Mailing expressmailing

View GitHub Profile
View mon_premier_test_sms_batch.php
<?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
View mon_premier_test_sms_response.json
{
"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 Dec 27, 2018
POST /sms/ Envoyez votre 1er sms
View mon_premier_test_sms_batch.json
{
"defaults": {
"message": "Mon premier test sms !"
},
"recipients": [
{
"target": "0612345678",
"countryCode": "FR"
}
]
View send_multi_recipients_sms_batch
JSON BODY :
{
"message": "Hello world !",
"defaults": {
"countryCode": "FR"
},
"recipients": [
{ "target": "06xxxxxxx1" },
{ "target": "06xxxxxxx2" },
{ "target": "06xxxxxxx3" },
@expressmailing
expressmailing / send_voice_message_unit.cs
Created Jan 4, 2018
Exemple en C# d'envoi de message vocal unitaire
View send_voice_message_unit.cs
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"">
View api_audio_unit_exemple_push.xml
<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 Jan 4, 2018
API audio unitaire exemple push PHP
View api_audio_unit_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>
View api_audio_unit_exemple_push.xml
<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>
View audio_add_redlist.xml
<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>