generateCustomerToken

❗️

Deprecated

Customer token authentication is deprecated. JWT with MediaStore SDK API is recommended instead for endpoints related to customers.

Allows to create customerToken when it expires or gets lost (by cookies deletion or browser change).
Customer has to be created prior by registerCustomer method.

🚧

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

Parameters

NameTypeDescription
publisherToken* stringYour publisher token. To open enterprise account contact us.
customerEmail*stringEmail of customer to generate Token.

Result Parameters

NameTypeDescription
tokenstringCustomer token used to identify the user

API Request/Response

Request

{
  "method":"generateCustomerToken",
  "params":{
    "publisherToken":"Xlrx-SjTLVMCsaRsOf2q2hvWKOlrF57yHknDRRRMX-13Fz-x",
    "customerEmail":"[email protected]"
  },
  "jsonrpc":"2.0",
  "id":1
}

Response

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

PHP Example

<?php
    $customerEmail = '[email protected]';

    $cleengApi =  new Cleeng_Api();

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

Error Codes

CodeDescription
3Invalid publisher token
5Access denied
11Invalid arguments