Skip to content

Instantly share code, notes, and snippets.

Avatar

Express-Mailing expressmailing

View GitHub Profile
@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 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 / 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 / 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
' --------------------------
@expressmailing
expressmailing / send_fax_unit_vb6.vb
Created Dec 15, 2017
Exemple en VB 4/5/6 d'envoi de fax unitaire
View send_fax_unit_vb6.vb
Private Sub Form_Load()
' Récupération du document en base64
' ---------------------------------------
Dim filename As String, file() As Byte, filnum As Integer, binary As String
filename = "test-fax.doc"
filnum = FreeFile()
Open filename For Binary As filnum
file = InputB(LOF(filnum), #filnum)
Close filenum
@expressmailing
expressmailing / api_sms_unit_exemple_push.xml
Last active Dec 18, 2017
API SMS unitaire exemple push XML
View api_sms_unit_exemple_push.xml
<request login="demo" password="demo">
<push media="sms"
type="on_demand"
name="ref-alphanum"
start_date="01/01/2015 15:00:00"><!--(n'oubliez pas le chevron de fermeture !)-->
<message type="text">Ceci est mon premier test sms</message>
<sms_config validity="7" />
<recipients>
<add target="+33 600000000" ref_target="uniq-id-for-report" />
View api_sms_campaign_exemple_push.xml
<request login="demo" password="demo">
<push media="sms"
type="campaign"
name="ref-alphanum"
start_date="01/01/2017 15:00:00"><!--n'oubliez pas le chevron de fermeture !)-->
<message type="text">Corps de mon SMS</message>
<sms_config validity="7" sender_id="XPMAILING" />
<recipients>
<add target="+33 600000000" ref_target="uniq-id-for-report"/>
</recipients>