Questo metodo può essere utilizzato per inserire un utente all'interno del sistema.
I parametri richiesti da questo metodo sono:
In caso di successo ritorna un intero che rappresenta l'id del cliente.
In caso di errore il metodo genererà un'eccezione che riporterà uno dei seguenti codici di errore:
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); $customerId = $ezPrintSDK->backOffice->bAddCustomer("Nome Cliente", "Cognome Cliente", "demo@demo.it", "0559752330", "0559752332", sha1("password"), secureQuestions[0]["secureQuestionId"], md5("risposta"), sha1("risposta"), customerGroups[0]["customerGroupId"], $storesList[0]["storeId"], true, true, true); } catch (Exception $e) { echo 'Error Code: ', $e->getMessage(); } |
try { var ezPrintSDK = require('ezprint-sdk-wrapper'); var sha1 = require('sha1'); var md5 = require('md5'); 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 customerId = ezPrintSDK.backOffice.bAddCustomer("Nome Cliente", "Cognome Cliente", "demo@demo.it", "0559752330", "0559752332", sha1("password"), secureQuestions[0].secureQuestionId, md5("risposta"), sha1("risposta"), customerGroups[0].customerGroupId, storesList[0].storeId, true, true, true); } catch (ex) { console.log(ex); } |
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); HashAlgorithm algorithmSHA1 = SHA1.Create(); MD5 algorithmMD5 = MD5.Create(); StringBuilder sb1 = new StringBuilder(); StringBuilder sb2 = new StringBuilder(); StringBuilder sb3 = new StringBuilder(); foreach (byte b in algorithmMD5.ComputeHash(Encoding.UTF8.GetBytes("risposta"))) sb1.Append(b.ToString("x2")); foreach (byte b in algorithmSHA1.ComputeHash(Encoding.UTF8.GetBytes("risposta"))) sb2.Append(b.ToString("x2")); foreach (byte b in algorithmSHA1.ComputeHash(Encoding.UTF8.GetBytes("password"))) sb3.Append(b.ToString("x2")); int customerId = ezPrintSDK.BackOffice.bAddCustomer("Nome Cliente", "Cognome Cliente", "demo@demo.it", "0559752330", "0559752332", sb3.ToString(), secureQuestions[0].secureQuestionId, sb1.ToString(), sb2.ToString(), customerGroups[0].customerGroupId, storesList[0].storeId, true, true, true); } catch (ezPrintException ex) { string ErrorMessage = ex.Message; } |