eBay::API::Simple::Shopping - Support for eBay's Shopping web service
This class provides support for eBay's Shopping web services.
See http://developer.ebay.com/products/shopping/
my $call = eBay::API::Simple::Shopping->new( { appid => '<your app id here>' } ); $call->execute( 'FindItemsAdvanced', { QueryKeywords => 'shoe' } ); if ( $call->has_error() ) { die "Call Failed:" . $call->errors_as_string(); } # getters for the response DOM or Hash my $dom = $call->response_dom(); my $hash = $call->response_hash(); print $call->nodeContent( 'Timestamp' ); print $call->nodeContent( 'TotalItems' ); my @nodes = $dom->findnodes( '/FindItemsAdvancedResponse/SearchResult/ItemArray/Item' ); foreach my $n ( @nodes ) { print $n->findvalue('Title/text()') . "\n"; }
my $call = eBay::API::Simple::Shopping->new( { appid => '<your app id here>', domain => 'open.api.sandbox.ebay.com', } ); $call->execute( 'FindItemsAdvanced', { QueryKeywords => 'shoe' } ); if ( $call->has_error() ) { die "Call Failed:" . $call->errors_as_string(); } # getters for the response DOM or Hash my $dom = $call->response_dom(); my $hash = $call->response_hash();
Constructor for the Finding API call
my $call = eBay::API::Simple::Shopping->new( { appid => '<your app id here>' ... } );
This appid is required by the web service. App ids can be obtained at http://developer.ebay.com
eBay site id to be supplied to the web service endpoint
defaults to 0
domain for the web service endpoint
defaults to open.api.ebay.com
endpoint URI
defaults to /shopping
Version to be supplied to the web service endpoint
defaults to 527
Specifies is the API calls should be made over https.
This flag adds support for attributes in the request. If enabled request data notes much be defined like so,
myElement => { content => 'element content', myattr => 'attr value' }
An ebay.yaml file can be used for configuring each service endpoint.
YAML files can be placed at the below locations. The first file found will be loaded.
./ebay.yaml, ~/ebay.yaml, /etc/ebay.yaml
Sample YAML:
# Trading - External api.ebay.com: appid: <your appid> certid: <your certid> devid: <your devid> token: <token> # Shopping open.api.ebay.com: appid: <your appid> certid: <your certid> devid: <your devid> version: 671 # Finding/Merchandising svcs.ebay.com: appid: <your appid> version: 1.0.0
$self->execute( 'FindItemsAdvanced', { QueryKeywords => 'shoe' } );
This method will construct the API request based on the $verb and the $call_data and then post the request to the web service endpoint.
call verb, i.e. FindItemsAdvanced
hashref of call_data that will be turned into xml.
Accessor for the LWP::UserAgent request agent
Accessor for the HTTP::Request request object
Accessor for the complete request body from the HTTP::Request object
Accessor for the HTTP response body content
Accessor for the HTTP::Request response object
Accessor for the LibXML response DOM
Accessor for the hashified response content
Helper for LibXML that retrieves node content
Accessor to the hashref of errors
Returns true if the call contains errors
Returns a string of API errors if there are any.
This method supplies the XML body for the web service request
This method supplies the HTTP::Headers obj for the web service request
This method creates and returns the HTTP::Request object for the web service call.
Tim Keefer <tim@timkeefer.com>
2 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
To install eBay::API::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm eBay::API::Simple
CPAN shell
perl -MCPAN -e shell install eBay::API::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.