0.0
No commit activity in last 3 years
No release in over 3 years
Vtiger API Library for Ruby applications
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.9
~> 3.9

Runtime

~> 1.0.1
~> 2.3
 Project Readme

VtigerRuby

VtigerRuby is a Ruby SDK for the Vtiger CRM API.

Official documentation of the Vtiger API can be found here:

  1. Vtiger REST API Docs
  2. Vtiger Third Party Integrations

Installation

You can install this gem to your gemset.

gem install 'vtiger-ruby'

Or add it to your gemfile and run bundle install.

gem 'vtiger-ruby'

Getting Started

Creating a Client

require 'vtiger-ruby'
endpoint = ENV['VTIGER_ENDPOINT']
username = ENV['VTIGER_USERNAME']
accesskey = ENV['VTIGER_ACCESSS_KEY']
client = VtigerRuby::Client.new(
  endpoint: endpoint,
  username: username,
  accesskey: accesskey
)

Authentication

Vtiger API Authentication happens in two steps:

  1. Request the challenge token
client.get_challenge
  1. Login request
client.login

Alternatively, you can authenticate the client using the connect method. This single method call negates the need to complete step 1 & step 2 listed above.

client.connect

To end the session on Vtiger and disconnect the client

client.logout

Models

The SDK arranges default Vtiger CRM Modules into model classes. The model class can then be used to perform operations against the corresponding Vtiger module.

Account

client.account.all # Retrieves all Vtiger Account module records

You can also retrieve all Vtiger Account module records from the VtigerRuby::Account model.

VtigerRuby::Account.class_config(client) # Configures the class with client model
VtigerRuby::Account.all # Retrieves all Vtiger Account module records

Example

require 'vtiger-ruby'

# Credential information specific to vtiger instance
endpoint = ENV['VTIGER_ENDPOINT']
username = ENV['VTIGER_USERNAME']
accesskey = ENV['VTIGER_ACCESSS_KEY']

# Initializes the VtigerRuby client
client = VtigerRuby::Client.new(
  endpoint: endpoint,
  username: username,
  accesskey: accesskey
)

# Requests Vtiger challenge token and login
client.connect

# Retrieves all account records from the Account module
accounts = client.account.all

Code Status

Maintainability Build Status