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
Name | Type | Description |
---|---|---|
publisherToken* | string | Your publisher token. To open enterprise account contact us. |
customerEmail* | string | Email of customer to generate Token. |
Result Parameters
Name | Type | Description |
---|---|---|
token | string | Customer 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
Code | Description |
---|---|
3 | Invalid publisher token |
5 | Access denied |
11 | Invalid arguments |