Page tree
Skip to end of metadata
Go to start of metadata

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.

 

PHP
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);
	$customers = $ezPrintSDK->backOffice->bGetCustomers(false);
 
	$ezPrintSDK->backOffice->bEditCustomer($customers[0]["customerId"], "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();
}

Node.js
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);
	var customers = ezPrintSDK.backOffice.bGetCustomers(false);
	ezPrintSDK.backOffice.bEditCustomer(customers[0].customerId, "Nome Cliente", "Cognome Cliente", "demo@demo.it", "0559752330", "0559752332", customerGroups[0].customerGroupId, storesList[0].storeId, true, true, true);
} catch (ex) {
	console.log(ex);
}
.NET (C#)
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);
	List<ezPrintSDKWrapper.Structures.customerItem> customers = ezPrintSDK.BackOffice.bGetCustomers(false);
 
	ezPrintSDK.BackOffice.bEditCustomer(customers[0].customerId, "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;
}
  • No labels