NAME
DAPNET::API - Use the DAPNET API from Perl
SYNOPSIS
my($dapnetobj) = DAPNET::API->new({ DAPNET_USERNAME => '<username>', DAPNET_PW => '<password>', CALLSIGN => '<your callsign>' });
$ret = $dapnetobj->send_rubric_content(<text to send>,<rubric name>.<transmitter group name>,<sequence number 1 - 10>);
$ret = $dapnetobj->send_individual_call(<text>,<destination callsign>,<transmitter group name>,<emergency boolean>));
if ($ret) { print('HTTP Error response: '.$ret."\n"); } else { print("Message sent\n"); }
DESCRIPTION
Implementation of the DAPNET REST API in Perl.
AUTHOR
Simon (G7RZU) <simon@gb7fr.org.uk>
METHODS
This section describes the methods that are implemented and their use.
new
Instantiates new object. Pass a hash reference with options as follows
my($dapnetobj) = DAPNET::API->new({ DAPNET_USERNAME => '<username>', DAPNET_PW => '<password>', CALLSIGN => '<your callsign>' DEBUG => [0|1] });
returns an object if sucessful or false if not sucessful
json_response
Returns a hash ref to the last JSON response or undef if there is none
$jsonhashref = $jsonobj->json_response;
send_individual_call
Send a call to a single callsign
$ret = $dapnetobj->send_individual_call(<text>,<destination callsign>,<transmitter group name>,<emergency boolean>));
Returns 0 on sucess or the HTTP error string on error.
send_rubric_content
Sends a message to a rubric
$ret = $dapnetobj->send_rubric_content(<text to send>,<rubric name>.<transmitter group name>,<sequence number 1 - 10>,<send call? [0|1]>);
Returns 0 on sucess or the HTTP error string on error.