Skip to content

Latest commit

 

History

History
233 lines (166 loc) · 7.64 KB

BlockApi.md

File metadata and controls

233 lines (166 loc) · 7.64 KB

RadioManagerClient::BlockApi

Load the API package

use RadioManagerClient::Object::BlockApi;

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

Method HTTP request Description
get_block_by_id GET /blocks/{id} Get block by id
get_current_block GET /blocks/current Get current Block
get_next_block GET /blocks/next Get upcoming Block
list_blocks GET /blocks Get a list of all blocks currently in your station.

get_block_by_id

BlockResult get_block_by_id(id => $id, _external_station_id => $_external_station_id)

Get block by id

Get block by id

Example

use Data::Dumper;
use RadioManagerClient::BlockApi;
my $api_instance = RadioManagerClient::BlockApi->new(

    # Configure API key authorization: API Key
    api_key => {'api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'api-key' => 'Bearer'},
);

my $id = 789; # int | ID of Block **(Required)**
my $_external_station_id = 789; # int | Query on a different (content providing) station *(Optional)*

eval { 
    my $result = $api_instance->get_block_by_id(id => $id, _external_station_id => $_external_station_id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BlockApi->get_block_by_id: $@\n";
}

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

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]

get_current_block

BlockResult get_current_block()

Get current Block

Get current Block

Example

use Data::Dumper;
use RadioManagerClient::BlockApi;
my $api_instance = RadioManagerClient::BlockApi->new(

    # Configure API key authorization: API Key
    api_key => {'api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'api-key' => 'Bearer'},
);


eval { 
    my $result = $api_instance->get_current_block();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BlockApi->get_current_block: $@\n";
}

Parameters

This endpoint does not need any parameter.

Return type

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]

get_next_block

BlockResult get_next_block()

Get upcoming Block

Get upcoming Block

Example

use Data::Dumper;
use RadioManagerClient::BlockApi;
my $api_instance = RadioManagerClient::BlockApi->new(

    # Configure API key authorization: API Key
    api_key => {'api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'api-key' => 'Bearer'},
);


eval { 
    my $result = $api_instance->get_next_block();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BlockApi->get_next_block: $@\n";
}

Parameters

This endpoint does not need any parameter.

Return type

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]

list_blocks

BlockResults list_blocks(page => $page, broadcast_id => $broadcast_id, item_id => $item_id, program_id => $program_id, start_min => $start_min, start_max => $start_max, limit => $limit, order_by => $order_by, order_direction => $order_direction, _external_station_id => $_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

use Data::Dumper;
use RadioManagerClient::BlockApi;
my $api_instance = RadioManagerClient::BlockApi->new(

    # Configure API key authorization: API Key
    api_key => {'api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'api-key' => 'Bearer'},
);

my $page = 789; # int | Current page *(Optional)*
my $broadcast_id = 789; # int | Search on Broadcast ID *(Optional)* `(Relation)`
my $item_id = 789; # int | Search on Item ID *(Optional)* `(Relation)`
my $program_id = 789; # int | Search on Program ID *(Optional)* `(Relation)`
my $start_min = DateTime->from_epoch(epoch => str2time('2013-10-20T19:20:30+01:00')); # DateTime | Minimum start date *(Optional)*
my $start_max = DateTime->from_epoch(epoch => str2time('2013-10-20T19:20:30+01:00')); # DateTime | Maximum start date *(Optional)*
my $limit = 789; # int | Results per page *(Optional)*
my $order_by = 'order_by_example'; # string | Field to order the results *(Optional)*
my $order_direction = 'order_direction_example'; # string | Direction of ordering *(Optional)*
my $_external_station_id = 789; # int | Query on a different (content providing) station *(Optional)*

eval { 
    my $result = $api_instance->list_blocks(page => $page, broadcast_id => $broadcast_id, item_id => $item_id, program_id => $program_id, start_min => $start_min, start_max => $start_max, limit => $limit, order_by => $order_by, order_direction => $order_direction, _external_station_id => $_external_station_id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BlockApi->list_blocks: $@\n";
}

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

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]