Giter Site home page Giter Site logo

node-vtiger's Introduction

Vtiger API Connection Library for Node.js Applications

Abstract

Node-vtiger, written in CoffeeScript, is a wrapper of Vtiger REST API in Node.js.
I use it for a robot (node) which is doing automated tasks.

Install

  npm install node-vtiger

Test

Show how to use the module.
Create, update, query, and delete a lead.
The test use step module for serial execution.

    npm install step
    test/main.js url username accesskey
    test/main.js http://example.com/vtigercrm admin vHgFdsrFrdRdfR

Usage

VTiger webservice API: https://wiki.vtiger.com/index.php/Webservices_tutorials

    vtws            = require('node-vtiger')
    VT_URL          = 'http://example.com/vtigercrm'
    VT_USER         = 'admin'
    VT_ACCESSKEY    = 'rFtfsdRfTgUggY' # accesskey is in your vtiger user preferences
    LOGGING_LEVEL   = 'debug'   # level of logging (error||warning||info||debug||trace)
                                # The log in the module are at the level trace

    client = new vtws( VT_URL, VT_USER, VT_ACCESSKEY, LOGGING_LEVEL )
    client.doLogin(callback)
    client.doQuery(query, callback)
    client.doDescribe(module, callback)
    client.doRetrieve(id, callback)
    client.doDelete(id, callback)
    client.doUpdate(valueMap, callback)
    client.doCreate(valueMap, callback)
    client.doSync(modifiedTime, module, callback)
    client.doListtypes(callback)

Example with Step, the very useful control-flow node library:

    Step   = require 'step'
    client = new vtws(VT_URL, VT_USER, VT_ACCESSKEY, 'warning')

    Step(
        login = ->
            return client.doLogin this
    ,
        doQuery = (err, result) ->
            query = "SELECT * FROM Leads WHERE lead_no='LEA12345'"
            client.doQuery query, this
    ,
        doWhatYouWant = (err, result) ->
            console.log JSON.stringify result
    )

Acknowledgement

http://forge.vtiger.com/projects/vtwsclib
http://vtiger.com
http://nodejs.org
http://coffeescript.org
https://github.com/mikeal/request
https://github.com/drd0rk/logger
https://github.com/creationix/step

License

Public Domain The software is provided "as is", without warranty of any kind.

node-vtiger's People

Contributors

adrianhunter avatar clipi avatar itag avatar urinprobe avatar

Watchers

 avatar  avatar

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.