0.1.0 • Published 7 years ago

stamps-api v0.1.0

Weekly downloads
7
License
ISC
Repository
github
Last release
7 years ago

#Stamps API NPM version

Stamps.com node.js client

A client for stamps.com API.

Sign up with stamps.com developer program to receive credentials to the API.

##Installation npm install stamps-api

##API

###Create client Create client for work with Stamps api.

var Stamps = require('stamps-api');

###Auth client For use most api's you need auth with your Stamps account data

Stamps.connect().then(() => {
    Stamps.auth(options).then(() => {
    	console.log(options);
    });
});
  • options - is a object with fields
  • auth function has 2 parameter type of bool, if his true make request for get auth token from stamps else use creaditials as auth data(by default false)
  • connect - this function have parameter type of object with property isDev for enable dev mode

Exmaple:

Stamps.connect({isDev: true}).then(() => {
    Stamps.auth(options).then(() => {
    	console.log(options);
    });
});
{
    "id": "your_integrations_stamps_id",
    "username": "you_stmaps_username",
    "password": "you_stmaps_password"
}

###Make request For send requests to stamps use this api after connect and auth. Example get track number.

Stamps.request('TrackShipment', {
    TrackingNumber: 'needed_track_Number'
}).then(function(trackingResponse) {
	console.log(trackingResponse);
});

#Run test

Before run test set env variables you stamps auth data:

STAMPS_ID
STAMPS_USERNAME
STAMPS_PASSWORD
npm test
0.1.0

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago