Net::FreshBooks::API::OAuth - FreshBooks OAuth implementation


Net-FreshBooks-API documentation  | view source Contained in the Net-FreshBooks-API distribution.

Index


NAME

Top

Net::FreshBooks::API::OAuth - FreshBooks OAuth implementation

VERSION

Top

version 0.21

DESCRIPTION

This package subclasses Net::OAuth::Simple, which is itself a wrapper around Net::OAuth You shouldn't need to deal with this class directly, but it's available to you if you need it. Any of the methods which Net::OAuth::Simple uses are available to you. This subclass only overrides the new() method.

SYNOPSIS

    # these params are required
    my $oauth = Net::FreshBooks::API::OAuth->new(
        consumer_key        => $consumer_key,
        consumer_secret     => $consumer_secret,
        account_name        => $account_name,
    );

    # if you already have your access_token and access_token_secret:
    my $oauth = Net::FreshBooks::API::OAuth->new(
        consumer_key        => $consumer_key,
        consumer_secret     => $consumer_secret,
        access_tokey        => $access_token,
        access_token_secret => $access_token_secret,
        account_name        => $account_name,
    );

new()

consumer_key, consumer_key_secret and account_name are all required params:

    my $oauth = Net::FreshBooks::API::OAuth->new(
        consumer_key        => $consumer_key,
        consumer_secret     => $consumer_secret,
        account_name        => $account_name,
    );

If you have already gotten your access tokens, you may create a new object with them as well:

    my $oauth = Net::FreshBooks::API::OAuth->new(
        consumer_key        => $consumer_key,
        consumer_secret     => $consumer_secret,
        access_token        => $access_token,
        access_token_secret => $access_token_secret,
        account_name        => $account_name,
    );

restricted_request( $url, $content )

If you have provided your consumer and access tokens, you should be able to make restricted requests.

    my $request = $oauth->restricted_request( $api_url, $xml )

Returns an HTTP::Response object

AUTHORS

Top

COPYRIGHT AND LICENSE

Top


Net-FreshBooks-API documentation  | view source Contained in the Net-FreshBooks-API distribution.