{"id":105103,"date":"2017-12-17T16:17:06","date_gmt":"2017-12-17T16:17:06","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=105103"},"modified":"2025-12-15T08:56:44","modified_gmt":"2025-12-15T08:56:44","slug":"use-web-api-call-using-ajax-call-magento-2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/","title":{"rendered":"How to use web API call in Magento 2"},"content":{"rendered":"<p><strong>Magento 2 Web API Call<\/strong>: Today we will learn how to use the Magento 2 webapi as Ajax request in Magento 2 for Fetching, saving and for any operation in your module.<\/p>\n<p><strong>Magento 2 webapi<\/strong> : To know about Magento Web Api please refer to our wonderful blog <a href=\"https:\/\/webkul.com\/blog\/magento2-custom-rest-api\/\">WEB API<\/a>\u00a0.<br \/>You can use the Magento WebApi on any page. But here I am going to Guide you , how to use in Customer registration page.<\/p>\n<p>If you are new to Magento 2 then first please refer to Magento 2&#8217;s basic <a href=\"https:\/\/webkul.com\/blog\/create-hello-module-in-magento2\/\">Directory Structure<\/a>.<\/p>\n<p><strong>1 :<\/strong> I am assuming that you have a basic idea of Magento 2 Structure and Web API now.<br \/>so let start with the create <a href=\"https:\/\/developer.adobe.com\/commerce\/frontend-core\/guide\/layouts\/\">Layout handle<\/a>.<\/p>\n<p>Create handle \u00a0in this location : app\/code\/&lt;namespace&gt;\/&lt;module_name&gt;\/view\/frontend\/layout\/customer_account_create.xml and paste the below code :<\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\"?&gt;\n&lt;!--\n\/**\n * Webkul Software.\n *\n * @category  Webkul\n * @package   Webkul_Ajaxwebapi\n * @author    Webkul\n * @copyright Copyright (c) 2010-2017 Webkul Software Private Limited (https:\/\/webkul.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\n--&gt;\n&lt;page xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" layout=\"1column\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd\"&gt;\n    &lt;body&gt;\n        &lt;referenceBlock name=\"customer_form_register\"&gt;\n        \t&lt;action method=\"setTemplate\"&gt;\n        \t\t&lt;argument name=\"template\" xsi:type=\"string\"&gt;Webkul_Ajaxwebapi::customer\/form\/ajaxcall.phtml&lt;\/argument&gt;\n        \t&lt;\/action&gt;\n          &lt;arguments&gt;\n                &lt;argument name=\"jsLayout\" xsi:type=\"array\"&gt;\n                    &lt;item name=\"components\" xsi:type=\"array\"&gt;\n                        &lt;item name=\"ajaxlist-content\" xsi:type=\"array\"&gt;\n                            &lt;item name=\"component\" xsi:type=\"string\"&gt;Webkul_Ajaxwebapi\/js\/ajaxcall&lt;\/item&gt;\n                            &lt;item name=\"config\" xsi:type=\"array\"&gt;\n                                &lt;item name=\"template\" xsi:type=\"string\"&gt;Webkul_Ajaxwebapi\/ajaxcall&lt;\/item&gt;\n                            &lt;\/item&gt;\n                        &lt;\/item&gt;\n                    &lt;\/item&gt;\n                &lt;\/argument&gt;\n            &lt;\/arguments&gt;\n        &lt;\/referenceBlock&gt;\n    &lt;\/body&gt;\n&lt;\/page&gt;\n<\/pre>\n<p>In above I have used knockout Component you can do this with widgets as well.<\/p>\n<p><strong>2:<\/strong> Now add Script in ajaxcall.phtml<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;script type=\"text\/x-magento-init\"&gt;\n    {\n        \"*\": {\n                \"Magento_Ui\/js\/core\/app\":  &lt;?php \/* @escapeNotVerified *\/ echo $block-&gt;getJsLayout();?&gt;\n            }\n        \n    }\n&lt;\/script&gt;<\/pre>\n<p><strong>3 :<\/strong> Create webapi.xml in this location app\/code\/&lt;namespace&gt;\/&lt;module_name&gt;\/etc\/webapi.xml<\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\"?&gt;\n&lt;!--\n\/**\n * Webkul Software.\n *\n * @category  Webkul\n * @package   Webkul_Ajaxwebapi\n * @author    Webkul\n * @copyright Copyright (c) 2010-2017 Webkul Software Private Limited (https:\/\/webkul.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\n --&gt;\n&lt;routes xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:module:Magento_Webapi:etc\/webapi.xsd\"&gt;\n    &lt;route url=\"\/V1\/ajax\/save\/\" method=\"POST\"&gt;\n        &lt;service class=\"Webkul\\Ajaxwebapi\\Api\\AjaxSaveInterface\" method=\"ajaxSave\"\/&gt;\n        &lt;resources&gt;\n            &lt;resource ref=\"anonymous\"\/&gt;\n        &lt;\/resources&gt;\n    &lt;\/route&gt;\n&lt;\/routes&gt;\n<\/pre>\n<p><strong>4 :<\/strong> Create service contract in this location app\/code\/&lt;namespace&gt;\/&lt;module_name&gt;\/Api\/XyzInterface.php<\/p>\n<pre class=\"brush:php\">&lt;?php\n\/**\n * Webkul Software.\n *\n * @category  Webkul\n * @package   Webkul_Ajaxwebapi\n * @author    Webkul\n * @copyright Copyright (c) 2010-2017 Webkul Software Private Limited (https:\/\/webkul.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\nnamespace Webkul\\Ajaxwebapi\\Api;\n\ninterface AjaxSaveInterface\n{\n    \/**\n     * Returns string\n     *\n     * @api\n     * @param string $ajaxval\n     * @return string\n     *\/\n    public function ajaxSave($ajaxval);\n\n}\n<\/pre>\n<p><strong>5 :<\/strong> create file for dependencies in this location : app\/code\/&lt;namespace&gt;\/&lt;module_name&gt;\/etc\/di.xml<\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\"?&gt;\n&lt;!--\n\/**\n * Webkul Software.\n *\n * @category  Webkul\n * @package   Webkul_Ajaxwebapi\n * @author    Webkul\n * @copyright Copyright (c) 2010-2017 Webkul Software Private Limited (https:\/\/webkul.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\n--&gt;\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:ObjectManager\/etc\/config.xsd\"&gt;\n    &lt;preference for=\"Webkul\\Ajaxwebapi\\Api\\AjaxSaveInterface\" type=\"Webkul\\Ajaxwebapi\\Model\\Ajax\\AjaxSaveManagement\" \/&gt;\n&lt;\/config&gt;\n<\/pre>\n<p><strong>6 :<\/strong> \u00a0Create a Model and Implement the Interface defined (I hope you are aware of it else check <a href=\"https:\/\/webkul.com\/blog\/create-repositories-magento2\/\">Repositories<\/a> ).<\/p>\n<pre class=\"brush:php\">&lt;?php\n\/**\n * Webkul Software.\n *\n * @category  Webkul\n * @package   Webkul_Ajaxwebapi\n * @author    Webkul\n * @copyright Copyright (c) 2010-2017 Webkul Software Private Limited (https:\/\/webkul.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\nnamespace Webkul\\Ajaxwebapi\\Model\\Ajax;\n\nuse Webkul\\Ajaxwebapi\\Api\\AjaxSaveInterface;\n\nclass AjaxSaveManagement implements AjaxSaveInterface\n{\n   \n\n   \/**\n    * Returns string\n    *\n    * @api\n    * @param string $ajaxval\n    * @return string\n    *\/\n    public function ajaxSave($ajaxval)\n    {\n        try{\n          return \"Saved\";\n        }catch(\\Exception $e){\n\n        }\n\n    }\n\n}\n<\/pre>\n<h3><strong>Step 7\u00a0<\/strong><\/h3>\n<p><strong>Api call<\/strong> : In Magento two we have a javascript module named as\u00a0<a href=\"https:\/\/webkul.com\/blog\/update-ui-dinamically-knockout-js\/\">mage\/storage<\/a> , this class or module is used for ajax calling, here is the sample code to \u00a0use it .<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\">\/**\n * Webkul Software.\n *\n * @category  Webkul\n * @package   Webkul_Ajaxwebapi\n * @author    Webkul\n * @copyright Copyright (c) 2010-2017 Webkul Software Private Limited (https:\/\/webkul.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\ndefine([\n    'jquery',\n    'mage\/translate',\n    'mage\/storage'\n    'uiComponent',\n    'ko',\n   'Magento_Ui\/js\/modal\/alert'\n   ], function (\n        $,\n        $t,\n        storage,\n        Component,\n        ko,\n        alert\n    ) {\n    'use strict';\n     return Component.extend({\n        initialize: function () {\n           \/\/#ajaxcall button id selector\n          $('#ajaxcall').on('click',function(){\n            if($('#ajaxcallvalue').val()){\n                var serviceUrl,payload;\n\n                 \/**\n                  * Save  values .\n                  *\/\n                 serviceUrl        = 'rest\/V1\/ajax\/save';\n                 payload           = {\n                     ajaxval: $('#ajaxcallvalue').val()\n                 };\n                 storage.post(\n                     serviceUrl,\n                     JSON.stringify(payload)\n                 ).done(function (response) {\n                   alert({\n                       content: $t('Action Successfully completed.')\n                   });\n                 }).fail(function (response) {\n                    alert({\n                        content: $t('There was error during saving data')\n                    });\n                });\n              }\n          });\n        }\n      })\n    });\n<\/pre>\n<p>The above is the complete sample.\u00a0 by which you can use the Magento knockout storage module for any operation of Ajax.<\/p>\n<p><strong>Note<\/strong>: Run the above JS code on any event. I have used a button and a text box for a sample.<br \/>Please read the links as well that I have added in between the blog If not checked yet.<\/p>\n<p>That was much about the Magento 2 Web API Call.<\/p>\n<p>You can also check our complete\u00a0<a href=\"https:\/\/store.webkul.com\/Magento-2.html\" target=\"_blank\" rel=\"noreferrer noopener\" data-wpel-link=\"internal\">Magento 2 extensions<\/a>.<\/p>\n<p>Hope this will help and if you have any queries then feel free to ask below in the comment section.<\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento 2 Web API Call: Today we will learn how to use the Magento 2 webapi as Ajax request in Magento 2 for Fetching, saving and for any operation in your module. Magento 2 webapi : To know about Magento Web Api please refer to our wonderful blog WEB API\u00a0.You can use the Magento WebApi <a href=\"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":170,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302],"tags":[715,5910],"class_list":["post-105103","post","type-post","status-publish","format-standard","hentry","category-magento2","tag-ajax-call","tag-mage-storage"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Using Web API Call In Magento 2<\/title>\n<meta name=\"description\" content=\"Magento 2 Web API Call: Magento 2 webapi as Ajax request in Magento 2 for Fetching, saving and for any operation in your module.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using Web API Call In Magento 2\" \/>\n<meta property=\"og:description\" content=\"Magento 2 Web API Call: Magento 2 webapi as Ajax request in Magento 2 for Fetching, saving and for any operation in your module.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-17T16:17:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-15T08:56:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Prabhat Rawat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prabhat Rawat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/\"},\"author\":{\"name\":\"Prabhat Rawat\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/3d52d6c1ad8a809d2f7548e6a9c3358f\"},\"headline\":\"How to use web API call in Magento 2\",\"datePublished\":\"2017-12-17T16:17:06+00:00\",\"dateModified\":\"2025-12-15T08:56:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/\"},\"wordCount\":366,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"keywords\":[\"Ajax call\",\"mage\/storage\"],\"articleSection\":[\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/\",\"url\":\"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/\",\"name\":\"Using Web API Call In Magento 2\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2017-12-17T16:17:06+00:00\",\"dateModified\":\"2025-12-15T08:56:44+00:00\",\"description\":\"Magento 2 Web API Call: Magento 2 webapi as Ajax request in Magento 2 for Fetching, saving and for any operation in your module.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use web API call in Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/3d52d6c1ad8a809d2f7548e6a9c3358f\",\"name\":\"Prabhat Rawat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/616ec5deaf63b72b3003cf99e608ae354f4d373cee8d25b2d0bfa65cab270ad8?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/616ec5deaf63b72b3003cf99e608ae354f4d373cee8d25b2d0bfa65cab270ad8?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Prabhat Rawat\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/prabhat-rawat763\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using Web API Call In Magento 2","description":"Magento 2 Web API Call: Magento 2 webapi as Ajax request in Magento 2 for Fetching, saving and for any operation in your module.","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:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/","og_locale":"en_US","og_type":"article","og_title":"Using Web API Call In Magento 2","og_description":"Magento 2 Web API Call: Magento 2 webapi as Ajax request in Magento 2 for Fetching, saving and for any operation in your module.","og_url":"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2017-12-17T16:17:06+00:00","article_modified_time":"2025-12-15T08:56:44+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Prabhat Rawat","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Prabhat Rawat","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/"},"author":{"name":"Prabhat Rawat","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/3d52d6c1ad8a809d2f7548e6a9c3358f"},"headline":"How to use web API call in Magento 2","datePublished":"2017-12-17T16:17:06+00:00","dateModified":"2025-12-15T08:56:44+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/"},"wordCount":366,"commentCount":2,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"keywords":["Ajax call","mage\/storage"],"articleSection":["Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/","url":"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/","name":"Using Web API Call In Magento 2","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2017-12-17T16:17:06+00:00","dateModified":"2025-12-15T08:56:44+00:00","description":"Magento 2 Web API Call: Magento 2 webapi as Ajax request in Magento 2 for Fetching, saving and for any operation in your module.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/use-web-api-call-using-ajax-call-magento-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to use web API call in Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/3d52d6c1ad8a809d2f7548e6a9c3358f","name":"Prabhat Rawat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/616ec5deaf63b72b3003cf99e608ae354f4d373cee8d25b2d0bfa65cab270ad8?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/616ec5deaf63b72b3003cf99e608ae354f4d373cee8d25b2d0bfa65cab270ad8?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Prabhat Rawat"},"url":"https:\/\/webkul.com\/blog\/author\/prabhat-rawat763\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/105103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/170"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=105103"}],"version-history":[{"count":11,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/105103\/revisions"}],"predecessor-version":[{"id":517111,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/105103\/revisions\/517111"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=105103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=105103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=105103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}