Questo metodo può essere utilizzato per resettare la password di un cliente all'interno del sistema.
I parametri richiesti da questo metodo sono:
In caso di successo, se si è scelto di generare in automatico la password, ritorna una stringa che rappresenta la nuova password dell'utente, altrimenti ritorna una stringa vuota.
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'); $customers = $ezPrintSDK->backOffice->bGetCustomers(false); $newPassword = $ezPrintSDK->backOffice->bResetCustomerPassword($customers[0]['customerId'], 1, md5("risposta"), sha1("risposta"), false); } 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 customers = ezPrintSDK.backOffice.bGetCustomers(false); var newPassword = ezPrintSDK.backOffice.bResetCustomerPassword(customer[0].customerId, 1, md5("risposta"), sha1("risposta"), false); } catch (ex) { console.log(ex); } |
try { ezPrintSDKWrapper.Client ezPrintSDK = new ezPrintSDKWrapper.Client("http://demo.ezprint.it"); ezPrintSDK.cLoginAPI("1WHm0icsupAEm9fil9en","yCHZ0nKiyn1MU0DhpgmG"); List<ezPrintSDKWrapper.Structures.customerItem> customers = ezPrintSDK.BackOffice.bGetCustomers(false); HashAlgorithm algorithmSHA1 = SHA1.Create(); MD5 algorithmMD5 = MD5.Create(); StringBuilder sb1 = new StringBuilder(); StringBuilder sb2 = 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")); string newPassword = ezPrintSDK.BackOffice.bResetCustomerPassword(customers[0].customerId, 1, sb1.ToString(), sb2.ToString(), false); } catch (ezPrintException ex) { string ErrorMessage = ex.Message; } |