|
NAMENexmo::SMS::Response - Module that represents a response from Nexmo SMS API! VERSIONversion 0.06 SYNOPSISThis module represents a response from Nexmo. use Nexmo::SMS::Response;
my $nexmo = Nexmo::SMS::Response->new(
json => '{
"message-count":"1",
"messages":[
{
"status":"4",
"message-id":"message001",
"client-ref":"Test001 - Reference",
"remaining-balance":"20.0",
"message-price":"0.05",
"error-text":""
}
]
}',
);
for my $message ( $response ) {
print $message->status;
}
VERSIONVersion 0.01 METHODSnewcreate a new object my $foo = Nexmo::SMS::Response->new(
json => '{
"message-count":"1",
"messages":[
{
"status":"4",
"message-id":"message001",
"client-ref":"Test001 - Reference",
"remaining-balance":"20.0",
"message-price":"0.05",
"error-text":""
}
]
}',
);
messagesreturns the list of messages included in the response. Each element is an object of Nexmo::SMS::Response::Message. my @messages = $response->messages; errstrreturn the "last" error as string. print $response->errstr; is_successreturns 1 if all messages have a status = 0, "undef" otherwise. is_errorReturns 1 if an error occured, 0 otherwise... ATTRIBUTESThese attributes are available for "Nexmo::SMS::TextMessage" objects: $nexmo->status( 'status' ); my $status = $nexmo->status;
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)
|