Skip to content
Resellers: add SMS sending credits to a sub-account

Resellers: add SMS sending credits to a sub-account

By Loïc Bresler 1 min read

Add SMS credits to a sub-account

This function adds credits to a sub-account (note that this function is only available for reseller accounts).

int Ajout_Credit_SMS($compte_mdworks,$ajout_credit,$login,$motdepasse)

  • $compte_mdworks

  • $ajout_credit: amount of credits added to the sub-account identified by $login and $motdepasse

  • $login: login of the reseller account

  • $motdepasse: password of the reseller account

**Important: **

**The SOAP server for user management is separate from the standard API: **

https://www.eml-srv.com/_soap/serveur.php

Description

Add SMS credits to a sub-account.

$login and $motdepasse correspond to the credentials of the sub-account.

$compte_mdworks corresponds to the mdworks account identifier returned when the sub-account was created.

$ajout_credit is the number of credits to add.

Parameters (mandatory)

All parameters are mandatory.

Return value

true or false

Error messages

No field can be left empty: login

No field can be left empty: motdepasse

Intermediate error (wrong login / motdepasse)

No field can be left empty (mdworks account identifier, credit, user password).

Unknown user: please select a user that exists.

Access denied: this user does not appear to belong to you.

Example with PHP5

try { $client = new SoapClient(null, array('location' => "https://www.eml-srv.com/_soap/serveur.php", 'uri'      => "https://www.eml-srv.com", 'encoding'=>'ISO-8859-1' ));

$variable = $client->Ajout_Credit_SMS('431', '500', 'your_login','your_password'); //or //$variable = $client->__soapCall(Ajout_Credit,$parametres);

print_r($variable); } catch (SoapFault $fault) {
trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);

}
Last updated on