Questo metodo può essere utilizzato per inizializzare una sessione di editing all'interno del sistema.
I parametri richiesti da questa funzione sono:
In caso di successo ritorna una stringa che rappresenta l'id della sessione.
In caso di errore il metodo genererà un'eccezione che riporterà uno dei seguenti codici di errore:
Il campo sessionType può avere i seguenti valori:
In .NET è possibile utilizzare la struttura statica editorSessionType presente in Structures. |
Il campo editorType può avere i seguenti valori:
In .NET è possibile utilizzare la struttura statica editorType presente in Structures. |
Se si utilizzare un sistema di calcolo prezzi esterno andando a popolare il campo shoppingCartUrl è consigliato consultare la guida alla gestione dei dati e della risposta necessaria per il corretto funzionamento alla pagina Gestione carrello esterno. |
Se si utilizzare un carrello esterno andando a popolare il campo productEstimationUrl è consigliato consultare la guida alla gestione dei dati e della risposta necessaria per il corretto funzionamento alla pagina Gestione calcolo prezzi esterno. |
Se si utilizza la procedura di logout su url esterno andando a popolare il campo customizeLogoutUrl al momento del logout verrà effettuato un redirect all'url impostato nella variabile con l'aggiunta del campo projectId contenente l'id del progetto associato alla sessione da cui si proviene (eventuali parametri impostati nell'url verranno mantenuti). |
require "vendor/autoload.php" try { $ezPrintSDK = new ezPrintSDKWrapper('http://demo.ezprint.it'); $apiToken = $ezPrintSDK->cLoginAPI('1WHm0icsupAEm9fil9en','yCHZ0nKiyn1MU0DhpgmG'); $availableLanguages = $ezPrintSDK->backOffice->bGetAvailableLanguages(); $customers = $ezPrintSDK->backOffice->bGetCustomers(false, false, false); $products = $ezPrintSDK->backOffice->bGetCatalogProducts(false, $availableLanguages[0]['languageId'], false, true, 100); $sessionHash = $ezPrintSDK->editor->eCreateEditorSession(1, $products[0]['editorType'], $products[0]['productId'], 0, 0, 'Nome Progetto', $customers[0]['customerId'], sha1("password"), false, array(), false, array(), false, array(), true, false); } catch (Exception $e) { echo 'Error Code: ', $e->getMessage(); } |
try { var util = require('util'); var sha1 = require('sha1'); var ezPrintSDK = require('ezprint-sdk-wrapper'); ezPrintSDK.initializeWrapper('http://demo.ezprint.it'); var apiToken = ezPrintSDK.cLoginAPI('1WHm0icsupAEm9fil9en','yCHZ0nKiyn1MU0DhpgmG'); var availableLanguages = ezPrintSDK.backOffice.bGetAvailableLanguages(); var customers = ezPrintSDK.backOffice.bGetCustomers(false, false, false); var products = ezPrintSDK.backOffice.bGetCatalogProducts(false, availableLanguages[0].languageId, false, true, 100); var sessionHash = ezPrintSDK.editor.eCreateEditorSession(1, products[0].editorType, products[0].productId, 0, 0, 'Nome Progetto', customers[0].customerId, sha1("password"), false, [], false, [], false, [], true, false); } 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.customerItem> customers = ezPrintSDK.BackOffice.bGetCustomers(false, false, false); List<ezPrintSDKWrapper.Structures.productItem> products = ezPrintSDK.BackOffice.bGetCatalogProducts(false, availableLanguages[0].languageId, false, true, 100); HashAlgorithm algorithmSHA1 = SHA1.Create(); StringBuilder sb1 = new StringBuilder(); foreach (byte b in algorithmSHA1.ComputeHash(Encoding.UTF8.GetBytes("palladio"))) sb1.Append(b.ToString("x2")); string sessionHash = ezPrintSDK.Editor.eCreateEditorSession(1, products[0].editorType, products[0].productId, 0, 0, "Nome Progetto", customers[0].customerId, sb1.ToString(), false, new List<ezPrintSDKWrapper.Structures.extraParamItem>(), false, new List<ezPrintSDKWrapper.Structures.extraParamItem>(), false, new integer[] {}, true, false); } catch (ezPrintException ex) { string ErrorMessage = ex.Message; } |