
{"id":11860,"date":"2021-08-06T07:22:35","date_gmt":"2021-08-06T14:22:35","guid":{"rendered":"https:\/\/www.vtiger.com\/blog\/?p=11860"},"modified":"2021-08-06T07:22:35","modified_gmt":"2021-08-06T14:22:35","slug":"getting-started-with-vtap-with-api-designer-part-2","status":"publish","type":"post","link":"https:\/\/www.vtiger.com\/blog\/getting-started-with-vtap-with-api-designer-part-2\/","title":{"rendered":"Getting Started with VTAP API Designer &#8211; Part 2"},"content":{"rendered":"<p>Previously, in our Vtiger Application Platform (VTAP) blog series, we discussed how to customize the Vtiger interface and bring in custom buttons and widgets to cater to specific business needs. This is just one capability that the platform offers.<\/p>\n<p>VTAP empowers you with many such features that help you:<\/p>\n<ul>\n<li>Create a custom REST API<\/li>\n<li>Connect to other applications that have REST API available<\/li>\n<li>Connect to OAuth enabled applications<\/li>\n<\/ul>\n<p>In this blog, I will discuss how we can create a custom REST API.<br \/>\nFirst, let me talk a little bit about Vtiger REST APIs. It can be accessed with the below endpoint, which will be specific to your CRM instance.<br \/>\n<br \/>\nFor Example,<i>https:\/\/your_instance.odx.vtiger.com\/restapi\/v1\/vtiger\/default<\/i><\/p>\n<p>If you are aware of the Vtiger <a href=\"https:\/\/help.vtiger.com\/article\/147111249-Rest-API-Manual\">Rest API<\/a>, then you can skip the section below. To know about accessible modules, you can use the <a href=\"https:\/\/help.vtiger.com\/article\/147111249-Rest-API-Manual#articleHeader11\">listtypes<\/a> API.<\/p>\n<p>Here is a screenshot of how you can access the API using the postman client.<\/p>\n<p style=\"padding-left: 30px;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12338\" src=\"https:\/\/voeyenew.vtiger.com\/s\/wp-content\/uploads\/2021\/08\/Screenshot-at-19-25-37-1.png\" alt=\"listtypes API\" width=\"775\" height=\"707\" srcset=\"https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2021\/08\/Screenshot-at-19-25-37-1.png 775w, https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2021\/08\/Screenshot-at-19-25-37-1-300x274.png 300w, https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2021\/08\/Screenshot-at-19-25-37-1-768x701.png 768w\" sizes=\"auto, (max-width: 775px) 100vw, 775px\" \/><\/p>\n<p>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.<\/p>\n<p><b>API Designer<\/b><br \/>\n<br \/>\nThe API Designer provides a workbench for developers to develop HTTP-based APIs that can be exposed to the VTAP Javascript APIs or the external application for easy integration. APIs can be defined using <a href=\"https:\/\/extend.vtiger.com\/vtap\/documentation\/wikis\/API-Designer#vadl-specification\">VADL<\/a> specifications.<br \/>\nAPI access needs user authorization and follows standard record access configuration made within the CRM.<br \/>\nThe API Designer provides IDE to write custom APIs. If you write a custom REST API for a particular module, you need to name the API and select the module.<br \/>\n<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12339\" src=\"https:\/\/voeyenew.vtiger.com\/s\/wp-content\/uploads\/2021\/08\/Sub-image-2-2-1.png\" alt=\"Sub-image-2\" width=\"530\" height=\"260\" srcset=\"https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2021\/08\/Sub-image-2-2-1.png 530w, https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2021\/08\/Sub-image-2-2-1-300x147.png 300w\" sizes=\"auto, (max-width: 530px) 100vw, 530px\" \/><br \/>\n<br \/>\nWe 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.<\/p>\n<p><a href=\"https:\/\/extend.vtiger.com\/vtap\/documentation\/wikis\/API-Designer#vadl-specification\">VADL<\/a> allows you to:<\/p>\n<ul>\n<li>Define CURD\n<ul>\n<li>APIs (Create, Update, Retrieve, Delete) on entity modules<\/li>\n<li>Invoke HTTP based (REST \/ SOAP) endpoint through (GET\/POST\/PUT\/DELETE) methods\n<ul>\n<li>With Authentication (Basic \/ Bearer token-based)<\/li>\n<\/ul>\n<\/li>\n<li>Accept request parameters and bind as API inputs<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\nLet&#8217;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 \u2018fetch_email_contact\u2019 and select the Contacts module<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12340\" src=\"https:\/\/voeyenew.vtiger.com\/s\/wp-content\/uploads\/2021\/08\/Code-sub-image-1-1-1.png\" alt=\"Code-sub-image-1\" width=\"700\" height=\"285\" srcset=\"https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2021\/08\/Code-sub-image-1-1-1.png 700w, https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2021\/08\/Code-sub-image-1-1-1-300x122.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>All the definitions are placed inside an <b><i>API<\/i><\/b> node with standard HTTP type (get, post, put, and delete). Since we are fetching data from CRM, we will use <b><i>select nodes<\/i><\/b> and pass module names. We will have fields that need to be fetched inside the <b><i>records node<\/i><\/b> and any filter conditions inside the <b><i>where<\/i><\/b> node. We support different types of <a href=\"https:\/\/extend.vtiger.com\/vtap\/documentation\/wikis\/API-Designer#conditions\">conditions<\/a> like equal, not equals, like, greater than, less than, etc.<br \/>\n<br \/>\nAbove is a simple example, which can also be achieved using the existing <a href=\"https:\/\/help.vtiger.com\/article\/147111249-Rest-API-Manual#articleHeader19\">query<\/a> REST API.The real power becomes apparent when you combine multiple APIs into one.<br \/>\n<br \/>\nConsider 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.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12341\" src=\"https:\/\/voeyenew.vtiger.com\/s\/wp-content\/uploads\/2021\/08\/Code-sub-image-2-1-1.png\" alt=\"Code-sub-image-2\" width=\"700\" height=\"990\" srcset=\"https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2021\/08\/Code-sub-image-2-1-1.png 700w, https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2021\/08\/Code-sub-image-2-1-1-212x300.png 212w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>In the above example, we are placing the definition inside the <b><i>upsert<\/i><\/b> node. This comprises the <b><i>update<\/i><\/b> and <b><i>create<\/i><\/b> node, which will update a record if it exists or create a record if it does not exist. To identify the record that needs to be updated, you can use the where to filter and find relevant entries. At the end of the definition, the return node will send back defined fields to the client.<br \/>\nYou can save and publish these APIs to make them available for external applications as well as internal VTAP Javascript.<\/p>\n<p><b>Accessing a custom API published through the API Designer<\/b><\/p>\n<ul>\n<li>To access any custom API published through API Designer, you will need to use the below endpoint.<\/li>\n<li>https:\/\/your_instance.odx.vtiger.com\/restapi\/vtap\/api\/<b>API_NAME<\/b>?PARAMETERS<\/li>\n<li>API_NAME should be replaced with the name given to the API. Also, ensure you are using the appropriate HTTP type and <a href=\"https:\/\/help.vtiger.com\/article\/147111249-Rest-API-Manual#articleHeader5\">credentials<\/a>(username and access key) to access it.<\/li>\n<\/ul>\n<p><b>Accessing a recently created <i>fetch_email_contact<\/i> API using postman<\/b><\/p>\n<ul>\n<li>To access a recently created <b><i>fetch_email_contact<\/i><\/b> API using postman, you should use the below.<\/li>\n<li>https:\/\/your_instance.odx.vtiger.com\/restapi\/vtap\/api\/fetch_email_contact?domain=%vtiger.com%<\/li>\n<\/ul>\n<p><strong>Note<\/strong> :\u00a0https:\/\/your_instance.odx.vtiger.com\/restapi\/v1\/ApiDesigner\/api\/fetch_email_contact?domain=%vtiger.com% is deprecated.<br \/>\n<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12342\" src=\"https:\/\/voeyenew.vtiger.com\/s\/wp-content\/uploads\/2021\/08\/Sub-image-3-1-1-1.png\" alt=\"Sub-image-3 (1)\" width=\"820\" height=\"790\" srcset=\"https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2021\/08\/Sub-image-3-1-1-1.png 820w, https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2021\/08\/Sub-image-3-1-1-1-300x289.png 300w, https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2021\/08\/Sub-image-3-1-1-1-768x740.png 768w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/p>\n<p>These APIs can be accessed internally in Module Designer using VTAP Javascript API <a href=\"https:\/\/extend.vtiger.com\/vtap\/documentation\/wikis\/VTAP-Javascript-APIs#vtapcustomapiget\">VTAP.CustomApi.Get<\/a> to display inside a widget or custom pages in the Vtiger user interface.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12343\" src=\"https:\/\/voeyenew.vtiger.com\/s\/wp-content\/uploads\/2021\/08\/Code-sub-image-3-1.png\" alt=\"Code-sub-image-3\" width=\"700\" height=\"240\" srcset=\"https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2021\/08\/Code-sub-image-3-1.png 700w, https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2021\/08\/Code-sub-image-3-1-300x103.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><br \/>\n<\/br><br \/>\nTo 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.<br \/>\nFor any other queries, please send an email to platform@vtiger.com. Sign up for the developer edition <a href=\"https:\/\/www.vtiger.com\/vtap\/\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Previously, in our Vtiger Application Platform (VTAP) blog series, we discussed how to customize the Vtiger interface and bring in custom buttons and widgets to cater to specific business needs. This is just one capability that the platform offers. VTAP empowers you with many such features that help you: Create a custom REST API Connect&hellip;&nbsp;<a href=\"https:\/\/www.vtiger.com\/blog\/getting-started-with-vtap-with-api-designer-part-2\/\" class=\"\" rel=\"bookmark\">.<span class=\"screen-reader-text\">Getting Started with VTAP API Designer &#8211; Part 2<\/span><\/a><\/p>\n","protected":false},"author":45,"featured_media":11883,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","neve_meta_reading_time":"","_themeisle_gutenberg_block_has_review":false,"_ti_tpc_template_sync":false,"_ti_tpc_template_id":"","footnotes":""},"categories":[3,32],"tags":[],"class_list":["post-11860","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-all","category-vtap"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Getting Started with VTAP API Designer - Part 2 - Vtiger CRM Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vtiger.com\/blog\/getting-started-with-vtap-with-api-designer-part-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting Started with VTAP API Designer - Part 2 - Vtiger CRM Blog\" \/>\n<meta property=\"og:description\" content=\"Previously, in our Vtiger Application Platform (VTAP) blog series, we discussed how to customize the Vtiger interface and bring in custom buttons and widgets to cater to specific business needs. This is just one capability that the platform offers. VTAP empowers you with many such features that help you: Create a custom REST API Connect&hellip;&nbsp;.Getting Started with VTAP API Designer &#8211; Part 2\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vtiger.com\/blog\/getting-started-with-vtap-with-api-designer-part-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Vtiger CRM Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vtiger\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2021\/08\/VTAP-blog-feature-image-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"3334\" \/>\n\t<meta property=\"og:image:height\" content=\"1250\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Vikas Jain\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vtigercrm\" \/>\n<meta name=\"twitter:site\" content=\"@vtigercrm\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vikas Jain\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Getting Started with VTAP API Designer - Part 2 - Vtiger CRM Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vtiger.com\/blog\/getting-started-with-vtap-with-api-designer-part-2\/","og_locale":"en_US","og_type":"article","og_title":"Getting Started with VTAP API Designer - Part 2 - Vtiger CRM Blog","og_description":"Previously, in our Vtiger Application Platform (VTAP) blog series, we discussed how to customize the Vtiger interface and bring in custom buttons and widgets to cater to specific business needs. This is just one capability that the platform offers. VTAP empowers you with many such features that help you: Create a custom REST API Connect&hellip;&nbsp;.Getting Started with VTAP API Designer &#8211; Part 2","og_url":"https:\/\/www.vtiger.com\/blog\/getting-started-with-vtap-with-api-designer-part-2\/","og_site_name":"Vtiger CRM Blog","article_publisher":"https:\/\/www.facebook.com\/vtiger","og_image":[{"width":3334,"height":1250,"url":"https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2021\/08\/VTAP-blog-feature-image-1.png","type":"image\/png"}],"author":"Vikas Jain","twitter_card":"summary_large_image","twitter_creator":"@vtigercrm","twitter_site":"@vtigercrm","twitter_misc":{"Written by":"Vikas Jain","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.vtiger.com\/blog\/getting-started-with-vtap-with-api-designer-part-2\/#article","isPartOf":{"@id":"https:\/\/www.vtiger.com\/blog\/getting-started-with-vtap-with-api-designer-part-2\/"},"author":{"name":"Vikas Jain","@id":"https:\/\/www.vtiger.com\/blog\/#\/schema\/person\/a3b53a76105d26e3f2a7b1f9443bc10e"},"headline":"Getting Started with VTAP API Designer &#8211; Part 2","dateModified":"2021-08-06T14:22:35+00:00","mainEntityOfPage":{"@id":"https:\/\/www.vtiger.com\/blog\/getting-started-with-vtap-with-api-designer-part-2\/"},"wordCount":828,"commentCount":0,"publisher":{"@id":"https:\/\/www.vtiger.com\/blog\/#organization"},"articleSection":["All","VTAP"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.vtiger.com\/blog\/getting-started-with-vtap-with-api-designer-part-2\/","url":"https:\/\/www.vtiger.com\/blog\/getting-started-with-vtap-with-api-designer-part-2\/","name":"Getting Started with VTAP API Designer - Part 2 - Vtiger CRM Blog","isPartOf":{"@id":"https:\/\/www.vtiger.com\/blog\/#website"},"dateModified":"2021-08-06T14:22:35+00:00","breadcrumb":{"@id":"https:\/\/www.vtiger.com\/blog\/getting-started-with-vtap-with-api-designer-part-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vtiger.com\/blog\/getting-started-with-vtap-with-api-designer-part-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vtiger.com\/blog\/getting-started-with-vtap-with-api-designer-part-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vtiger.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Getting Started with VTAP API Designer &#8211; Part 2"}]},{"@type":"WebSite","@id":"https:\/\/www.vtiger.com\/blog\/#website","url":"https:\/\/www.vtiger.com\/blog\/","name":"Vtiger CRM Blog","description":"Latest CRM Topics, Tips, Insights and Updates","publisher":{"@id":"https:\/\/www.vtiger.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vtiger.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vtiger.com\/blog\/#organization","name":"Vtiger","url":"https:\/\/www.vtiger.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vtiger.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2023\/02\/vtiger-logo-only.png","contentUrl":"https:\/\/www.vtiger.com\/blog\/wp-content\/uploads\/2023\/02\/vtiger-logo-only.png","width":490,"height":399,"caption":"Vtiger"},"image":{"@id":"https:\/\/www.vtiger.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vtiger","https:\/\/twitter.com\/vtigercrm"]},{"@type":"Person","@id":"https:\/\/www.vtiger.com\/blog\/#\/schema\/person\/a3b53a76105d26e3f2a7b1f9443bc10e","name":"Vikas Jain","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vtiger.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/20400ac943c1331501f3d9b23119e9b9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/20400ac943c1331501f3d9b23119e9b9?s=96&d=mm&r=g","caption":"Vikas Jain"},"url":"https:\/\/www.vtiger.com\/blog\/author\/vikas\/"}]}},"_links":{"self":[{"href":"https:\/\/www.vtiger.com\/blog\/wp-json\/wp\/v2\/posts\/11860","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vtiger.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vtiger.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vtiger.com\/blog\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vtiger.com\/blog\/wp-json\/wp\/v2\/comments?post=11860"}],"version-history":[{"count":0,"href":"https:\/\/www.vtiger.com\/blog\/wp-json\/wp\/v2\/posts\/11860\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vtiger.com\/blog\/wp-json\/wp\/v2\/media\/11883"}],"wp:attachment":[{"href":"https:\/\/www.vtiger.com\/blog\/wp-json\/wp\/v2\/media?parent=11860"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vtiger.com\/blog\/wp-json\/wp\/v2\/categories?post=11860"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vtiger.com\/blog\/wp-json\/wp\/v2\/tags?post=11860"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}