vTiger's object documentation - linagora/vtiger-api-js-client GitHub Wiki
Every CRUD operation return a promise with vTiger's anwser or an error.
To manipulate objects via the client first import the class you want, then instantiate it with at least the Mandatory content and finally call the right method with your object as argument. See the detailed exemple with Users below.
###List of all vTiger's object avaible by default through the API: 'Campaigns', 'Vendors', 'Faq', 'PurchaseOrder', 'SalesOrder', 'Invoice', 'PriceBooks', 'Calendar', 'Leads', 'Accounts', 'Contacts', 'Potentials', 'Products', 'Documents', 'Emails', 'HelpDesk', 'Events', 'Users', 'Services', 'ServiceContracts', 'PBXManager', 'ModComments', 'Assets', 'ProjectMilestone', 'ProjectTask', 'Project', 'Groups', 'Currency', 'DocumentFolders', 'CompanyDetails', 'LineItem', 'Tax', 'ProductTaxes'
The retrieve, update and delete operation only require the object ID, other fields are optionnal.
#Users :
class Users{
constructor(data){
this.type = 'Users';
this.Mandatory = {
create : ['user_name', 'user_password', 'confirm_password', 'last_name', 'roleid', 'email1', 'is_owner']
};
this.data = data;
}
//create(){} To override the default Client method, just add your custom one on the object or prototype
}
let Users = require('./lib/vTigerObjects/Users');
let usersObjTest = new Users({
user_name: '', //As usual typing is important
user_password: '',
confirm_password: '',
last_name: '',
roleid: '',
email1: '',
});
client.create(usersObjTest); //Don't forget to specify the object ID if you want to use client.retrieve/update/delete
user_name: '' , //string
user_password: '' , //password
confirm_password: '' , //password
last_name: '' , //string
roleid: '' , //string
email1: '' , //email
is_admin: '' , //boolean
first_name: '' , //string
status: '' , //string
activity_view: '' , //picklist - Today - This Week - This Month - This Year
lead_view: '' , //picklist - Today - Last 2 Days - Last Week
hour_format: '' , //picklist - 12 - 24
end_hour: '' , //string
start_hour: '' , //picklist - 00:00 - 01:00 - 02:00 - 03:00 - 04:00 - 05:00 - 06:00 - 07:00 - 08:00 - 09:00 - 10:00 - 11:00 - 12:00 - 13:00 - 14:00 - 15:00 - 16:00 - 17:00 - 18:00 - 19:00 - 20:00 - 21:00 - 22:00 - 23:00
title: '' , //string
phone_work: '' , //phone
department: '' , //string
phone_mobile: '' , //phone
reports_to_id: '' , //reference
phone_other: '' , //phone
email2: '' , //email
phone_fax: '' , //phone
secondaryemail: '' , //email
phone_home: '' , //phone
date_format: '' , //picklist - dd-mm-yyyy - mm-dd-yyyy - yyyy-mm-dd
signature: '' , //text
description: '' , //text
address_street: '' , //text
address_city: '' , //string
address_state: '' , //string
address_postalcode: '' , //string
address_country: '' , //string
time_zone: '' , //picklist - Pacific/Midway - Pacific/Samoa - Pacific/Honolulu - America/Anchorage - America/Los_Angeles - America/Tijuana - America/Denver - America/Chihuahua - America/Mazatlan - America/Phoenix - America/Regina - America/Tegucigalpa - America/Chicago - America/Mexico_City - America/Monterrey - America/New_York - America/Bogota - America/Lima - America/Rio_Branco - America/Indiana/Indianapolis - America/Caracas - America/Halifax - America/Manaus - America/Santiago - America/La_Paz - America/Cuiaba - America/Asuncion - America/St_Johns - America/Argentina/Buenos_Aires - America/Sao_Paulo - America/Godthab - America/Montevideo - Atlantic/South_Georgia - Atlantic/Azores - Atlantic/Cape_Verde - Europe/London - UTC - Africa/Monrovia - Africa/Casablanca - Europe/Belgrade - Europe/Sarajevo - Europe/Brussels - Africa/Algiers - Europe/Amsterdam - Europe/Minsk - Africa/Cairo - Europe/Helsinki - Europe/Athens - Europe/Istanbul - Asia/Jerusalem - Asia/Amman - Asia/Beirut - Africa/Windhoek - Africa/Harare - Asia/Kuwait - Asia/Baghdad - Africa/Nairobi - Asia/Tehran - Asia/Tbilisi - Europe/Moscow - Asia/Muscat - Asia/Baku - Asia/Yerevan - Asia/Karachi - Asia/Tashkent - Asia/Kolkata - Asia/Colombo - Asia/Katmandu - Asia/Dhaka - Asia/Almaty - Asia/Yekaterinburg - Asia/Rangoon - Asia/Novosibirsk - Asia/Bangkok - Asia/Brunei - Asia/Krasnoyarsk - Asia/Ulaanbaatar - Asia/Kuala_Lumpur - Asia/Taipei - Australia/Perth - Asia/Irkutsk - Asia/Seoul - Asia/Tokyo - Australia/Darwin - Australia/Adelaide - Australia/Canberra - Australia/Brisbane - Australia/Hobart - Asia/Vladivostok - Pacific/Guam - Asia/Yakutsk - Pacific/Fiji - Asia/Kamchatka - Pacific/Auckland - Asia/Magadan - Pacific/Tongatapu - Etc/GMT-11
currency_id: '' , //reference
currency_grouping_pattern: '' , //picklist - 123,456,789 - 123456789 - 123456,789 - 12,34,56,789
currency_decimal_separator: '' , //picklist - . - , - ' - - $
currency_grouping_separator: '' , //picklist - . - , - ' - - $
currency_symbol_placement: '' , //picklist - $1.0 - 1.0$
imagename: '' , //string
internal_mailer: '' , //boolean
theme: '' , //string
language: '' , //string
reminder_interval: '' , //picklist - 1 Minute - 5 Minutes - 15 Minutes - 30 Minutes - 45 Minutes - 1 Hour - 1 Day
phone_crm_extension: '' , //phone
no_of_currency_decimals: '' , //picklist - 2 - 3 - 4 - 5 - 0 - 1
truncate_trailing_zeros: '' , //boolean
dayoftheweek: '' , //picklist - Sunday - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday
callduration: '' , //picklist - 5 - 10 - 30 - 60 - 120
othereventduration: '' , //picklist - 5 - 10 - 30 - 60 - 120
calendarsharedtype: '' , //picklist - public - private - seletedusers
default_record_view: '' , //picklist - Summary - Detail
leftpanelhide: '' , //boolean
rowheight: '' , //picklist - wide - medium - narrow
defaulteventstatus: '' , //picklist - Planned - Held - Not Held
defaultactivitytype: '' , //picklist - Call - Meeting
hidecompletedevents: '' , //boolean
is_owner: '' , //string
#Accounts :
accountname: '', //string
assigned_user_id: '', //owner
phone: '', //phone
website: '', //url
fax: '', //phone
tickersymbol: '', //string
otherphone: '', //phone
account_id: '', //reference
email1: '', //email
employees: '', //integer
email2: '', //email
ownership: '', //string
rating: '', //picklist - Acquired - Active - Market Failed - Project Cancelled - Shutdown
industry: '', //picklist - Apparel - Banking - Biotechnology - Chemicals - Communications - Construction - Consulting - Education - Electronics - Energy - Engineering - Entertainment - Environmental - Finance - Food & Beverage - Government - Healthcare - Hospitality - Insurance - Machinery - Manufacturing - Media - Not For Profit - Recreation - Retail - Shipping - Technology - Telecommunications - Transportation - Utilities - Other
siccode: '', //string
accounttype: '', //picklist - Analyst - Competitor - Customer - Integrator - Investor - Partner - Press - Prospect - Reseller - Other
annual_revenue: '', //currency
emailoptout: '', //boolean
notify_owner: '', //boolean
modifiedby: '', //reference
bill_street: '', //text
ship_street: '', //text
bill_city: '', //string
ship_city: '', //string
bill_state: '', //string
ship_state: '', //string
bill_code: '', //string
ship_code: '', //string
bill_country: '', //string
ship_country: '', //string
bill_pobox: '', //string
ship_pobox: '', //string
description: '', //text
#Contacts :
lastname: '', //string
assigned_user_id: '', //owner
salutationtype: '', //string
firstname: '', //string
phone: '', //phone
mobile: '', //phone
account_id: '', //reference
homephone: '', //phone
leadsource: '', //picklist - Cold Call - Existing Customer - Self Generated - Employee - Partner - Public Relations - Direct Mail - Conference - Trade Show - Web Site - Word of mouth - Other
otherphone: '', //phone
title: '', //string
fax: '', //phone
department: '', //string
birthday: '', //date
email: '', //email
contact_id: '', //reference
assistant: '', //string
secondaryemail: '', //email
assistantphone: '', //phone
donotcall: '', //boolean
emailoptout: '', //boolean
reference: '', //boolean
notify_owner: '', //boolean
modifiedby: '', //reference
portal: '', //boolean
support_start_date: '', //date
support_end_date: '', //date
mailingstreet: '', //text
otherstreet: '', //text
mailingcity: '', //string
othercity: '', //string
mailingstate: '', //string
otherstate: '', //string
mailingzip: '', //string
otherzip: '', //string
mailingcountry: '', //string
othercountry: '', //string
mailingpobox: '', //string
otherpobox: '', //string
imagename: '', //string
description: '', //text
#Calendar :
subject: '', //string
assigned_user_id: '', //owner
date_start: '', //date
due_date: '', //date
taskstatus: '', //picklist - Not Started - In Progress - Completed - Pending Input - Deferred - Planned
time_start: '', //time
time_end: '', //time
parent_id: '', //reference
contact_id: '', //reference
eventstatus: '', //picklist - Planned - Held - Not Held
taskpriority: '', //picklist - High - Medium - Low
sendnotification: '', //boolean
activitytype: '', //picklist - Call - Mobile Call - Meeting
visibility: '', //picklist - Private - Public
description: '', //text
duration_hours: '', //time
duration_minutes: '', //picklist - 00 - 15 - 30 - 45
location: '', //string
reminder_time: '', //integer
recurringtype: '', //picklist - Daily - Weekly - Monthly - Yearly
notime: '', //boolean
modifiedby: '', //reference
#CompanyDetails :
organizationname: '' //string
address: '', //string
city: '', //string
state: '', //string
country: '', //string
code: '', //string
phone: '', //phone
fax: '', //phone
website: '', //url
logoname: '', //file
logo: '', //text
vatid: '', //string