Skip to content

OcListProvidersApi

FarbodZamani edited this page Jul 20, 2023 · 2 revisions

This class contains all REST API calls to the /api/listproviders endpoint.

Namespace

It is accessible under OpencastApi\Rest namespace.

Version

This endpoint is available for API Version 1.10.0 or greater, therefore, it might throw an Exception upon direct class instantiation, or it might not be defined as property in OpencastApi\OpenCast class when api version is incompatible!

In addition, it returns 403 error justifying the reason as the API version does not match.

This endpoint service is added into library since v1.4

How to use

  1. In OpencastApi\OpenCast as its property with OpenCast properties naming convention:
use OpencastApi\OpenCast;
$opencastApi = new OpenCast($config);
$ocListProvidersApi = $opencastApi->listProvidersApi;
...
  1. Direct instantiation:
use OpencastApi\Rest\OcRestClient;
use OpencastApi\Rest\OcListProvidersApi;
$ocRestClient = new OcRestClient($config);
$ocListProvidersApi = new OcListProvidersApi($ocRestClient);
...

Functions

Consumable functions are listed below:

getProviders()

Returns a list of list providers. More Detail

  • Returns an array: ['code' => 200, 'body' => '{The listproviders are returned as a list.}']

getList($source)

Provides key-value list from the given list provider. More Detail

  • $source (string) The provide source name

  • Returns an array: ['code' => 200, 'body' => '{The key-value list are returned as a JSON object.}']

Clone this wiki locally