Skip to content

OcSecurityApi

FarbodZamani edited this page Mar 25, 2022 · 1 revision

This class contains a REST API call to the /api/security endpoint.

Namespace

It is accessible under OpencastApi\Rest namespace.

How to use

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

Functions

Consumable functions are listed below:

sign($url, $validUntil = '', $validSource = '')

Returns a signed URL that can be played back for the indicated period of time, while access is optionally restricted to the specified IP address. More Detail

  • $url (string) The URL to be signed

  • $validUntil (string) The date and time until when the signed URL is valid (type of ISO 8602) e.g. "2018-03-11T13:23:51Z"

  • $validSource (string) The IP address from which the url can be accessed.

  • Returns an array: ['code' => 200, 'body' => '{The signed URL}']