It is possible to load the data of one month using a date information in the format "yyyyMM".

Request

URL:

/api/2.2/[user]/[apiHash]/requestcounters/[monthYear]

Required Header:

Accept: application/json

Response

The status code of the response will be 200 if all parameters are correctly specified. If there is no counter for the month, a 404 error is provided.

The body contains the data of the requested schema, including the fields.

{
   monthYear: 201403,
   counter: 244203
}

PHP API Client

The PHP API client supports to get the stored request counters for an individual month:

<?php
include_once("ContentOnTarget-PHP-API-Client.php");
$config = com\repalogic\ContentOnTarget\Client\Configuration::getConfig("https://api.shopontarget.com/", "userName", "userApiHash", "core name does not matter", "core api hash does not matter");

$requestApi= new com\repalogic\ContentOnTarget\Client\CoreUserRequestCounterApi($config);
$counter= $requestApi->getRequestCounter("201405");
var_dump($counter);
?>

 

It is also possible to query the request counter using administration credentials:

<?php
include_once("ContentOnTarget-PHP-API-Client.php");
$config = com\repalogic\ContentOnTarget\Client\Configuration::getConfig("https://api.shopontarget.com/", "user name does not matter", "user api hash does not matter", "core name does not matter", "core api hash does not matter");
$adminCredentials = new com\repalogic\ContentOnTarget\Client\AdministrationCredentials("adminUser", "adminPassword");
$requestApi= new com\repalogic\ContentOnTarget\Client\CoreUserRequestCounterAdministrationApi($config, adminCredentials);$counter= $requestApi->getRequestCounter("201405");
var_dump($counter);
?>