Skip to content

Vtiger API Connection Library for Node.js Applications

Notifications You must be signed in to change notification settings

res-io/node-vtiger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Vtiger API Connection Library for Node.js Applications

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 56.0%
  • CoffeeScript 44.0%