Node.js eBay API promise: Send requests to eBay API using Node.js

Recommend this page to a friend!
  Info   Documentation   View files Files   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2023-10-28 (9 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 77 All time: 462 This week: 3Up
Version License JavaScript version Categories
qebayapi 0.2.0MIT/X Consortium ...5Node.js, Web services
Description 

Author

This is a Node.js module to send requests to eBay API.

It sends XML HTTP POST requests to the eBay trading API Web server.

The module uses Q promises fulfilled or rejected passing the response optionally parsed when it is the JSON format when it succeeds, or the error message for missing parameters or unknown trading API call when it fails.

Picture of Daniele Cruciani
  Performance   Level  
Name: Daniele Cruciani <contact>
Classes: 2 packages by
Country: Italy Italy
Age: 48
All time rank: 882 in Italy Italy
Week rank: 6 Up1 in Italy Italy Up
Innovation award
Innovation award
Nominee: 1x

Winner: 1x

Documentation

qebayapi ======== Promise oriented ebay api interface. Trading API. eBay Trading API support xml and soap. This implementation use xml interface. It is almost asynchronous via Kriskoval's Q implemenation of promise. Just one call now. var ebayapi = require("qebayapi"); var options = {appName: '...','appCert':'...','devName':'...','callname':'GetItem','requestJSON':{'ItemID':'341341341'}, parseMode: 'json' }; ebayapi.TradingApi(options) .then(function(response) { console.log(response.response.Ack); console.log('response': response.response); }); It use q-io, so it is almost asynchronous, something could be improved in this field for request xml creation phase. https://github.com/benbuckman/nodejs-ebay-api is another nodejs module for ebay api interface qebayapi have a number of advance over nodejs-ebay-api related to ebay trading api Advance over other implementation ================================= It has a single parameter structured, it means **complete isolation** of every call from each other, ie you can use it concurrently for a number of ebay application (say sandbox and production app), or response type required. You have the control with little switches, **parseMode**: json, xmlNode, xmlString let you choose what to get back based on your need. (extending this with other parsing method is out of scope) Input switch, **rMode** : json, xmlNode, xmlString. Let you manage your request as you need, ie manipulate and resend to the eBay, without transforming those in json for passing the library: hey, the eBay trading api is already xml, skip unuseful translations. It use q promise from kriskowal and q-io, it is completely asynchronous (at least for what is sensible). It **verify** legal call name! This option could be disabled, but it verify if the callname you pass is in trading api call list, and fail if not conforming. [a simple code to paste into console while surfing ebay api site to generate the callname list is in index.js code as comment: var apiCallNames = []; $("table tr td:first-child a").each(function(a,b,c) { apiCallNames.push(b.text); }); console.log(JSON.stringify(apiCallNames)); // from chrome console url: developer.ebay.com/Devzone/xml/docs/Reference/eBay/index.html ] It is **only trading api**. Only ebay trading api. It is separate because it use only xml protocol and there are no other way to comminicate with trading api. Its variable scope is simple, clean, no massive reference to local variable, strong isolation. Code improvements ================= Separate concerns: 1. request creation in its own class, then use strategy pattern: what is rMode (request mode)? 'json', 'xmlNode', 'xmlString' and ... how to extend it? function or {preparse:function(opts), create:function(opts), createHeaders: function(opts) } 1. parse response: parseMode == 'json' or ... function(opts) Rationale: * testing: make ebayXml2JsonParse testable * improving api. i.e. callname based options # Credits This project was developed as opensource library for actracting and promoting collaborative developer, but was part of a wider project developer for LinguisticStudio.it (https://linguisticstudio.it/)

  Files folder image Files (7)  
File Role Description
Files folder imagespec (3 files)
Accessible without login Plain text file api-info.json Data ebay api info
Plain text file index.js Class the module file
Accessible without login Plain text file package.json Data npm info
Accessible without login Plain text file README.md Doc. readme

  Files folder image Files (7)  /  spec  
File Role Description
  Accessible without login Plain text file app-credential-ex.json Data data for test
  Accessible without login Plain text file README Doc. test info
  Accessible without login Plain text file test-trading-spec.js Test test

 Version Control Unique User Downloads Download Rankings  
 100%
Total:77
This week:0
All time:462
This week:3Up