The API provides to retrieve all available Cores using a GET request.

Request

URL:

/api/2.2/[user]/[apiHash_User]/cores

Required Header:

Accept: application/json

Possible Query Parameters

The request is paginated. Therefore you can add pagination parameters "offset" (default: 0) and "length" (default: 100).

parameterexampledescription
offset
/api/2.2/cores/?offset=10

specifies the position from which possible Core results should be provided

minimal value: 0

length
/api/2.2/cores/?offset=10&length=20

specified the number of Cores which have to be provided at maximum

supported range: 0-100

Response

The status code of the response will be 200 if all parameters are correctly specified. Otherwise an error code is provided.

The body contains a list of all available Cores including user and schema information:

{
"coreCount": 123,
"cores":
   [
     {
         "apiHash": "testTest-1",
         "coreName": "testCore",
         "coreSchema": {
            "description": "schema description",
            "name": "TestSchema",
            ...
         },
      },
     ...
   ]
}

PHP API Client

The PHP API client supports to get all available Cores.

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

$coreApi = new com\repalogic\ContentOnTarget\Client\CoreApi($config);
$coreList = $coreApi->getCores();
var_dump($coreList);
?>