API-Drip-Request
view release on metacpan or search on metacpan
bin/drip_client.pl view on Meta::CPAN
Be verbose about something. Specify it more than once to be even more verbose.
=item B<-conf>
Specify the location of a configuration file. Otherwise, defaults to location
specified in the DRIP_CLIENT_CONF environment variable or ~/.drip.conf. Data
in the configuration file must be encoded in YAML format. See
L<API::Drip::Request/"CONFIGURATION"> for the specific data that may be stored.
Each configuration item may also be overriden by setting an environment
variable with the same name.
=back
=head2 Operations
=over
=item B<getsub>
lib/API/Drip/Request.pm view on Meta::CPAN
use API::Drip::Request;
my $drip = API::Drip::Request->new();
$drip->do_request( POST => 'subscribers', { subscribers => [ { email => 'foo@example.com', ... }] } );
=head1 DESCRIPTION
Low-level perl interface to the Drip API as specified at https://www.getdrip.com/docs/rest-api
All of the methods in this module will throw exceptions on error.
=head1 SUBROUTINES/METHODS
=head2 new()
Creates the API::Drip::Request object. See L</"CONFIGURATION"> for accepted parameters.
Also accepts:
=over
lib/API/Drip/Request.pm view on Meta::CPAN
Specifies the path of the REST enpoint you want to query. Include everything after the account ID. For example, "subscribers", "subscribers/$subscriber_id/campaign_subscriptions", etc...
=item Content (optional)
Perl hashref of data that will be sent along with the request.
=back
On success, returns a Perl data structure corresponding to the data returned
from the server. Some operations (DELETE), do not return any data and may
return undef on success. On error, this method will die() with the
HTTP::Response object.
=cut
my $request_validator = validation_for( params => [ {type => Str()}, {type => Str()}, {type => HashRef(), optional => 1} ] );
sub do_request {
my $self = shift;
my ($method, $endpoint, $content) = $request_validator->(@_);
my $uri = URI->new($self->{DRIP_URI});
( run in 1.166 second using v1.01-cache-2.11-cpan-49f99fa48dc )