- Create a custom REST API
- Connect to other applications that have REST API available
- Connect to OAuth enabled applications
For Example,https://your_instance.odx.vtiger.com/restapi/v1/vtiger/default If you are aware of the Vtiger Rest API, then you can skip the section below. To know about accessible modules, you can use the listtypes API. Here is a screenshot of how you can access the API using the postman client.
Vtiger already provides a standard set of APIs, but with the new API Designer tool, you can now write your very own custom REST APIs.
We have defined Vtiger Application Definition Language (VADL), which is based on XML syntax to enable novice administrators or developers to define API without programming expertise. VADL allows you to:
- Define CURD
- APIs (Create, Update, Retrieve, Delete) on entity modules
- Invoke HTTP based (REST / SOAP) endpoint through (GET/POST/PUT/DELETE) methods
- With Authentication (Basic / Bearer token-based)
- Accept request parameters and bind as API inputs
Let’s take an example of creating a custom REST API that will search for Contacts matching the email domain. We will add a new API with the name ‘fetch_email_contact’ and select the Contacts module
All the definitions are placed inside an API node with standard HTTP type (get, post, put, and delete). Since we are fetching data from CRM, we will use select nodes and pass module names. We will have fields that need to be fetched inside the records node and any filter conditions inside the where node. We support different types of conditions like equal, not equals, like, greater than, less than, etc.
Above is a simple example, which can also be achieved using the existing query REST API.The real power becomes apparent when you combine multiple APIs into one.
Consider this example. You update a record if it exists or create one if it does not exist. If you use an existing API, it will need multiple calls to perform these operations. But when you use the API Designer, you can combine these operations into a single API call.
Accessing a custom API published through the API Designer
- To access any custom API published through API Designer, you will need to use the below endpoint.
- API_NAME should be replaced with the name given to the API. Also, ensure you are using the appropriate HTTP type and credentials(username and access key) to access it.
- To access a recently created fetch_email_contact API using postman, you should use the below.
To conclude, we saw how the API Designer tool allows you to write custom REST APIs and use them internally and in other applications to consume CRM data seamlessly. For any other queries, please send an email to email@example.com. Sign up for the developer edition here.