API-Drip-Request
view release on metacpan or search on metacpan
bin/drip_client.pl view on Meta::CPAN
=item B<-v,-verbose>
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
bin/drip_client.pl view on Meta::CPAN
Integer ID of a workflow.
=back
=head1 DESCRIPTION
B<drip_client.pl> is a command-line interface to the API::Drip library. It's
a handy way to verify your connection to Drip is working as expected, and
possibly to do some light-weight manipulation of your data.
=cut
use v5.14;
use strict;
use lib '/usr/pair/perl/lib';
use Pair::Result ':all';
use Data::Printer;
use Getopt::Long;
lib/API/Drip/Request.pm view on Meta::CPAN
=item HTTP Method (required)
May be 'GET', 'POST', 'DELETE', 'PATCH', etc..
=item Endpoint (requird)
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->(@_);
lib/API/Drip/Request.pm view on Meta::CPAN
if ( $@ ) {
$self->{debugger}->('Failed to decode JSON:', $@, $result->content);
die $result;
}
return $decoded;
}
=head1 CONFIGURATION
Configuration data may be passed in through a number of different ways, which are searched in the following order of preference:
=over
=item 1. As direct paramteters to new().
=item 2. As environment variables.
=item 3. As elments of the first YAML configuration file that is found and readable in the following locations:
=over
lib/API/Drip/Request.pm view on Meta::CPAN
=item 1. The location specified by the DRIP_CLIENT_CONF parameter supplied to new().
=item 2. The location specified by $ENV{DRIP_CLIENT_CONF}.
=item 3. $ENV{HOME}/.drip.conf
=back
=back
The following configuration data is accepted:
=over
=item * DRIP_TOKEN (required)
This is the user token assigned to you by drip. When you are logged in, look for "API Token" at https://www.getdrip.com/user/edit
=item * DRIP_ID (required)
This is the numeric user id assigned to you by drip. When logged in, find it in your settings under Account->General Info.
( run in 0.772 second using v1.01-cache-2.11-cpan-49f99fa48dc )