getCustomerEmail

❗️

Deprecated

JSON-RPC getCustomerEmail method is deprecated. Use GET /3.1/customers/{customerId} instead.

You can easily check a customer email, by setting your publisher token and customer access token. The customer must have purchased at least one of your offers.

Parameters

NameTypeDescription
publisherToken*stringRequired publisher account with special privileges
customerToken*stringToken that identifies the customer, read more in Must know about API section.

API Request/Response

Request

{
  "method":"getCustomerEmail",
  "params":{
    "publisherToken":"Xlrx-SjTLVMCsaRsOf2q2hvWKOlrF57yHknDRRRMX-13Fz-x",
    "customerToken":"Q5ik8S5iULFfnUwzcX0TvVfhzqBYRsXMGAcUeAIESAVHm1jj"
  },
  "jsonrpc":"2.0",
  "id":1
}

Response

{
  "result":{
    "email":"[email protected]"
  },
  "id":"1",
  "error":null,
  "jsonrpc":"2.0"
}

PHP Example

<?php
    $cleengApi = new Cleeng_Api();
    $cleengApi->setPublisherToken('VIJYHWzJEP4mt1DZThD7DV_FinBG0Yo3Q9oHfCFAjqA22jXP');//enterprise account required

    $customerEmail = $cleengApi->getCustomerEmail();//PHP SDK takes customerToken automatically from cookies when customer is logged in.

    echo $customerEmail->email;

?>