SMS Pro - SMS API - PHP Error (Only SMPP endpoint allowed for this account)
... / SMS API - PHP Error (Only...
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

SMS API - PHP Error (Only SMPP endpoint allowed for this account)

Von
CharlyJ2
Erstellungsdatum 2023-09-01 07:51:04 (edited on 2024-11-18 11:14:37) in SMS Pro

Bonjour, je tente de mettre en place l'envoie d'SMS via l'API OVHCloud.

Je suis sur la fin, mais j'ai toujours cette erreur qui revient à chaque fois.
Que veut dire ce message d'erreur : **Only SMPP endpoint allowed for this account** ?

Génération du token : https://www.ovh.com/auth/api/createToken?GET=/sms/&GET=/sms/*&POST=/sms/*/jobs

Code :
$applicationKey = getenv("OVH_KEY");
$applicationSecret = getenv("OVH_SECRET");
$consumerKey = getenv("OVH_CONSUME_KEY");
$endpoint = 'ovh-eu';

$ovh = new Api($applicationKey, $applicationSecret, $endpoint, $consumerKey);

$result = $ovh->post('/sms/{SERVICE_ID}/jobs', array(
'charset' => 'UTF-8', // The sms coding (type: sms.CharsetEnum)
'class' => 'flash', // The sms class (type: sms.ClassEnum)
'coding' => NULL, // Deprecated: the coding is deduced from the message and its charset (type: sms.CodingEnum)
'differedPeriod' => NULL, // The time -in minute(s)- to wait before sending the message (type: long)
'message' => 'Test', // 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' => NULL, // The priority of the message (type: sms.PriorityEnum)
'receivers' => array('+33000000000'), // The receivers list (type: string[])
'receiversDocumentUrl' => NULL, // The receivers document url link in csv format (type: string)
'receiversSlotId' => NULL, // The receivers document slot id (type: string)
'sender' => NULL, // The sender (type: string)
'senderForResponse' => false, // Set the flag to send a special sms which can be reply by the receiver (smsResponse). (type: boolean)
'tag' => NULL, // The identifier group tag (type: string)
'validityPeriod' => NULL, // The maximum time -in minute(s)- before the message is dropped (type: long)
));

print_r($result);


3 Antworten ( Latest reply on 2024-11-18 11:14:56 Von
PierreV64
)

Bonjour @CharlyJ2,

D'après le message d'erreur, vous devez utiliser une API incompatible avec votre service.

Je vous invite à consulter les deux guides ci-dessous :
https://help.ovhcloud.com/csm/fr-sms-smpp-control-panel?id=kb_article_view&sysparm_article=KB0056336

https://help.ovhcloud.com/csm/fr-sms-sending-via-api-php?id=kb_article_view&sysparm_article=KB0051373

^FabL

Bonjour @CharlyJ2,
Avez-vous trouvé une solution à votre problème ?
nous rencontrons le même message d'erreur en essayant d'envoyer des SMS via l'offre SMPP
Merci pour votre réponse

Bonjour @FabL
Nous venons de souscrire à l'offre smpp, mais n'arrivons pas à établir la connexion.
auriez vous une doc à jour ou un exemple de code pour l'envoi de SMS via SMPP ?
je vous remercie,