NAME

WWW::StreamSend - StreamSend API implementation

SYNOPSIS

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'
});

DESCRIPTION

A Perl implementation of the StreamSend mailing list management API

CONSTRUCTOR METHOD

The following constructor method is available:

$ss = WWW::StreamSend->new( \%options )

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:

login_id
key

login_id and key are mandatory

REQUEST METHODS

The methods described in this section are used to dispatch requests. The following request methods are provided:

$ss->get_emails( )

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

$ss->get_subscribers( \%options )

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

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
$ss->get_subscribers_count( \%options )

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'

$ss->get_audience( \%options )

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.

$ss->add_subscriber( \%options )

Dispatch a POST request to add new subscriber to given audience. Realises the Public Instant method create() of StreamSend People API

Mandatory options:

email-address
first-name
last-name

Optional:

deliver-welcome (default value is 'true')

SEE ALSO

http://app.streamsend.com/docs/api/index.html

AUTHOR

Michael Katasonov, <dionabak@gmail.com>

COPYRIGHT AND LICENSE

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.