Articles in this section
Helper Methods for Server Scripts and Jobs - Vtiger REST API
Table of Contents
Vtiger REST API Methods
Vtiger Cloud offers REST-friendly API for integration with 3rd-party-applications. To learn more about Vtiger's REST API refer to this document. These helper methods (vtap.macro.ws) enable sending REST API requests to your CRM instance from where code is invoked.
- Vtiger’s REST API methods are available for CRM operations like create, update, delete, etc.
- No need to pass authentication details. Methods handle it internally.
- Parameters required vary depending on the method called.
- The parameters expected are similar to REST APIs.
- All methods are asynchronous and return a promise, therefore it must be used with await.
Syntax
To make REST API calls to your CRM instance, use vtap.macro.ws library. For example, to call describe API, use vtap.macro.ws.describe.
ExampleNotes:
|
Available Methods
Describe - vtap.macro.ws.describe
Method to get the module’s description. This expects a single parameter elementType which is the module name for which description is requested.
List Types - vtap.macro.ws.listtypes
Method to get a list of modules by field types. This method expects a single parameter fieldTypeList. If you want to get the list of modules having email or phone-type fields, then pass field types as an array. If you want to get the list of modules by single field type, you can pass the field type as array or string. If you want to get all modules list, you can skip passing this parameter value or pass it as NULL.
Retrieve - vtap.macro.ws.retrieve
Method to fetch a CRM record data. This method expects a single parameter ID which is the record ID in web service format.
Create - vtap.macro.ws.create
Method to create a record in CRM. This method expects 2 parameters. elementType is the name of the module for which the record needs to be created and element is the record data object.
Update - vtap.macro.ws.update
Method to update a record in CRM. This method expects a single parameter element which is a JSON object containing all field values of the record including the record's ID.
Revise - vtap.macro.ws.revise
Method to revise a CRM record data. This method expects a single parameter element which is a JSON object containing the record's ID and field values which need to be updated.
Delete - vtap.macro.ws.delete
Method to delete a record in CRM. This method expects a single parameter ID which is the ID of the record to be deleted.
Query - vtap.macro.ws.query
Method to fetch CRM records using a query string. This method expects a single parameter query i.e. query string.
Other REST API methods - vtap.macro.ws.api
Method to invoke other REST APIs which are not listed above. Vtiger’s REST API supports multiple APIs (reference). If you want to use any other API for which the method is not listed above, you can use this.
- requestMethod - API request type (GET or POST).
- API - REST API name (retrieve_related, query_related, add_related, reopen, converlead, etc)
- Parameters - Object containing API request parameters
Constraints
|