-
Notifications
You must be signed in to change notification settings - Fork 3
OcStatisticsApi
This class contains all REST API calls to the /api/statistics
endpoint.
It is accessible under OpencastApi\Rest
namespace.
This endpoint is available for API Version 1.3.0 or greater, therefore, it throws an Exception upon direct class instantiation, or it won't be defined as property in OpencastApi\OpenCast
class when api version is incompatible!
- In
OpencastApi\OpenCast
as its property with OpenCast properties naming convention:
use OpencastApi\OpenCast;
$opencastApi = new OpenCast($config);
$ocStatisticsApi = $opencastApi->statisticsApi;
...
- Direct instantiation:
use OpencastApi\Rest\OcRestClient;
use OpencastApi\Rest\OcStatisticsApi;
$ocRestClient = new OcRestClient($config);
$ocStatisticsApi = new OcStatisticsApi($ocRestClient);
...
Consumable functions are listed below:
Returns a list of statistics providers. Currently, only the "timeseries" type is supported! More Detail
-
$filter
(array) (optional) an assiciative array for filtering e.g. ['resourceType' => '{resource type}'] -
$withparameters
(boolean) (optional) Whether support parameters should be included in the response -
Returns an array:
['code' => 200, 'body' => '{the requested statistics providers as JSON (array) }']
Returns a statistics provider. More Detail
-
$providerId
(string) The identifier of the statistics provider -
$withparameters
(boolean) (optional) Whether support parameters should be included in the response -
Returns an array:
['code' => 200, 'body' => '{The requested statistics provider}']
Returns the statistical data based on the query posted. More Detail
-
$data
(array) A JSON array describing the queries to be executed. -
Returns an array:
['code' => 200, 'body' => '{The statistical data as JSON (array)}']
Retrieves statistical data in csv format. More Detail
Note that limit and offset relate to the resource here, not CSV lines.
There can be multiple lines in a CSV for a resource, e.g. an event.
However, you cannot limit by lines, but only by e.g. events.
-
$data
(array) A JSON array describing the statistics queries to request. -
$params
is an optional array that could contain the following:
[
'limit' => (int) {the maximum number of results to return},
'offset' => (int) {the index of the first result to return},
'filter' => (array) {an assiciative array for filtering. All standard dublin core meta data fields are filterable.},
]
- Returns an array:
['code' => 200, 'body' => '{The requested statistics csv export}']