Sms & Fax-old - Probleme envoi de masse
... / Probleme envoi de masse
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Frage

Probleme envoi de masse

Von
FrankS
Erstellungsdatum 2017-05-31 13:48:44 (edited on 2024-09-04 12:23:38) in Sms & Fax-old

Bonjour,

J'aurais besoin d'un coup de main pour savoir ce qui bloque sur l'envoi de masse.

Le test de connexion se fait correctement, l'envoi unique aussi.
Mais l'envoi de masse avec fichier CSV, je planche. J'obtiens juste mon identifiant de connexion, comme pour le test.
/**

require 'monurl/autoload.php';
use \Ovh\Api;

$endpoint = 'ovh-eu';
$applicationKey = "xxxxxxxxxxxxxxxxxxxxxxxxx";
$applicationSecret = "xxxxxxxxxxxxxxxxxxxxx";
$consumer_key = "xxxxxxxxxxxxxxxxxxxx";

$conn = new Api( $applicationKey,
$applicationSecret,
$endpoint,
$consumer_key);

$smsServices = $conn->get('/sms/');
foreach ($smsServices as $smsService) {

print_r($smsService);
}
/*fin connexion api*/
/*debut requete suivant fichier de masse*/

$result = $ovh->post('/sms/MonSMS/jobs', array(
'charset' => 'UTF-8', // The sms coding (type: sms.CharsetEnum)
'class' => 'phoneDisplay', // The sms class (type: sms.ClassEnum)
'coding' => '7bit', // The sms coding (type: sms.CodingEnum)
'differedPeriod' => '', // The time -in minute(s)- to wait before sending the message (type: long)
'message' => 'Test', // Required: The sms message (type: string)
'noStopClause' => false, // Do not display STOP clause in the message, this requires that this is not an advertising message (type: boolean)
'priority' => 'high', // The priority of the message (type: sms.PriorityEnum)
'receiversDocumentUrl' => 'monurl/destinataire.csv', // The receivers document url link in csv format (type: string)*/
'senderForResponse' => false, // Set the flag to send a special sms which can be reply by the receiver (smsResponse). (type: boolean)
'validityPeriod' => '2880', // The maximum time -in minute(s)- before the message is dropped (type: long)
));

echo"fin";

print_r( $result );
?>


3 Antworten ( Latest reply on 2017-06-01 07:28:07 Von
FrankS
)

Bon, je pense que c'est plus simple que je le pense, mais j'ai toujours une erreur 500 sur l'envoi de masse.
/**
* First, download the latest release of PHP wrapper on github
* And include this script into the folder with extracted files
*/
require 'monurl/autoload.php';
use \Ovh\Api;

/**
* Instanciate an OVH Client.
* You can generate new credentials with full access to your account on
* the token creation page
*/
$ovh = new Api( 'xxxxxxxxxxxxxxxxxxxxx', // Application Key
'xxxxxxxxxxxxxxxxxxxxx', // Application Secret
'ovh-eu', // Endpoint of API OVH Europe (List of available endpoints)
'xxxxxxxxxxxxxxxxxxxxx'); // Consumer Key

$result = $ovh->post('/sms/sms-sf15903-1/jobs', array(
"charset"=> "UTF-8",
"class"=> "phoneDisplay",
"coding"=> "7bit",
"message"=> "Bonjour 2ieme TEST",
"noStopClause"=> false,
"priority"=> "high",
//envoi unique marche
//"receivers"=> [ "+33xxxxxxxxxxxxxxxxxxxxx" ],
//envoi masse marche pas pour l'instant
"receiversDocumentUrl" => "monurl/destinataire.csv", // The receivers document url link in csv format (type: string)
"senderForResponse"=> true,
"validityPeriod"=> 2880
));

print_r( $result );
?>

Merci Jean FrancoisS pour cette piste.
Suite à votre message, je vous avoue que je suis très curieux de voir comment vous avez construit l'insertion dynamique.
Bonne journée.
Frank


onurl/destinataire.csv"


Il était tant que j'arrete hier, mon soucis, déja un CSV mal construit, pourtant la doc est claire.
Et puis le paramètres 'senderForResponse' => qui était à false...

Mais je veux bien tenter en faisant une bdd pour la gestion des numéros.