listCustomerLibrary

❗️

Deprecated

JSON-RPC listCustomerLibrary method is deprecated. Use GET /3.1/transactions instead.

Using that method you can list offers purchased by selected customer.

📘

This method should not be used for real-time entitlement checks. Use getAccessStatus or getAccessibleTags instead.

Parameters

NameTypeDescription
publisherToken*stringYou can find your publisher token at api-keys page.
customerEmail*stringSet customer email for which you want to list library.
offset*integerInteger, from which element you want to get results.
limit*integerInteger, how many elements you want to get
criteria*objectNo description
-dateFrom*integerFrom when (unix time stamp) you want to get the list
-dateTo*integerTill when (unix time stamp) you want to get the list

API Request/Response

Request

{
  "method":"listCustomerLibrary",
  "params":{
    "publisherToken":"bwP8yUKHZWAmN4HFNEV0N1vOrzF9SyCKNbiG_QdGGTJLirqO",
    "customerEmail":"[email protected]",
    "offset":"0",
    "limit":"10",
    "criteria":[

    ]
  },
  "jsonrpc":"2.0",
  "id":1
}

Response

{
  "result":{
    "items":[
      {
        "transactionId":"T123123123",
        "transactionDate":1397830774,
        "transactionPrice":9.99,
        "transactionCurrency":"USD",
        "transactionExternalData":"",
        "publisherName":"John's Blog",
        "publisherSiteUrl":"http:\/\/blog.johns.org",
        "offerId":"E123123123_US",
        "offerType":"event",
        "offerTitle":"Super Event",
        "offerDescription":"Super Event description",
        "offerUrl":"http:\/\/superevent.cleeng.com\/super-event\/E123123213_US",
        "invoicePrice":9.99,
        "invoiceCurrency":"USD",
        "expiresAt":"0",
        "cancelled":false
      },
      {
        "transactionId":"T321321321",
        "transactionDate":1397828588,
        "transactionPrice":0,
        "transactionCurrency":"USD",
        "transactionExternalData":"",
        "publisherName":"John's Blog",
        "publisherSiteUrl":"http:\/\/blog.johns.org",
        "offerId":"E321321321_US",
        "offerType":"event",
        "offerTitle":"Super Event 2",
        "offerDescription":"",
        "offerUrl":"http:\/\/dev-tomek1.cleeng.com\/super-event-2\/E321321321_US",
        "invoicePrice":9.99,
        "invoiceCurrency":"USD",
        "expiresAt":"0",
        "cancelled":false
      }
    ],
      "totalItemCount":"2"
  },
  "id":"1",
  "error":null,
  "jsonrpc":"2.0"
}

PHP Example

<?php
    $api = new Cleeng_Api();
    $api->setPublisherToken('publisher_token');

    $customerEmail = '[email protected]';
    $criteria = array(
    'dateTo' => '1398344397',
    'dateFrom' => '1298344397',
    );
    $customerLibrary = $api->listCustomerLibrary($customerEmail,$criteria,0,10); 
?>