51

What is Progressive Web Apps ? Looks and behaves like a mobile app. Take advantage of native mobile device features, without requiring the end user to visit an app store, make a purchase and download it locally. Why PWA? Fast Secure (second last topic of answer) Responsive Cross-browser compatible Offline Mode (Check the last topic in the answer) Mobile “...


10

Step 1:- Create a module Stackexchange_Test using silk software module creator Click here to create a module Step2 :- create a install script using below script in the below path app/code/Stackexchange/Test/Setup/InstallSchema.php <?php namespace Stackexchange\Test\Setup; class InstallSchema implements \Magento\Framework\Setup\InstallSchemaInterface { ...


9

There are 2 methods to achieve this First one Filter.php (api model) public function __construct(\Magento\Framework\Webapi\Rest\Request $request){ $this->_request = $request; } /** * Retrieve filterlist * * @api * @return array */ public function retrieve(){ $...


8

Please follow the below steps from custom module if it success then you can customize whatever you want. Note:- we are creating a new product attribute and associating the required data to the product attribute. Step 1:- create a new module using silk software tool ex:- CompanyName_ModuleName Step 2:- create a new product attribute using install script ...


8

After research I found the method name setOption in Class \Magento\Framework\HTTP\Client\Curl And add following line in my code like this $curl = new \Magento\Framework\HTTP\Client\Curl; $curl->setOption(CURLOPT_SSL_VERIFYHOST,false); $curl->setOption(CURLOPT_SSL_VERIFYPEER,false); And it works :)


8

Finally got the solution, i am trying my best to explain it. so here's how Magento works !! Magento gets the customer data with passing anything except token value in API call. In between magento calls some API related controllers for the same vendor/magento/module-customer/etc/webapi.xml <route url="/V1/customers/me" method="GET"> <...


7

As magento is using "PWA" it is also adding "GraphQL API" for providing front-end development side api alternative of "REST/SOAP" as "GraphQL" api. GraphQL GraphQL is a query language for using APIs. With the rise of the PWA, there is a need to get smaller amounts of data and to make fewer API requests. GraphQL’s query language makes this possible ...


6

I've found out how to get list options I was looking for, it's possible to get attributes groups with array with options like so: http://magento2.dev/rest/V1/products/attributes?&searchCriteria[filterGroups][0][filters][0][field]=attribute_group_id&searchCriteria[filterGroups][0][filters][0][value]=31 Where 31 is the attribute_group_id of custom ...


6

If you do a GET (rest/V1/products/YOURSKU) on the required item, you can see what the option_value / option_id are. For an example product on my store - "configurable_product_options": [ { "id": 84, "attribute_id": "186", "label": "Subscription Term", "position": 0, "values": [ ...


6

PWA - Progressive Web Application are the generally web application which is user experiences the rich web. in way of : Reliable - load instantly and also available in offline mode. Fast - in a way of interaction where user are smoothly interact with it, and also without any scrolling or animation junks. Engaging - as denoted above both points if ...


6

Create a module Test_Mobileshop Please follow the below steps with the file paths 2.app/code/Test/Mobileshop/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 url="/V1/wishlist/items" method="...


6

I call Google Map API for get Latitude and Longitute of the specific location parameter I used this code in controller public function execute() { $url ="https://maps.googleapis.com/maps/api/geocode/json?address=%27White+House,+Pennsylvania+Avenue+Northwest,+Washington,+DC,+United+States%27&sensor=true_or_false&key=...


5

You have issue with your api url : Your API URL should be like this - http://local.magento.com/index.php/rest/V1/customers/1/billingAddres Where you must need to add index.php/rest before the api parameters. index.php is optional BUT rest parameter is required in your url. Fore more details refer this link - Magento 2 REST API usage with examples Also ...


5

Please put below code of paramOverrider in your webapi definition where you need customer Id. <data> <parameter name="customer.id" force="true">%customer_id%</parameter> </data>


5

There a good tutorial about Magento 2 API Here On the basis of above tutorial you can get all order by: <?php ini_set('error_reporting', E_ALL); ini_set("display_errors", "1"); $userData = array("username" => "Admin_username", "password" => "Admin_password"); $ch = curl_init("http://127.0.0.1/mago/index.php/rest/V1/integration/admin/token"); ...


5

How magento 2 make calls in-between for the APIs ? Magento gets the customer data with passing anything except token value in API call. In between magento calls some API related controllers for the same vendor/magento/module-customer/etc/webapi.xml <route url="/V1/customers/me" method="GET"> <service class="Magento\Customer\Api\...


5

Ok I found the solution, I checked some core files of catalog module and I can see that search criteria and total records are not in items index so I just need to update my request like below. http://localhost/magento/rest/default/V1/products?searchCriteria[sortOrders][0][direction]=ASC&currencyCode=USD&searchCriteria[currentPage]=1&...


5

You can try below code for this. Although answer of @Supravat is correct but I am posting this as per my approach. extension_attributes.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="...


5

Magento2 does not suggest to add stock info to listing Api a MSI add to 2.3 version. But if you want don't use MSI to your system then you can below solution 1.Create di.xml at your app/code/StackExchange/Magento Update ExtensionPool data of Magento\Catalog\Api\Data\ProductInterface and add stock_item data provider. <?xml version="1.0" encoding="UTF-8"...


5

By default Magento there is no API endpoints to get the version. Based on your needs, you can create new API class then inject ProductMetadataInterface or inject ProductMetadataInterface in existing class wherever needs. public function __construct( \Magento\Framework\App\ProductMetadataInterface $productMetadata ) { $this->productMetadata = $...


5

You need to use "search" instead of "searchs". It's typo and also you need to specify search criteria fields. Execute this below URL in your postman {baseurl}/rest/V1/cmsPage/search?searchCriteria[sortOrders][0][field]=identifier&searchCriteria[sortOrders][0][direction]=asc


4

You can achieve it with the help of plugin. I had to add an attribute delivery_type in order and order collection api response. Here is how I have added it through my module. etc/extension_attributes.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/...


4

Create extension attributes in extension_attributes.xml file like below. <extension_attributes for="Magento\Quote\Api\Data\CartItemInterface"> <attribute code="image_url" type="string" /> </extension_attributes> Add one observer for event "sales_quote_load_after" in observer add below code. use Magento\Framework\Event\...


4

My question is what is the function of the <parameter name="customerId" force="true">%customer_id%</parameter> and how it work? Magento gets the customer data with passing anything except token value in API call. In between magento calls some API related controllers for the same vendor/magento/module-customer/etc/webapi.xml <route url="/...


4

I have seen you are passing parameter in Form-Data that might be the reason you are facing this kind of issue instead of Form-data select parameter as RAW - then choose JSON(application/json) ! Also you are passing customerId=146 in URL - so you actually don't need to pass this in parameter - as it is for that specific user only so !! Below i am ...


4

In magento web-API when you pass user name and password then it genrates token for that specific customer (Which is only valid for 1 hour - configurable from admin) http://magento.host/index.php/rest/V1/integration/customer/token?username=test.user@test.com&password=test@123 webapi.xml code <route url="/V1/customers/me" method="GET"> <...


4

Unfortunately, there is no endpoint to upload category image, I worked on this case before, and i would like to share my solution first of all, you need to build a custom endpoint to upload the image to this path (send the data in base64 then save it in this path) /{magento_root}/pub/media/catalog/category lets say your image name is your_image.jpg ...


4

You should be able to filter out the orders of a single customer using the search query parameters like this: https://<mage host>/rest/V1/orders/?searchCriteria[filterGroups][0][filters] [0][field]=customer_id&searchCriteria[filterGroups][0][filters][0][value]=<customer_id> This returns a list of orders on which you can loop and find out ...


4

For that you need to make different route url for that specific API <!-- Category Product Links --> <route url="/V1/rbcategories/:categoryId/products" method="GET"> <service class="Magento\Catalog\Api\CategoryLinkManagementInterface" method="getAssignedProducts" /> <resources> <resource ref="...


4

I would recommend to check (even as a trial option) solutions like: Blackfire.io NewRelic xdebug Those tools will show you exact traces and timing of each separate PHP Trace that is involved within any operation/transaction (not limited to API calls) For Database related bottlenecks - MySQL Slow Query Log can be enabled (*depends on MySQL Version used). ...


Only top voted, non community-wiki answers of a minimum length are eligible