WWW::StreamSend - StreamSend API implementation
use WWW::StreamSend; my $ss = WWW::StreamSend->new({login_id => 'login_id', key => 'key'}); my $user_info = $ss->get_field({ field => 'users', id => 1 }); my $audience = $ss->get_field({ field => 'audiences', id => 1 }); my $active_users_in_audience = $ss->get_subscribers_count({ audience => 1, type => 'active' });
A Perl implementation of the StreamSend mailing list management API
The following constructor method is available:
This method constructs a new StreamSend::API object and returns it. Key/value pair arguments must be provided to set up the initial state. The following options are accepted:
StreamSend::API
login_id key
login_id and key are mandatory
The methods described in this section are used to dispatch requests. The following request methods are provided:
This method will dispatch a GET request to fetch all saved emails for the account. It realises the Public Instant method index() of StreamSend Emails API Returns the XML data on success
GET
index()
This method will dispatch a GET request to fetch subscribers in given audience. It realises the Public Instant methods index() and show() of StreamSend People API Returns the XML data on success
show()
The following options are accepted:
audience - ID of audience, mandatory option subscriber_id - ID of current subscriber. If no subscriber_id given, method returns ALL subscribers in given audience
Returns the counter value for subscribers in given audience. Example:
my $count = $ss->get_subscribers_count({audience => 1, type => 'active'});
Available values for 'type' key are: 'active', 'inactive', 'unsubscribed', 'pending'
Dispatch a GET request to fetch current audience or audience list. Example:
my $audience = $ss->get_audience({id => 1}); my @audiences_all = $ss->get_audience;
Returns either one WWW::StreamSend::Audience instance or list of them.
Dispatch a POST request to add new subscriber to given audience. Realises the Public Instant method create() of StreamSend People API
POST
create()
Mandatory options:
email-address first-name last-name
Optional:
deliver-welcome (default value is 'true')
http://app.streamsend.com/docs/api/index.html
Michael Katasonov, <dionabak@gmail.com>
Copyright (C) 2011 by Michael Katasonov
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.
To install WWW::StreamSend, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::StreamSend
CPAN shell
perl -MCPAN -e shell install WWW::StreamSend
For more information on module installation, please visit the detailed CPAN module installation guide.