|
NAMENexmo::SMS::BinaryMessage - Module that respresents a binary message for the Nexmo SMS API! VERSIONversion 0.06 SYNOPSISThis module simplifies sending SMS through the Nexmo API. use Nexmo::SMS::BinaryMessage;
my $nexmo = Nexmo::SMS::BinaryMessage->new(
server => 'http://rest.nexmo.com/sms/json',
username => 'testuser1',
password => 'testpasswd2',
text => 'This is a test',
from => 'Test02',
to => '452312432',
);
my $response = $sms->send || die $sms->errstr;
if ( $response->is_success ) {
print "SMS was sent...\n";
}
VERSIONVersion 0.02 METHODSnewcreate a new object my $message = Nexmo::SMS::BinaryMessage->new(
server => 'http://rest.nexmo.com/sms/json',
username => 'testuser1',
password => 'testpasswd2',
);
This method recognises these parameters: body => 'required',
udh => 'required',
type => 'required',
from => 'required',
to => 'required',
server => 'required',
username => 'required',
password => 'required',
status_report_req => 'optional',
client_ref => 'optional',
network_code => 'optional',
user_agentGetter/setter for the user_agent attribute of the object. By default a new object of LWP::UserAgent is used, but you can use your own class as long as it is compatible to LWP::UserAgent. $sms->user_agent( MyUserAgent->new ); my $ua = $sms->user_agent; errstrreturn the "last" error as string. print $sms->errstr; sendThis actually calls the Nexmo SMS API. It returns a Nexmo::SMS::Response object or "undef" (on failure). my $sms = Nexmo::SMS::BinaryMessage->new( ... ); $sms->send or die $sms->errstr; check_needed_paramsThis method checks if all needed parameters are passed. my $params_not_ok = Nexmo::SMS::BinaryMessage->check_needed_params( ... );
if ( $params_not_ok ) {
print "Please check $params_not_ok";
}
AttributesThese attributes are available for "Nexmo::SMS::TextMessage" objects:
ACKNOWLEDGEMENTSCOPYRIGHT & LICENSECopyright 2011 Renee Baecker. This program is released under the following license: artistic_2 AUTHORRenee Baecker <module@renee-baecker.de> COPYRIGHT AND LICENSEThis software is Copyright (c) 2011 by Renee Baecker. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible)
|