inpost-pl
node.js InPost.pl API wrapper Version 1.0.0
Details: https://b2b.paczkomaty.pl/pl/e-commerce/jak-sie-zintegrowac Download API docs: https://b2b.paczkomaty.pl/file/8
Usage:
$npm install inpost-pl
then:
var InPost = ;var inPostClient = options;
- options.auth = {email: 'your@email.com', password: 'password'} OR:
- options.test = true (putting test credentials)
- options.raw = true (returning XML result not JSON)
How to use InPost client?
inPostClient has 25 methods listed on index.js file. Each method has its action name which is "do" parameter (check in docs) and takes 0 to 2 arguments: (parameters, callback)
Parameters for each method are described in docs. Example call with callback:
inPostClient; inPostClient;
email and password parameters are not required if you set options.auth or options.test
Content parameter
You can pass content parameter as object:
var content = paczkomaty:pack: packcode: '638111024631612017700364'pack: packcode: '638111024631612017700363';
or XML string:
var content = '<paczkomaty>';content += '<pack><packcode>638111024631612017700364</packcode></pack>';content += '<pack><packcode>638111024631612017700363</packcode></pack>';content += '</paczkomaty>';
Handling files
Each method also returning its request, so you can pipe it.
var stream = inPostClientpdf;stream ;
InPost methods:
- InPost.parseBody(response, cb) - parsing raw response body
- InPost.setDefault(options) - setting app scope InPost.client and returning it.
var inPostClient = InPost;consoleconsole//true//true