API-Basecamp

 view release on metacpan or  search on metacpan

README.mkdn  view on Meta::CPAN

# VERSION

version 0.06

# SYNOPSIS

    use API::Basecamp;

    my $basecamp = API::Basecamp->new(
        username   => 'USERNAME',
        password   => 'PASSWORD',
        identifier => 'APPLICATION NAME',
        account    => 'ACCOUNT NUMBER',
    );

    $basecamp->debug(1);
    $basecamp->fatal(1);

    my $project = $basecamp->projects('605816632');
    my $results = $project->fetch;

README.mkdn  view on Meta::CPAN


The account attribute should be set to the account holder's account ID number.

## identifier

    $basecamp->identifier;
    $basecamp->identifier('IDENTIFIER');

The identifier attribute should be set to a string that identifies your application.

## password

    $basecamp->password;
    $basecamp->password('PASSWORD');

The password attribute should be set to the account holder's password.

## username

    $basecamp->username;
    $basecamp->username('USERNAME');

The username attribute should be set to the account holder's username.

## debug

lib/API/Basecamp.pm  view on Meta::CPAN

our $DEFAULT_URL = "https://basecamp.com";

# ATTRIBUTES

has account => (
    is       => 'rw',
    isa      => Str,
    required => 1,
);

has password => (
    is       => 'rw',
    isa      => Str,
    required => 1,
);

has username => (
    is       => 'rw',
    isa      => Str,
    required => 1,
);

lib/API/Basecamp.pm  view on Meta::CPAN

has '+version' => (
    default  => 1,
    required => 0,
);

# CONSTRUCTION

after BUILD => method {

    my $username   = $self->username;
    my $password   = $self->password;
    my $account    = $self->account;
    my $version    = $self->version;

    my $userinfo   = "$username:$password";
    my $url        = $self->url;

    $url->path("/$account/api/v$version");
    $url->userinfo($userinfo);

    return $self;

};

# METHODS

lib/API/Basecamp.pm  view on Meta::CPAN

    # build new resource instance
    my $instance = __PACKAGE__->new(
        debug      => $self->debug,
        fatal      => $self->fatal,
        retries    => $self->retries,
        timeout    => $self->timeout,
        user_agent => $self->user_agent,
        account    => $self->account,
        identifier => $self->identifier,
        username   => $self->username,
        password   => $self->password,
        version    => $self->version,
    );

    # resource locator
    my $url = $instance->url;

    # modify resource locator if possible
    $url->path(join '/', $self->url->path, @segments);

    # return resource instance

lib/API/Basecamp.pm  view on Meta::CPAN

=head1 VERSION

version 0.06

=head1 SYNOPSIS

    use API::Basecamp;

    my $basecamp = API::Basecamp->new(
        username   => 'USERNAME',
        password   => 'PASSWORD',
        identifier => 'APPLICATION NAME',
        account    => 'ACCOUNT NUMBER',
    );

    $basecamp->debug(1);
    $basecamp->fatal(1);

    my $project = $basecamp->projects('605816632');
    my $results = $project->fetch;

lib/API/Basecamp.pm  view on Meta::CPAN


The account attribute should be set to the account holder's account ID number.

=head2 identifier

    $basecamp->identifier;
    $basecamp->identifier('IDENTIFIER');

The identifier attribute should be set to a string that identifies your application.

=head2 password

    $basecamp->password;
    $basecamp->password('PASSWORD');

The password attribute should be set to the account holder's password.

=head2 username

    $basecamp->username;
    $basecamp->username('USERNAME');

The username attribute should be set to the account holder's username.

=head2 debug



( run in 0.628 second using v1.01-cache-2.11-cpan-49f99fa48dc )