generateCustomerToken()

Allows to create customerToken when it expires or get lost(cookies deletion or browser change).
Customer has to be created using prepareRemoteAuth method.

Info: Enterprise account required. Contact us if you're interested about opening Enterprise account.

Parameters:

Name Type Description
publisherToken string Your publisher token. To open enterprise account contact us.
customerEmail string Email of customer to generate Token.
- required parameter

Request:

    {
    "method": "generateCustomerToken",
    "params": {
    "publisherToken": "Xlrx-SjTLVMCsaRsOf2q2hvWKOlrF57yHknDRRRMX-13Fz-x",
    "customerEmail": "customer@email.com"
    },
    "jsonrpc": "2.0",
    "id": 1
    }

Response:

    [
    {
    "result": {
    "token": "A0vPK0gIkpkcV6egDjsi3C2ftU1NBqqaTuhZnimZgXo9IUis"
    },
    "id": "1",
    "error": null,
    "jsonrpc": "2.0"
    }
    ]

Example:

<?php
    $customerEmail = 'some-customer@email.com';

    $cleengApi =  new Cleeng_Api();

    $cleengApi->setPublisherToken('Xlrx-SjTLVMCsaRsOf2q2hvWKOlrF57yHknDRRRMX-13Fz-x');
    $result = $cleengApi->generateCustomerToken($customerEmail);
    

Remember! you can always check it by yourself using API Console - generateCustomerToken()

Back to Customer API