Featured Project: eBay SDK for Perl
Perl Module eBay - API ver. 0.22
Project: eBay::API Perl Module
Authors: (alphabetical) Robert Bradley, Mike Evans, Milenko Milanovic, Jeff Nokes
This is a project started internally by eBay engineering that is now being made available to the public. It provides a basic framework to Perl-based API clients for integrating with eBay's Trading API. It consists of an OO Perl class hierarchy, that can control all facets of communication with eBay. Some of the features include:
- Support for the XML API interface (will possibly add SOAP and/or REST interfaces in the future)
- Tools for auto-generation of all command and data type classes based on published XML schema
- Tools for generating HTML-based documentation, based on all provided and auto-generated POD
- Capability to send "n" calls asynchronously in parallel, or synchronously
- Sessions for basic transaction usage (no rollback capabilities)
- Retry logic to auto-retry API calls
- Error stub capabilities to force errors on calls (without really sending them); test your handling
- Exception/Error handling framework to integrate with your application
- Logging framework to integrate with your application
- [De]Compression for handling gzip'd data
Installation
This module is available on CPAN for download. It has many prerequisite modules; the install process will let you know if you missing any of them. You should be able to install this module the standard way via make, make test, make install; via perl -MCPAN, or any other mechanism that makes use of standard Perl modules. Please refer to the information in the package file INSTALL for further details and examples.
Downloads
License
License: Common Development and Distribution License (CDDL)
The CDDL license shown as applicable on this page IS NOT the same as the one included in the CPAN distribution. The one in the distribution supercedes all others.
Usage Examples:
Here are some examples taken from the POD documentation in API.pm in this package:
# 1. GeteBayOfficialTime
use eBay::API::XML::Call::GeteBayOfficialTime;
my $pCall = eBay::API::XML::Call::GeteBayOfficialTime->new();
$pCall->execute();
my $sOfficialTime = $pCall->getEBayOfficialTime();
# 2. GetUser
use eBay::API::XML::Call::GetUser;
use eBay::API::XML::DataType::Enum::DetailLevelCodeType;
my $pCall = eBay::API::XML::Call::GetUser->new();
$pCall->setDetailLevel( [eBay::API::XML::DataType::Enum::DetailLevelCodeType::ReturnAll] );
$pCall->setUserID('userId');
$pCall->execute();
my $pUser = $pCall->getUser();
my $sStatusCode = $pUser->getStatus();
my $sSiteCode = $pUser->getSite();
# 3. VerifyAddItem
use eBay::API::XML::Call::VerifyAddItem;
use eBay::API::XML::DataType::ItemType;
use eBay::API::XML::DataType::CategoryType;
use eBay::API::XML::DataType::Enum::CountryCodeType;
use eBay::API::XML::DataType::Enum::CurrencyCodeType;
use eBay::API::XML::DataType::Enum::ListingTypeCodeType;
use eBay::API::XML::DataType::Enum::BuyerPaymentMethodCodeType;
my $pItem = eBay::API::XML::DataType::ItemType->new();
$pItem->setCountry(eBay::API::XML::DataType::Enum::CountryCodeType::US);
$pItem->setCurrency(eBay::API::XML::DataType::Enum::CurrencyCodeType::USD);
$pItem->setDescription('item description.');
$pItem->setListingDuration(eBay::API::XML::DataType::Enum::ListingTypeCodeType::Days_1);
$pItem->setLocation('San Jose, CA');
$pItem->setPaymentMethods(eBay::API::XML::DataType::Enum::BuyerPaymentMethodCodeType::PaymentSeeDescription);
$pItem->setQuantity(1);
$pItem->getStartPrice()->setValue(1.0);
$pItem->setTitle('item title');
my $pCat = eBay::API::XML::DataType::CategoryType->new();
$pCat->setCategoryID(357);
$pItem->setPrimaryCategory($pCat);
my $pCall = eBay::API::XML::Call::VerifyAddItem->new();
$pCall->setItem($pItem);
$pCall->execute();
$sItemId = $pCall->getItemID()->getValue();
Documentation
We did our best to add POD documentation as much as possible, so please refer to that first before asking questions. Also, even though this SDK provides auto-generation of command and data type classes and relative POD documentation, it is VERY important that users of this SDK also consult the official eBay Trading API documentation as the classes generated here ARE NOT a replacement for it.
Featured Project not available
This Featured project is no longer available.