This package has been deprecated

Author message:

WARNING: This project has been renamed to seeuletter. Install using npm install -S seeuletter instead.

lifebot

1.0.1 • Public • Published

lifebot-node

Lifebot.fr Node.js Client is a simple but flexible wrapper for the Lifebot.fr API.

See full Lifebot.fr documentation here.

For best results, be sure that you're using the latest version of the Lifebot API and the latest version of the Node.js wrapper.

French

Un module NPM pour envoyer du courrier postal en ligne depuis votre application Node.Js.

Lifebot propose une API permettant d'envoyer très facilement du courrier postal depuis votre ERP, CRM ou application web.

Pas de frais d'installation. Pas d'engagement. Vous payez ce que vous consommez.

Documentation : https://docs.lifebot.fr/

Bien démarrer : https://www.lifebot.fr/guide/bien-demarrer-avec-l-api-d-envoi-de-courrier

Table of Contents

Getting Started

Here's a general overview of the Lifebot services available, click through to read more.

Please read through the official API Documentation to get a complete sense of what to expect from each endpoint.

Registration

First, you will need to first create an account at Lifebot.fr and obtain your Test and Live API Keys.

Once you have created an account, you can access your API Keys from the Settings Panel.

Installation

lifebot-node can be installed through the npm:

$ npm install lifebot

To build and install from the latest source:

$ git clone git@github.com:Lifebot-api/lifebot-node.git
$ npm install

Usage

Callback

var Lifebot = require('lifebot')('YOUR API KEY');
 
 
// callback pattern
Lifebot.letters.create({
  description: 'Test Letter from the Node.js Wrapper',
  to: {
    name: 'Erlich',
    address_line1: '30 rue de rivoli',
    address_line2: '',
    address_city: 'Paris',
    address_country: 'France',
    address_postalcode: '75004'
  },
  postage_type: 'prioritaire',
  color: 'bw',
  source_file: '<html>Hello, {{nom}}</html>',
  source_file_type: 'html',
  variables: {
    nom : 'Lifebot'
  }
}, function (err, body) {
   if (err) console.log('err : ' , err.message);
   console.log('body : ', body)
})

Promise

 
var Lifebot = require('lifebot')('YOUR API KEY');
 
 
// callback pattern
Lifebot.letters.create({
  description: 'Test Letter from the Node.js Wrapper',
  to: {
    name: 'Erlich',
    address_line1: '30 rue de rivoli',
    address_line2: '',
    address_city: 'Paris',
    address_country: 'France',
    address_postalcode: '75004'
  },
  postage_type: 'prioritaire',
  color: 'bw',
  source_file: '<html>Hello, {{nom}}</html>',
  source_file_type: 'html',
  variables: {
    nom : 'Lifebot'
  }
})
.then(function (response) {
  console.log('response : ', response);
})
.catch(function (err) {
  console.log('err : ', err);
});

Examples

We've provided various examples for you to try out here.

=======================

Copyright © 2017 Lifebot.fr

Released under the MIT License, which can be found in the repository in LICENSE.txt.

Package Sidebar

Install

npm i lifebot

Weekly Downloads

0

Version

1.0.1

License

none

Last publish

Collaborators

  • gautiert