Skip to content

Latest commit

 

History

History
244 lines (178 loc) · 8.69 KB

BlockApi.md

File metadata and controls

244 lines (178 loc) · 8.69 KB

RadioManager\BlockApi

All URIs are relative to https://radiomanager.io/api/v2

Method HTTP request Description
getBlockById GET /blocks/{id} Get block by id
getCurrentBlock GET /blocks/current Get current Block
getNextBlock GET /blocks/next Get upcoming Block
listBlocks GET /blocks Get a list of all blocks currently in your station.

getBlockById

\RadioManager\Model\BlockResult getBlockById($id, $_external_station_id)

Get block by id

Get block by id

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: API Key
$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');

$apiInstance = new RadioManager\Api\BlockApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 789; // int | ID of Block **(Required)**
$_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)*

try {
    $result = $apiInstance->getBlockById($id, $_external_station_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BlockApi->getBlockById: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int ID of Block (Required)
_external_station_id int Query on a different (content providing) station (Optional) [optional]

Return type

\RadioManager\Model\BlockResult

Authorization

[API Key](../../README.md#API Key)

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getCurrentBlock

\RadioManager\Model\BlockResult getCurrentBlock()

Get current Block

Get current Block

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: API Key
$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');

$apiInstance = new RadioManager\Api\BlockApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->getCurrentBlock();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BlockApi->getCurrentBlock: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

This endpoint does not need any parameter.

Return type

\RadioManager\Model\BlockResult

Authorization

[API Key](../../README.md#API Key)

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getNextBlock

\RadioManager\Model\BlockResult getNextBlock()

Get upcoming Block

Get upcoming Block

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: API Key
$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');

$apiInstance = new RadioManager\Api\BlockApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->getNextBlock();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BlockApi->getNextBlock: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

This endpoint does not need any parameter.

Return type

\RadioManager\Model\BlockResult

Authorization

[API Key](../../README.md#API Key)

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listBlocks

\RadioManager\Model\BlockResults listBlocks($page, $broadcast_id, $item_id, $program_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id)

Get a list of all blocks currently in your station.

Get a list of all blocks currently in your station. This feature supports pagination and will give a maximum of 50 blocks back.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: API Key
$config = RadioManager\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = RadioManager\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');

$apiInstance = new RadioManager\Api\BlockApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$page = 1; // int | Current page *(Optional)*
$broadcast_id = 789; // int | Search on Broadcast ID *(Optional)* `(Relation)`
$item_id = 789; // int | Search on Item ID *(Optional)* `(Relation)`
$program_id = 789; // int | Search on Program ID *(Optional)* `(Relation)`
$start_min = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Minimum start date *(Optional)*
$start_max = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Maximum start date *(Optional)*
$limit = 789; // int | Results per page *(Optional)*
$order_by = "order_by_example"; // string | Field to order the results *(Optional)*
$order_direction = "order_direction_example"; // string | Direction of ordering *(Optional)*
$_external_station_id = 789; // int | Query on a different (content providing) station *(Optional)*

try {
    $result = $apiInstance->listBlocks($page, $broadcast_id, $item_id, $program_id, $start_min, $start_max, $limit, $order_by, $order_direction, $_external_station_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BlockApi->listBlocks: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
page int Current page (Optional) [optional] [default to 1]
broadcast_id int Search on Broadcast ID (Optional) `(Relation)` [optional]
item_id int Search on Item ID (Optional) `(Relation)` [optional]
program_id int Search on Program ID (Optional) `(Relation)` [optional]
start_min \DateTime Minimum start date (Optional) [optional]
start_max \DateTime Maximum start date (Optional) [optional]
limit int Results per page (Optional) [optional]
order_by string Field to order the results (Optional) [optional]
order_direction string Direction of ordering (Optional) [optional]
_external_station_id int Query on a different (content providing) station (Optional) [optional]

Return type

\RadioManager\Model\BlockResults

Authorization

[API Key](../../README.md#API Key)

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]