Skip to content

API Endpoints

FarbodZamani edited this page Mar 25, 2022 · 18 revisions

Introduction

This page contains all class definitions related to API Endpoint knows as /api/*. All classes under this endpoint are named using class naming convention, it means that the class name must consist of Oc[endpoit name]Api with Api at the end to define its category!

Namespace

All Endpoint are accessible under OpencastApi\Rest namespace.

How to access

  1. In OpencastApi\OpenCast as its property:
use OpencastApi\OpenCast;
$opencastApi = new OpenCast($config);
$ocEventsApi = $opencastApi->eventsApi;
...
  1. Direct instantiation:
use OpencastApi\Rest\OcRestClient;
use OpencastApi\Rest\OcEventsApi;
$ocRestClient = new OcRestClient($config);
$ocEventsApi = new OcEventsApi($ocRestClient);
...

Table of content

OcEventsApi

This class is responsible to perform all REST API calls to the /api/events endpoint and it consists of the following functions to consume:

getAll($params = [])

Retrieves the list of events. More Detail

  • $params is an optional array that could contain the following:
[
     'sign' => (boolean) {Whether public distribution urls should be signed.},
     'withacl' => (boolean) {Whether the acl metadata should be included in the response.},
     'withmetadata' => (boolean) {Whether the metadata catalogs should be included in the response. },
     'withscheduling' => (boolean) {Whether the scheduling information should be included in the response. (version 1.1.0 and higher)},
     'withpublications' => (boolean) {Whether the publication ids and urls should be included in the response.},
     'onlyWithWriteAccess' => (boolean) {Whether only to get the events to which we have write access.},
     'sort' => (array) {an assiciative array for sorting e.g. ['title' => 'DESC']},
     '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 e.g. ['is_part_of' => '{series id}']},
]
  • On success, Response['body'] then should contain an array of events

getBySeries($seriesId, $params = [])

Retrieves a list of events for specified series. More Detail

  • $seriesId the identifier for a series
  • $params is an optional array that could contain the following:
[
     'sign' => (boolean) {Whether public distribution urls should be signed.},
     'withacl' => (boolean) {Whether the acl metadata should be included in the response.},
     'withmetadata' => (boolean) {Whether the metadata catalogs should be included in the response. },
     'withscheduling' => (boolean) {Whether the scheduling information should be included in the response. (version 1.1.0 and higher)},
     'withpublications' => (boolean) {Whether the publication ids and urls should be included in the response.},
     'onlyWithWriteAccess' => (boolean) {Whether only to get the events to which we have write access.},
     'sort' => (array) {an assiciative array for sorting e.g. ['title' => 'DESC']},
     '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 e.g. ['is_part_of' => '{series id}']},
]
  • On success, Response['body'] then should contain an array of events for that series

Clone this wiki locally