Skip to content

Instantly share code, notes, and snippets.

Avatar

Express-Mailing expressmailing

View GitHub Profile
@expressmailing
expressmailing / api_fax_unit_exemple_push.xml
Last active Dec 15, 2017
API fax unitaire exemple push
View api_fax_unit_exemple_push.xml
<request login="your-login" password="your-password">
<push media="fax" type="on_demand" name="Test API Fax">
<message type="doc">
0M8R4KGxGuEAAAAA[...]AAAAAAAAAAAAAAAA
</message>
<recipients>
<add target="+33 170248254"/>
</recipients>
</push>
</request>
@expressmailing
expressmailing / api_fax_unit_exemple_push.php
Last active Nov 23, 2017
API fax unitaire exemple push PHP
View api_fax_unit_exemple_push.php
<?php
// Récupération du document en base64
$filename = 'test-fax.doc';
$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="fax" type="on_demand" name="Test API Fax PHP">
<message type="doc">'.$binary.'</message>
View api_fax_campaign_exemple_push.xml
<request login="demo" password="demo">
<push media="fax"
type="campaign"
name="ref-alphanum"
start_date="01/01/2015 15:00:00"> <!-- N'oubliez pas le chevron de fermeture ! -->
<message type="doc">000000-base64-000000</message>
<fax_config tries="2">
<recipients>
<add target="+33 123456788" ref_target="uniq-id-for-report" />
<add target="+33 123456789" />
@expressmailing
expressmailing / api_fax_multi_doc.xml
Last active Nov 23, 2017
Gestion multi-documents dans une balise <push media="fax">
View api_fax_multi_doc.xml
<message type="multi">
<message type="/doc /pdf /tiff">000000-base64-000000</message>
<message type="/doc /pdf /tiff">000000-base64-000000</message>
</message>
View fax_push_response_xml.xml
<?xml version="1.0" encoding="utf-8"?>
<response>
<push status="ok" status-detail="on_demand fax created" pages="2" />
</response>
@expressmailing
expressmailing / fax_notification_request.xml
Last active Dec 18, 2017
Récupération des notifications fax
View fax_notification_request.xml
<request login="demo" password="demo">
<notifications media="fax"
seek="id-notification"
max="100" />
</request>
View exemple_notifications.xml
<?xml version="1.0" encoding="utf-8"?>
<response>
<notifications status="ok" position="17694933">
<notification id-notifcation="17694930">
<status>PROGRESS</status>
<date>02/03/2017 09:19:27</date>
<state-desc>RAS</state-desc>
<sms-state>0</sms-state>
<ref_target>uniq-sms-id-12</ref_target>
<ref_group>Campagne SMS Test</ref_group>
@expressmailing
expressmailing / fax_add_redlist.xml
Last active Nov 27, 2017
Structure de la commande
View fax_add_redlist.xml
<personnal_redlist media="fax">
<add target="+33 123456789" comment="Le client a renvoyé un fax raturé"/>
<remove target="+33 300000001"/>
</personnal_redlist>
@expressmailing
expressmailing / send_fax_unit.cs
Last active Jan 2, 2018
Exemple en C# d'envoi de fax unitaire
View send_fax_unit.cs
static void Main(string[] args)
{
// Récupération du document en base64
string filename = "test-fax.doc";
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 / send_fax_unit.vb
Created Dec 15, 2017
Exemple en VB d'envoi de fax unitaire
View send_fax_unit.vb
Public Sub Main(ByVal Args() As String)
' Récupération du document en base64
' ---------------------------------------
Dim filename As String = "test-fax.doc"
Dim file() As Byte = System.IO.File.ReadAllBytes(filename)
Dim binary As String = System.Convert.ToBase64String(file, 0, file.Length)
' Création du XML à poster
' --------------------------