Descrizione
Questo metodo può essere utilizzato per modificare un utente all'interno del sistema.
Utilizzo
I parametri richiesti da questo metodo sono:
- customerId: Id del cliente da modificare.
- customerFirstName: Nome del cliente
- customerLastName: Cognome del cliente.
- customerEmail: Indirizzo email del cliente.
- customerTelephone: Numero di telefono del cliente.
- customerFax: Numero del fax del cliente.
- customerGroupId: Id del gruppo clienti a cui è associato il cliente.
- storeId: Id dello store a cui è associato il cliente.
- newsletter: true se il cliente ha autorizzato all'utilizzo dei dati personali per comunicazioni commerciali, false in caso contrario.
- approved: true se il cliente è stato approvato, false in caso il cliente necessiti dell'approvazione da parte dell'amministratore.
- enable: true se il cliente è attivo, false in caso contrario.
Il metodo non ha nessun valore di ritorno.
Gestione errori
In caso di errore il metodo genererà un'eccezione che riporterà uno dei seguenti codici di errore:
- ERROR_EMAIL_ADDRESS_ALREADY_USED: L'indirizzo email specificato è già registrato all'interno del sistema.
- ERROR_INVALID_PARAMS: Uno dei parametri inviati non è valido.
- ERROR_INVALID_TOKEN: Non è stato effettuato nessun login in precedenza o la sessione è scaduta per inutilizzo.
- ERROR_INVALID_IP: L'indirizzo ip del server che sta effettuando la chiamata non valido perchè non inserito nella whitelist associata alle credenziali.
- ERROR_SERVER_UNAVAILABLE: Il server non è disponibile o si è verificato un errore di comunicazione generico.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
require "vendor/autoload.php"
try {
$ezPrintSDK = new ezPrintSDKWrapper('http://demo.ezprint.it');
$apiToken = $ezPrintSDK->cLoginAPI('1WHm0icsupAEm9fil9en','yCHZ0nKiyn1MU0DhpgmG');
$availableLanguages = $ezPrintSDK->backOffice->bGetAvailableLanguages();
$customerGroups = $ezPrintSDK->backOffice->bGetCustomerGroups(false, $availableLanguages[0]['languageId']);
$secureQuestions = $ezPrintSDK->backOffice->bGetSecureQuestions($availableLanguages[0]['languageId']);
$storesList = $ezPrintSDK->backOffice->bGetStores(false);
$ezPrintSDK->backOffice->bEditCustomer("Nome Cliente", "Cognome Cliente", "demo@demo.it", "0559752330", "0559752332", customerGroups[0]["customerGroupId"], $storesList[0]["storeId"], true, true, true);
} catch (Exception $e) {
echo 'Error Code: ', $e->getMessage();
}
|
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
try {
var ezPrintSDK = require('ezprint-sdk-wrapper');
ezPrintSDK.initializeWrapper('http://demo.ezprint.it');
var apiToken = ezPrintSDK.cLoginAPI('1WHm0icsupAEm9fil9en','yCHZ0nKiyn1MU0DhpgmG');
var availableLanguages = ezPrintSDK.backOffice.bGetAvailableLanguages();
var customerGroups = ezPrintSDK.backOffice.bGetCustomerGroups(false, availableLanguages[0].languageId);
var secureQuestions = ezPrintSDK.backOffice.bGetSecureQuestions(availableLanguages[0].languageId);
var storesList = ezPrintSDK.backOffice.bGetStores(false);
ezPrintSDK.backOffice.bEditCustomer("Nome Cliente", "Cognome Cliente", "demo@demo.it", "0559752330", "0559752332", customerGroups[0].customerGroupId, storesList[0].storeId, true, true, true);
} catch (ex) {
console.log(ex);
} |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
try {
ezPrintSDKWrapper.Client ezPrintSDK = new ezPrintSDKWrapper.Client("http://demo.ezprint.it");
ezPrintSDK.cLoginAPI("1WHm0icsupAEm9fil9en","yCHZ0nKiyn1MU0DhpgmG");
List<ezPrintSDKWrapper.Structures.languageItem> availableLanguages = ezPrintSDK.BackOffice.bGetAvailableLanguages();
List<ezPrintSDKWrapper.Structures.customerGroupItem> customerGroups = ezPrintSDK.BackOffice.bGetCustomerGroups(false, availableLanguages[0].languageId);
List<ezPrintSDKWrapper.Structures.secureQuestionItem> secureQuestions = ezPrintSDK.BackOffice.bGetSecureQuestions(availableLanguages[0].languageId);
List<ezPrintSDKWrapper.Structures.storeItem> storesList = ezPrintSDK.BackOffice.bGetStores(false);
ezPrintSDK.BackOffice.bEditCustomer("Nome Cliente", "Cognome Cliente", "demo@demo.it", "0559752330", "0559752332", customerGroups[0].customerGroupId, storesList[0].storeId, true, true, true);
} catch (ezPrintException ex) {
string ErrorMessage = ex.Message;
} |