API stands for Application Programming Interface. Any software with a specific function is referred to as an application when discussing APIs. You can compare the API interface to a service agreement between two programs that specify requests and responses. If you are new to APIs, we recommend you check out our Beginners Guide to APIs and Overview to REST APIs blog before reading this one. REST APIs allow you to access CRM data through HTTP/HTTPS protocol. You can perform actions such as create, update, retrieve or delete operations on any CRM record information. It will also allow you to store extension-specific and user-specific configuration data or connect to external applications using the stored extension-specific data. All this data can be accessed using basic authorization, that is, by the username and access key.
Creating a REST APIFollowing are the five general steps that you can use to build any API:
- Plan the API: The guidelines for designing your API are provided by API specifications like OpenAPI. It is preferable to consider various use cases beforehand and ensure the API complies with current API development standards.
- Build the API: API designers create prototypes of new APIs with little modification to the existing APIs. Developers can adapt the prototype to internal requirements after it has undergone testing.
- Test the API: Similar to software testing, API testing is necessary to guard against errors and flaws. Test the API for strength against online attacks using tools for API testing.
- Document the API: Although APIs are self-explanatory, documentation can help users more easily. In a service-oriented architecture, well-documented APIs with various functions and use cases are more frequently used. Write a help document to give direction and help others build their APIs.
- Market the API: There are online marketplaces where developers can buy and sell APIs to others, just like there are for retail goods on eBay, Amazon, and Flipkart. You can earn money from your API by listing it.
|XML and VDAL Component||Action|
|api method=”get”||Defining HTTP Request method|
|select module=”Accounts”||Define the module to retrieve data from using select|
|record field name=”accountname”>||Define the fields in the record to retrieve data from using record|
|sort field name=”annual_revenue” order=”descending” /field /sort||Define the conditions for the table outcome using sort|
|limit max=”5″ page=”@page” /limit||Define the number of record details to be displayed using limit|
|/select /api||End with closing all the open tags|
- Log in to your Vtiger CRM account.
- Click the Main Menu.
- Click Platform.
- Select API Designer.
- Click +Add API.
- Click Create beside REST API. Add REST API window opens.
- Add REST API: Enter or select information for the following:
- Module: Select the CRM module from which data has to be accessed.
- Name: Enter a unique identifier for the API.
- Status: Click the Checkbox to activate the API.
- Click Save.
- After you add the API, you will see an in-built IDE where you will use VADL to define APIs and XML nodes to retrieve CRM data. Refer to the table above to understand the XML and VADL components.
- Click Save and Publish to publish the built API.