Questions tagged [webapi]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
38
votes
8answers
4k views

What is Progressive Web Apps, or PWAs in Magento 2?

What does it mean that Magento is becoming a Progressive Web Application platform? What will be the code structure of PWAs in Magento? What is the deal with REST APIs and PWAs?
15
votes
2answers
4k views

How to create custom Module Development in magento 2 from Scratch?

How to create Custom Module Development from scratch in magento 2 with following point. 1.How to Create Module 2.How to Install and Upgrade Database 3.How to Create Module,view and Controller ...
10
votes
2answers
5k views

Consumer “async.operations.all” skipped as required connection “amqp” is not configured. Unknown connection name amqp

Since I upgraded from Magento 2.2.7 to Magento 2.3.1 I am getting this message in the system.log file: main.INFO: Consumer "async.operations.all" skipped as required connection "amqp" is not ...
8
votes
3answers
10k views

Magento 2: How to return a JSON object from the API?

I'm trying to return a JSON object from one of my REST Models, something like this: { "settings": { "set1" : 2, "set2" : "key1" }, "extra": { "e1'" : { ...
8
votes
3answers
2k views

Magento2: How to check if request is from Web Service?

In Magento 1, We used to check as: if (Mage::getSingleton('api/server')->getAdapter() != null) { // request from Web-Service } How to check the same in Magento2? I didn't find any proper ...
8
votes
2answers
6k views

How to disable/enable a product programatically in Magento2?

I am trying to emulate the same behavior as when you use the admin panel to disable a product. I am trying to do something like this: $product = $this->productRepository->get($sku); $product-&...
6
votes
1answer
3k views

Magento2.2.5 How to access Magento Log file for Web API?

we use the Magento api to update our warehouse system when we recieve orders and then update magento again with inventory updates from our warehouse system. However we recently had an order that gave ...
6
votes
1answer
1k views

Best practice for returning errors in WebApi

So let's say I have a model, responding to my webapi calls, whats the best way to return an error to the api consumer. For example, in the code below, the second line query the category factory (di-ed)...
6
votes
1answer
89 views

Magento 2 : How to create custom webapi?

How to implement web API in custom extension in magento2?
5
votes
3answers
2k views

Magento 2 : Can the REST API return plain text?

I'm trying to make an endpoint for the Magento 2 Web API that simply returns plain text. Is this possible and if so, how? I'm currently trying this: webapi.xml: <route url="/V1/export/txt" ...
5
votes
1answer
1k views

How do I consume the REST API in Magento 2, using AJAX with session-based authentication?

I am having issues successfully making an AJAX call to Magento 2 REST API endpoints, using session-based authentication. When I run the following javascript, I always receive a 401 (Not Authorized) ...
4
votes
1answer
3k views

Magento 2 Customer login and forgot Password using Rest API

I need customer login and customer forgot password using Magento 2 API. Can you please help me. I was search but not getting any code from google.
4
votes
2answers
815 views

Get customer details by using Authentication Token

I use this Magento 2 rest api to get customer token: curl -X POST "https://my.project/rest/V1/integration/customer/token" \ -H "Content-Type:application/json" \ -d "{"username":"me@awesome....
4
votes
0answers
24 views

Magento 2 : How to change in order status and order id for display purpose in custom POS

We have Custom POS system enabled on the website. Like to append some labels in the order id and order current status for the display purpose only in the POS system not for the website(frontend) ...
4
votes
0answers
331 views

How to update custom order status through custom Api using order id in Magento2?

I have created custom Api to update order status by using Order Id. I have used the below code in webapi.xml file. <route url="/V1/orderstatus/orderUpdate" method="POST"> <service class="...
3
votes
1answer
779 views

How get wishlist in Magento 2 Rest API?

Get Wishlist product in Magento 2 REST API ? And Add to Wishlist in Magento 2 REST API ? Wishlist API is not provided by Magento 2
3
votes
1answer
306 views

Magento 1 vs Magento 2. Difference between solutions offered by Magento 1 and Magento 2 when is comes to web APIs

Specific on the area of web APIs. Does Magento 2 offer something that Magento 1 does not. Are there any problems with Magento 1 Web APIs that Magento 2 has fixed What are the main differences between ...
3
votes
2answers
643 views

pass multiple parameter to rest web API

i have created a rest web api. i want to pass multiple parameters to get my required data.How is could be. interface ProductsInterface { /** * Returns greeting message to user * * @...
3
votes
2answers
430 views

Magento2 need to throw 500 internal server error in webapi response

Can anyone let me know how to throw 500 internal error in api response with REST API? i have used below right now: throw new NoSuchEntityException( __( 'Field : '.$fields.' required.' )); but it ...
3
votes
0answers
77 views

A list of the possible web api shipping method codes for the salesOrderRepositoryV1 GET? [closed]

I am using Magento 2.1.0 web api system to extract new orders from my Magento store and then place them into a 3rd party accounting system. I would like to know what are all of the possible responses ...
3
votes
2answers
1k views

Magento 2 : Social Login via Rest Api

I need to create a user account using social network via the API. I have created via native iOS application that hooks into magento 2 store API. However, I can not find a way to create an account ...
2
votes
1answer
158 views

profile API call

I enable profiler SetEnv MAGE_PROFILER html in my conf file for magento 2. Is there an easy way to profile Magento 2 API REST calls.
2
votes
1answer
1k views

How to override webapi.xml in custom module?

I want to override /vendor/magento/module-catalog/etc/webapi.xml file in my custom module. <route url="/V1/categories" method="GET"> <service class="Magento\Catalog\Api\...
2
votes
1answer
4k views

Get list of ALL customers using REST API

I know I can get a specific customer by running: curl -X GET "http://127.0.0.1:32769/index.php/rest/V1/customers/2" -H "Authorization: Bearer token" How do I get the list of ALL customers?.. GET "...
2
votes
1answer
392 views

<parameter name=“customerId” force=“true”> in customer module webapi.xml

In Magento2 module-customer webapi.xml file, the API GET "/V1/customers/me" has codes below: <route url="/V1/customers/me" method="GET"> <service class="Magento\Customer\Api\...
2
votes
1answer
1k views

“Undefined index: interface” error from Magento 2 swagger webapi

I'm getting the following error when loading the swagger routes: Undefined index: interface in /mnt/c/develop/php/mage2/vendor/magento/module-webapi/Model/AbstractSchemaGenerator.php on line 156 {"...
2
votes
1answer
498 views

Magento 2 - Session based authentication doesn't work

I don't know if this is a bug in Magento 2 API or not, so I didn't post it on Magento 2 Github issues. According to this link: http://devdocs.magento.com/guides/v2.0/get-started/authentication/gs-...
2
votes
1answer
68 views

Magento 2: Running any command getting error Class Magento\Webapi\Model\Cache\Type\Web Api\Interceptor does not exist

Running any command s:up , s:di:c s:s:d -f cache getting error Class Magento\Webapi\Model\Cache\Type\WebApi\Interceptor does not exist And like below images, any help will be appreciate.
2
votes
3answers
2k views

Request does not match any route issue in magento 2

I have creating a extension for get cms static block content using rest api. di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
2
votes
1answer
2k views

Oauth 2.0 in Magento 2.2 with how to access the token

Can please give example to access the magento 2 api by using oauth 2
2
votes
1answer
33 views

Magento 2. Does Commerce offers more functionality than Open Source in term of Web APIs?

Does Magento 2 Commerce offer something in addition to what M2 Open Source offers in terms of Web APIs?
2
votes
1answer
1k views

class [] does not exist for custom extension_attributes over webapi

I created a custom module to store the details of discount per items. I have a custom tables to store informations (quote items, order items, invoice items), and I use a extension attributes to link ...
2
votes
1answer
198 views

Magento2 Rest API reset password with different store id getting default email template

I am using Rest API to reset password of customer, i have already passed websiteId for different store but when i am getting reset password email, it is coming of default store not the store i have ...
2
votes
0answers
133 views

custom_attributes not returning from Magento 2 REST API

Using the Magento 2 REST API, I was able to successfully create a new product attribute sending a PUT request to V1/products/attributes/{attribute_code}. In the request, I added a value in the ...
2
votes
0answers
40 views

Magento 2.2 - Custom WEBAPI - Custom JSON Structure

i need to understand following situation: An external systems need to send a JSON Structure ( nearly similar than the magento default structure ) by using the web-api to import / update (POST/PULL) ...
2
votes
0answers
122 views

Magento 2: Is there a way to return custom json response from REST API without building a data interface?

I have a few custom REST API interfaces on my module & they all need to return a standard json response (different on each). After a little research, I realized that I can't do something like @...
2
votes
1answer
759 views

where to find Magento 2 API docs?

Finally I found out the magento 2 api endpoint for all products as below rest/V1/products?searchCriteria[pageSize]=20 but I need more detailed docs about api endpoints which I coudn't find out yet. ...
2
votes
0answers
56 views

Magento2 SOAP with C#

I am trying to read Magento customer from a C# third-party software. When I enter SOAP into the browser, its throwing error. URL:- http://localhost:81/magento2-2.2.5/soap/default?wsdl&...
2
votes
0answers
132 views

How to get window.checkoutConfig data via REST API?

I am building a custom frontend for Magento 2 Checkout. Sometimes the checkout uses window.checkoutConfigin the built-in frontend. My frontend uses the REST API provided by Magento 2, but how can I ...
2
votes
1answer
2k views

SOAP-ERROR: Parsing WSDL: Couldn't load from URL Failed to load External Entity

I'm trying to get all products in $productArrarray from magento 2 API via SOAP client. I tried the below function but it throws this error: Error: SOAP-ERROR: Parsing WSDL: Couldn't load from '...
2
votes
1answer
716 views

Restricting access to anonymous web APIs

As given in the documentation here : http://devdocs.magento.com/guides/v2.0/rest/anonymous-api-security.html By default magento 2 only restrict Catalog, Store and CMS API from anonymous users. In a ...
2
votes
1answer
272 views

Unable to update custom column value of sales_order via Rest API

I want to trace records of all the completed orders which has been received from my Magento store to my ERP store through Rest API. I have created custom column through SQL query in sales_order so ...
2
votes
0answers
77 views

How to implement paypal using Web Api on Magento2?

I am developing a mobile app using Magento2 Web Api. I am wondering how to implement Paypal for my mobile app. What versions of Paypal (express, etc.), is it used as an offline payment method?, do I ...
1
vote
1answer
2k views

How to add cutom customer attribute field to call rest api via create new customer

I have created a custom customer attribute(mobile_number) and set default value of customer create account. I added mobile number to customer_attribute: $customerSetup->addAttribute(Customer::...
1
vote
1answer
527 views

Magento 2: How can I store my original REST request in a file on the server?

I need to store my REST request within the file system - I have tried serializing the request object, but obviously the file size is quite a lot larger than the original. I have run a test that ...
1
vote
1answer
127 views

Magento 2.3 - Need detail about some newly introduced feature

I need to know about some of the newly introduced featured of Magento 2.3 GraphQL Declarative DB Schema Asynchronous and Bulk Web API There are few blogs information but not elaborating properly. I ...
1
vote
2answers
1k views

How to create custom API for company and customer creation in Magento 2

I want to create a company/company admin-user in Magento 2 (as what it does from the front-end/back-end panel) via a single API call. Right now am doing with two API calls First is creating a ...
1
vote
1answer
584 views

Unit test case for custom module REST API

I wanted to write unit test case for custom REST API in magento2. I have already gone through the : http://devdocs.magento.com/guides/v2.0/get-started/web-api-functional-testing.html I am getting ...
1
vote
1answer
48 views

Magento 2.2.6 : Shipment creation using REST API

Unable to create shipment in Magento 2.2.6 I am using the following source code like this in postman https://test.com/rest/V1/shipment { "entity" : { "order_id" : 70, "items" : [{ "order_item_id" ...
1
vote
1answer
815 views

Extending Magento2 API

I have a very weird problem when trying to extend Magento2 API, I followed all the right steps, however im getting this syntax error when calling http://appfactory.loc/index.php/rest/V1/appfactory/...