NAME
SMS::API::CMTelecom - SMS API for cmtelecom.com
VERSION
Version 0.01
SYNOPSIS
use SMS::API::CMTelecom;
my $sms = SMS::API::CMTelecom->new(
product_token => '00000000-0000-0000-0000-000000000000',
);
$sms->send(
sender => $sender,
message => 'please call me!',
recipients => '00490000000000000',
reference => 293854,
);
# bulk send to many recipients:
$sms->send(
sender => $sender,
message => 'please call me!',
recipients => ['00490000000000000', '00480000000000', '004300021651202'],
reference => 293854,
);
METHODS
new(%options)
Instantiate and initialise object with the following options:
product_token => $product_token
-
The product token is required to authenticate with the CM Telecom API.
sender => $sender
-
Optional. SMS sender number.
send
message => $message
-
Mandatory. Message text to send.
recipients => $recipients
-
Mandatory. May be a scalar containing one phone number or an array reference holding multiple scalars containing one phone number each.
sender => $sender
-
Optional. Can also be set globally when construction the object with
new()
.
If sending fails, undef
is returned, otherwise a hashref with some status information:
{
messages => [
{
messageDetails => undef,
parts => 1,
reference => 51314,
status => "Accepted",
to => "0049123456784510",
},
],
}
You can retrieve the error message via
my $msg = $sms->error_message();
error_message
Returns the last set error message.
AUTHOR
Dominic Sonntag, <dominic at s5g.de>
BUGS AND SUPPORT
Please report any bugs or feature requests on Github: https://github.com/sonntagd/SMS-API-CMTelecom/issues
LICENSE AND COPYRIGHT
Copyright 2017 Dominic Sonntag.
This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at: