Vtiger API Connection Library for Node.js Applications
JavaScript CoffeeScript
Latest commit d66fbfd Sep 15, 2014 @clipi Merge pull request #4 from adrianTundS/master
fixed error not defined bug...
Failed to load latest commit information.
lib Update nodevtiger.js Feb 27, 2014
src
test clean Jul 14, 2012
.gitignore git Jun 30, 2012
Cakefile
README.md Update README.md May 31, 2013
package.json clean Jul 14, 2012

README.md

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.