Vtiger - Interface to vtiger5.2 webservices
Version 0.01
Handle the webservice interface to vtiger.
The basic object in that transactions is $session that holds sessionName and userId values. This values will be used to perform request services
use Vtiger;
my $vt = new Vtiger(); my $usermane = 'admin'; my $pin = 'f956n34fc6'; my $session = $vt->getSession($username, $pin); With a 'Session Id' string we can perform querys:
my $contacts = $vt->query( $session->{'sessionName'}, "select * from Contacts;" );
To change vtiger objects we need the userId holded by our session object.
# create a new contact my $ctcData = { 'assigned_user_id'=> $session->{'userId'}, 'lastname' => 'Filipo' };
my $newContact = $vt->create( $session->{'sessionName'}, 'Contacts', $ctcData );
my $retrieved =$vt->retrieve($session->{'sessionName'}, $contactId); =head2 UPDATE
$retrieved->{'lastname'} = "Filapo";
my $deleted =$vt->delete($session->{'sessionName'}, $contactId);
A Vtiger object can be instantiated by the new method.
The module instance has blessed 4 attributes:
Instance of LWP::UserAgent
Instance of JSON
Instance of Digest::MD5
Returns a session object.
A session holds sessionName and userId values.
This values must be used to identify the user in web services requests.
my $sessionName = $session->{'sessionName'}; my $userId = $session->{'userId'};
Returns the vtiger module descripton.
my $description = $vt->describe{$sessionName, $module}; my @fieldNames = @{$description->{'fields'}};
The description consists of the following fields:
Each element in the fields array describes a particular field in the object.
The type field is of particular importance as it describes what type of the field is. This is an map that will contain at the least an element called name which is the name of the type. The name could be one of the following.
Monsenhor, <monsenhor at cpan.org>
Please report any bugs or feature requests to bug-vtiger at rt.cpan.org
, or through
the web interface at http://rt.cpan.org/NoAuth/ReportBug.html. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc Vtiger
You can also look for information at:
Copyright 2011 Monsenhor.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.