NAME
eBay::API::Simple::Finding - Support for eBay's Finding 2.0 web service
DESCRIPTION
This class provides support for eBay's Finding 2.0 web services.
See http://developer.ebay.com/products/finding/
USAGE
my $call = eBay::API::Simple::Finding->new(
{ appid => '<your app id here>' }
);
$call->execute( 'findItemsByKeywords', { keywords => '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( 'totalEntries' );
my @nodes = $dom->findnodes(
'//item'
);
foreach my $n ( @nodes ) {
print $n->findvalue('title/text()') . "\n";
}
SANDBOX USAGE
my $call = eBay::API::Simple::Finding->new( {
appid => '<your app id here>',
domain => 'svcs.sandbox.ebay.com',
} );
$call->execute( 'findItemsByKeywords', { keywords => '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();
PUBLIC METHODS
new( { %options } }
Constructor for the Finding API call
my $call = eBay::API::Simple::Finding->new( {
appid => '<your app id here>'
...
} );
Options
- appid (required)
-
This appid is required by the web service. App ids can be obtained at http://developer.ebay.com
- siteid
-
eBay site id to be supplied to the web service endpoint
defaults to EBAY-US
- domain
-
domain for the web service endpoint
defaults to svcs.ebay.com
- service
-
SOA Service name
defaults to FindingService
- uri
-
endpoint URI
defaults to /services/search/FindingService/v1
- version
-
Version to be supplied to the web service endpoint
defaults to 1.0.0
- https
-
Specifies is the API calls should be made over https.
defaults to 0
- enable_attributes
-
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' }
defaults to 0
ALTERNATE CONFIG VIA ebay.yaml
An ebay.yaml file can be use 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
prepare( $verb, $call_data )
$self->prepare( 'findItemsByKeywords', { keywords => 'shoe' } );
This method will construct the API request based on the $verb and the $call_data.
- $verb (required)
-
call verb, i.e. findItemsItemsByKeywords
- $call_data (required)
-
hashref of call_data that will be turned into xml.
BASECLASS METHODS
request_agent
Accessor for the LWP::UserAgent request agent
request_object
Accessor for the HTTP::Request request object
request_content
Accessor for the complete request body from the HTTP::Request object
response_content
Accessor for the HTTP response body content
response_object
Accessor for the HTTP::Request response object
response_dom
Accessor for the LibXML response DOM
response_hash
Accessor for the hashified response content
nodeContent( $tag, [ $dom ] )
Helper for LibXML that retrieves node content
errors
Accessor to the hashref of errors
has_error
Returns true if the call contains errors
errors_as_string
Returns a string of API errors if there are any.
PRIVATE METHODS
_get_request_body
This method supplies the XML body for the web service request
_get_request_headers
This method supplies the HTTP::Headers obj for the web service request
_get_request_object
This method creates and returns the HTTP::Request object for the web service call.
AUTHOR
Tim Keefer <tim@timkeefer.com>
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 204:
'=item' outside of any '=over'
- Around line 228:
You forgot a '=back' before '=head1'