GithubHelp home page GithubHelp logo

ebayapibundle's Introduction

EbayApiBundle

This project intends to create a simple wrapper around main eBay APIs:

  • Shopping
  • Finding
  • Trading

Caution: Calls for Trading API are in progress... Coming soon.

SensioLabsInsightLatest Stable Version Total Downloads Latest Unstable Version License API Reference (supporting calls)

  • Shopping API (version 897)

    • FindHalfProducts
    • FindPopularItems
    • FindPopularSearches
    • FindProducts
    • FindReviewsAndGuides
    • GetCategoryInfo
    • GeteBayTime
    • GetItemStatus
    • GetMultipleItems
    • GetShippingCosts
    • GetSingleItem
    • GetUserProfile
  • Finding API (version 1.13.0)

    • findCompletedItems
    • findItemsAdvanced
    • findItemsByCategory
    • findItemsByImage Caution: temporary not Supporting!
    • findItemsByKeywords
    • findItemsByProduct
    • findItemsIneBayStores
    • getHistograms
    • getSearchKeywordsRecommendation
    • getVersion
  • Trading API (version 903)

    • GetCategories
    • Caution: Other calls are in progress...

Simple example

(in controller):

$api = 'Shopping';
$callName = 'GetSingleItem';
$ebay = $this->get('web_consul_ebay_api.main');
$call = $ebay->getInstance('Shopping', 'GetSingleItem', $ebay::MODE_PRODUCT);
$variationSpecifics = [];
$nameValueList = new NameValueList();
$nameValueList->setName('Colour')->setValue(['RED']);
$variationSpecifics[] = $nameValueList;
// set Call-specific and  Standard Input Fields
$call
     ->setItemID(151551119370)
     ->setIncludeSelector('Details, Variations')
     ->setVariationSpecifics($variationSpecifics);
// get response in XML format     
$service = $this->get('web_consul_ebay_api.make_call');
$output = $service->getResponse($call);

Typically, the request properties are set by the standard setter. For more complex structures and containers created special types:

  • WebConsul\EbayApiBundle\Type
    • Affiliate
    • AspectFilter
    • ItemFilter
    • NameValueList
    • PaginationInput
    • ProductID
    • RequesterCredentials

Full documentation will be stored in the Resources/doc/index.md

Installation

Step 1: Download EbayApiBundle using composer

Add EbayApiBundle in your composer.json:

{
    "require": {
       "webconsul/ebay-api-bundle": "dev-master"
    }
}

Step 2: Update composer

$ php composer.phar update webconsul/ebay-api-bundle

Step 3: Enable the bundle

<?php
// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new WebConsul\EbayApiBundle\WebConsulEbayApiBundle(),
    );
}

Step 4: Enable JMS Serializer

This bundle needs JMS Serializer to work correctly. So, you need register it:

<?php
// app/AppKernel.php
public function registerBundles()
{
    // ...
    new JMS\SerializerBundle\JMSSerializerBundle(),
    // ...
);
}

Step 4: Configure

For security reason all configuration parameters of the bundle must be added into parameters.yml:

parameters:
   ...
   web_consul_ebay_api:
      auth_token: 'YOUR TOKEN FOR TESTING API CALLS'
      application_keys:
        sandbox:
          dev_id: '...'
          app_id: '...'
          cert_id: '...'
        production:
          dev_id: '...'
          app_id: '...'
          cert_id: '...'

Values for that parameters you can get on your account page of [the eBay Developers program] (https://developer.ebay.com/DevZone/account/Default.aspx)

All the installation instructions are located in the documentation.

Examples of the API calls

If you want see samples for all supporting API call, you can configure CallController from the EbayApiBundle.

Step 1: Routing

// app/config/routing.yml
web_consul_ebay_api_homepage:
    resource: "@WebConsulEbayApiBundle/Controller/"
    type: annotation

Step 2: Browsing

Open in your browser: http://YOUR_HOST/callReference.

On that page you can see full list of the supporting API calls.

License

This bundle is under the MIT license. See the complete license in the bundle:

Resources/meta/LICENSE

Reporting an issue or a feature request

Issues and feature requests are tracked in the Github issue tracker.

ebayapibundle's People

Contributors

ekut avatar smatyas avatar xbugster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ebayapibundle's Issues

JMS\Serializer

Use JMS\Serializer for compose request in XML format.

All calls from Trading API

At the moment bundle is supporting only one call from Trading API (GetCategories).
We must support all calls from Trading API.

composer update error

I get following error on composer install for this bundle. dependency has old version of jms and I'm using new version. what can I do on this?

- webconsul/ebay-api-bundle dev-master requires jms/serializer-bundle ~0.13 -> no matching package found.

my composer.json:

    "jms/serializer-bundle":                "^1.1",
     ...
    "webconsul/ebay-api-bundle":            "dev-master"

JSON format for requests and responses

JSON requests can be submitted using HTTP POST. By default, the call response for JSON requests is in XML format, but you can specify NV or JSON as a response format, if desired.
By default, the call response for XML requests is in XML format, but you can specify NV or JSON as a response format, if desired.

Add testing

Add functional test getResponse() method for each API Call.
There are 2 asserts:

  1. Node <Ack> contain Success
  2. Response contain <_CallName_Response> node.

@Desc Annotation

Hi got the following error when using the project

The annotation "@desc" in method WebConsul\EbayApiBundle\Call\BaseCall::getResponseFormat() was never imported.

Is this needed? I've removed it locally to get the project working for the time being.

Missing Merchandising API

The Marchendising API is not available in this bundle

Marchendising
The available methods of this API are:

  • getMostWatchedItems
  • getRelatedCategoryItems
  • getSimilarItems
  • getTopSellingProducts
  • getVersion

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.