I am new here. I want to know how can I create my own simple APIOauth Error while extending Magento Rest APIwhich magento API using for create a new accountREST API create simple productMagento 2.2 Creating Configurable Product With APIHow to create new order with a Rest ApiHow to create API Endpoint in Magento2?“Unable to save Stock Item issue” when I try to create multi-able simple products via RESTful APIhow we can place order with REST API Magento 2?how can I get an image to be used in mobile app by rest apiHow to get Sku, name, and image in magento2 in phtml file
What do you call a flexible diving platform?
Does academia have a lazy work culture?
What is this spacecraft tethered to another spacecraft in LEO (vintage)
Old French song lyrics with the word "baiser."
Catan Victory points
Do the books ever say oliphaunts aren’t elephants?
How to store my pliers and wire cutters on my desk?
Converting 8V AC to 8V DC - bridge rectifier gets very hot while idling
What is the most efficient way to write 'for' loops in Matlab?
Melee or Ranged attacks by Monsters, no distinction in modifiers?
How to judge a Ph.D. applicant that arrives "out of thin air"
Why does Canada require mandatory bilingualism in all government posts?
Could the rotation of a black hole cause other planets to rotate?
Can a table be formatted so that math mode is in some columns and text is in others by default?
Symplectisation as a functor between appropriate categories
Why isn't there a serious attempt at creating a third mass-appeal party in the US?
How much were the LMs maneuvered to their landing points?
How do I stop my characters falling in love?
How do I explain an exponentially complex intuitively?
How did the SysRq key get onto modern keyboards if it's rarely used?
Polyhedra, Polyhedron, Polytopes and Polygon
Am I allowed to use personal conversation as a source?
Is there a list of words that will enable the second player in two-player Ghost to always win?
Correlation length anisotropy in the 2D Ising model
I am new here. I want to know how can I create my own simple API
Oauth Error while extending Magento Rest APIwhich magento API using for create a new accountREST API create simple productMagento 2.2 Creating Configurable Product With APIHow to create new order with a Rest ApiHow to create API Endpoint in Magento2?“Unable to save Stock Item issue” when I try to create multi-able simple products via RESTful APIhow we can place order with REST API Magento 2?how can I get an image to be used in mobile app by rest apiHow to get Sku, name, and image in magento2 in phtml file
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am new here. I want to know how can I create my own simple API to fetch product image,name,is it available in stock and price of the product. Please help me with complete procedure.
magento2 api
add a comment |
I am new here. I want to know how can I create my own simple API to fetch product image,name,is it available in stock and price of the product. Please help me with complete procedure.
magento2 api
following link will be helpful for you lorenzosfarra.com/2017/06/20/…
– MSA
Jul 18 at 7:29
add a comment |
I am new here. I want to know how can I create my own simple API to fetch product image,name,is it available in stock and price of the product. Please help me with complete procedure.
magento2 api
I am new here. I want to know how can I create my own simple API to fetch product image,name,is it available in stock and price of the product. Please help me with complete procedure.
magento2 api
magento2 api
edited Jul 18 at 10:01
Mohit Rane
1,00518 bronze badges
1,00518 bronze badges
asked Jul 18 at 7:24
ritik somritik som
112 bronze badges
112 bronze badges
following link will be helpful for you lorenzosfarra.com/2017/06/20/…
– MSA
Jul 18 at 7:29
add a comment |
following link will be helpful for you lorenzosfarra.com/2017/06/20/…
– MSA
Jul 18 at 7:29
following link will be helpful for you lorenzosfarra.com/2017/06/20/…
– MSA
Jul 18 at 7:29
following link will be helpful for you lorenzosfarra.com/2017/06/20/…
– MSA
Jul 18 at 7:29
add a comment |
1 Answer
1
active
oldest
votes
Please follow the steps to create your own simple API.
- First, create a basic module.
Add
webapi.xml
file to define the API URL, service class and methods.app/code/Milandev/SimpleAPI/etc/webapi.xml
.<?xml version="1.0" ?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
<route method="GET" url="/V1/milandev-simpleapi/product/:sku">
<service class="MilanDevSimpleAPIApiProductManagementInterface" method="getProduct"/>
<resources>
<resource ref="anonymous"/>
</resources>
</route>
</routes>Add API class.
app/code/Milandev/SimpleAPI/Model/ProductManagement.php
.<?php
namespace MilanDevSimpleAPIModel;
class ProductManagement implements MilanDevSimpleAPIApiProductManagementInterface
/**
* @inheritdoc
*/
public function getProduct($sku)
// add your logic
return $sku;
Add API interface.
app/code/Milandev/SimpleAPI/Api/ProductManagementInterface.php
.<?php
namespace MilanDevSimpleAPIApi;
interface ProductManagementInterface
/**
* GET for product api
* @param string $sku
* @return string
*/
public function getProduct($sku);Add dependency class in the
di.xml
.app/code/Milandev/SimpleAPI/etc/di.xml
.<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MilanDevSimpleAPIApiProductManagementInterface" type="MilanDevSimpleAPIModelProductManagement"/>
</config>- Test the API using rest-client by following the URL structure.
http://exmaple.com/index.php/rest/V1/milandev-simpleapi/product/sku
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f282480%2fi-am-new-here-i-want-to-know-how-can-i-create-my-own-simple-api%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Please follow the steps to create your own simple API.
- First, create a basic module.
Add
webapi.xml
file to define the API URL, service class and methods.app/code/Milandev/SimpleAPI/etc/webapi.xml
.<?xml version="1.0" ?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
<route method="GET" url="/V1/milandev-simpleapi/product/:sku">
<service class="MilanDevSimpleAPIApiProductManagementInterface" method="getProduct"/>
<resources>
<resource ref="anonymous"/>
</resources>
</route>
</routes>Add API class.
app/code/Milandev/SimpleAPI/Model/ProductManagement.php
.<?php
namespace MilanDevSimpleAPIModel;
class ProductManagement implements MilanDevSimpleAPIApiProductManagementInterface
/**
* @inheritdoc
*/
public function getProduct($sku)
// add your logic
return $sku;
Add API interface.
app/code/Milandev/SimpleAPI/Api/ProductManagementInterface.php
.<?php
namespace MilanDevSimpleAPIApi;
interface ProductManagementInterface
/**
* GET for product api
* @param string $sku
* @return string
*/
public function getProduct($sku);Add dependency class in the
di.xml
.app/code/Milandev/SimpleAPI/etc/di.xml
.<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MilanDevSimpleAPIApiProductManagementInterface" type="MilanDevSimpleAPIModelProductManagement"/>
</config>- Test the API using rest-client by following the URL structure.
http://exmaple.com/index.php/rest/V1/milandev-simpleapi/product/sku
add a comment |
Please follow the steps to create your own simple API.
- First, create a basic module.
Add
webapi.xml
file to define the API URL, service class and methods.app/code/Milandev/SimpleAPI/etc/webapi.xml
.<?xml version="1.0" ?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
<route method="GET" url="/V1/milandev-simpleapi/product/:sku">
<service class="MilanDevSimpleAPIApiProductManagementInterface" method="getProduct"/>
<resources>
<resource ref="anonymous"/>
</resources>
</route>
</routes>Add API class.
app/code/Milandev/SimpleAPI/Model/ProductManagement.php
.<?php
namespace MilanDevSimpleAPIModel;
class ProductManagement implements MilanDevSimpleAPIApiProductManagementInterface
/**
* @inheritdoc
*/
public function getProduct($sku)
// add your logic
return $sku;
Add API interface.
app/code/Milandev/SimpleAPI/Api/ProductManagementInterface.php
.<?php
namespace MilanDevSimpleAPIApi;
interface ProductManagementInterface
/**
* GET for product api
* @param string $sku
* @return string
*/
public function getProduct($sku);Add dependency class in the
di.xml
.app/code/Milandev/SimpleAPI/etc/di.xml
.<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MilanDevSimpleAPIApiProductManagementInterface" type="MilanDevSimpleAPIModelProductManagement"/>
</config>- Test the API using rest-client by following the URL structure.
http://exmaple.com/index.php/rest/V1/milandev-simpleapi/product/sku
add a comment |
Please follow the steps to create your own simple API.
- First, create a basic module.
Add
webapi.xml
file to define the API URL, service class and methods.app/code/Milandev/SimpleAPI/etc/webapi.xml
.<?xml version="1.0" ?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
<route method="GET" url="/V1/milandev-simpleapi/product/:sku">
<service class="MilanDevSimpleAPIApiProductManagementInterface" method="getProduct"/>
<resources>
<resource ref="anonymous"/>
</resources>
</route>
</routes>Add API class.
app/code/Milandev/SimpleAPI/Model/ProductManagement.php
.<?php
namespace MilanDevSimpleAPIModel;
class ProductManagement implements MilanDevSimpleAPIApiProductManagementInterface
/**
* @inheritdoc
*/
public function getProduct($sku)
// add your logic
return $sku;
Add API interface.
app/code/Milandev/SimpleAPI/Api/ProductManagementInterface.php
.<?php
namespace MilanDevSimpleAPIApi;
interface ProductManagementInterface
/**
* GET for product api
* @param string $sku
* @return string
*/
public function getProduct($sku);Add dependency class in the
di.xml
.app/code/Milandev/SimpleAPI/etc/di.xml
.<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MilanDevSimpleAPIApiProductManagementInterface" type="MilanDevSimpleAPIModelProductManagement"/>
</config>- Test the API using rest-client by following the URL structure.
http://exmaple.com/index.php/rest/V1/milandev-simpleapi/product/sku
Please follow the steps to create your own simple API.
- First, create a basic module.
Add
webapi.xml
file to define the API URL, service class and methods.app/code/Milandev/SimpleAPI/etc/webapi.xml
.<?xml version="1.0" ?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
<route method="GET" url="/V1/milandev-simpleapi/product/:sku">
<service class="MilanDevSimpleAPIApiProductManagementInterface" method="getProduct"/>
<resources>
<resource ref="anonymous"/>
</resources>
</route>
</routes>Add API class.
app/code/Milandev/SimpleAPI/Model/ProductManagement.php
.<?php
namespace MilanDevSimpleAPIModel;
class ProductManagement implements MilanDevSimpleAPIApiProductManagementInterface
/**
* @inheritdoc
*/
public function getProduct($sku)
// add your logic
return $sku;
Add API interface.
app/code/Milandev/SimpleAPI/Api/ProductManagementInterface.php
.<?php
namespace MilanDevSimpleAPIApi;
interface ProductManagementInterface
/**
* GET for product api
* @param string $sku
* @return string
*/
public function getProduct($sku);Add dependency class in the
di.xml
.app/code/Milandev/SimpleAPI/etc/di.xml
.<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MilanDevSimpleAPIApiProductManagementInterface" type="MilanDevSimpleAPIModelProductManagement"/>
</config>- Test the API using rest-client by following the URL structure.
http://exmaple.com/index.php/rest/V1/milandev-simpleapi/product/sku
answered Jul 20 at 21:09
Milan ChandroMilan Chandro
1806 bronze badges
1806 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f282480%2fi-am-new-here-i-want-to-know-how-can-i-create-my-own-simple-api%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
following link will be helpful for you lorenzosfarra.com/2017/06/20/…
– MSA
Jul 18 at 7:29