Questions tagged [webapi]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
4 views

Custom acl resource for api endpoint

I have a route defined in one of my modules like this <route url="/V1/some/path/:type" method="GET"> <service class="SomeClassOrInterfaceHere" method="...
user avatar
  • 195k
0 votes
0 answers
27 views

Custom WebApi not working in magento 2.4.4

I have create a custom webapi for QuoteRequest. It is working fine with Magento 2.4.3 < but not working with Magento 2.4.4 with php 8.1 <?xml version="1.0"?> <routes xmlns:...
user avatar
0 votes
0 answers
9 views

Magento 2 WebAPI ACL tree issue

Looks like if you define the ACL resource for the webAPI, no matter what, Magento always looks for parent resource permission. In the file vendor/magento/zendframework1/library/Zend/Acl.php you find ...
user avatar
0 votes
0 answers
31 views

Add Multiple Products in Cart Through Magento 2 REST API

How can I add multiple products in Add to Cart Using Magento 2 REST API? It's working perfectly for one item: Endpoint: https://store_domain.com/rest/V1/guest-carts/5dffy5BvEeuqZ3lLSAEPWD7SGJkvO2cY/...
user avatar
1 vote
0 answers
153 views

How to get an admin token from REST API when 2FA is enabled and using U2F?

Magento 2.4.2-p2 Greetings, I'm interested in to get an admin token from the REST API when 2FA is enabled and as authentication provider U2F is used. I have a small application running on another ...
user avatar
  • 146
0 votes
1 answer
34 views

Not getting a Valid JSON Respon from magento2 custom API

I am trying to return the collection factory from database , it is giving an array now i convert it to json using JSON Encode function but it is returnig a string with backslashes !! Code for Api ...
user avatar
0 votes
1 answer
39 views

Bunch update product attribute using api

I want to update product attributes via API, something like the import tool but can be posted automatically from another server. The API to update single product /V1/products/:sku which uses the ...
user avatar
0 votes
0 answers
7 views

How to verify webapi config using n98/n98-magerun2.phar?

I am new for n98-magerun2.phar. I need to verify the webapi config using n98-magerun2.phar command. But unable to find a way to do that. I have also googled for this but no luck. Please help me.
user avatar
  • 11
0 votes
2 answers
139 views

phpunit.rest.xml fatal error could not read ""

I am trying to run the Magento web api tests by running the following command: vendor/bin/phpunit --config ./dev/tests/api-functional/phpunit_rest.xml But it gives this error: PHP Fatal error: ...
user avatar
  • 1
0 votes
3 answers
347 views

Return JSON response instead of JSON String

I am working on building REST API which will return data of regions. API is working as expected but problem I am facing is, it is returning response with JSON string and not able to parse that. Would ...
user avatar
  • 3,664
1 vote
2 answers
1k views

Test all soap endpoint api with Wizdler chrome extenssion

We can check rest api with all the parameter detail from swagger so I would be highly appreciated if you guys have tested SOAP api with any tool then please guide me. I have installed Wizdler chrome ...
user avatar
  • 2,038
1 vote
1 answer
1k views

How to reduce Magento 2 rest api performance time?

I have created some custom rest api's and using Magento's default rest api's. I want to reduce the loading time of the api, as I have custom api's too so the request time and response time is quite ...
user avatar
1 vote
1 answer
1k views

Magento 2 - Write plugin for API interface

In the documentation it says: "A plugin, or interceptor, is a class that modifies the behavior of public class functions by intercepting a function call and running code before, after, or around ...
user avatar
  • 2,403
1 vote
1 answer
222 views

Delivery method is not visible in the Magento 2 api

I have already created a delivery and payment module and they are automatically exposed in the Magento 2 api rest, but a third shipping method does not appear, despite being working normally on the ...
user avatar
1 vote
2 answers
65 views

Customer Mobile API for Magento 2.3

I am trying to create a mobile app for a Magento 2.3 CE site, So far I have found where the Swagger documentation is and have managed to log in as a customer using the integrate endpoint. What I don't ...
user avatar
0 votes
1 answer
314 views

Magento 2 handle WEBAPI error and success Response for multiple data input

I have an input data like this for my custom web api: "data":[{"sku":"BM0011","warehouse":"kklm","qty":"5"},{"sku":"YU9982","warehouse":"cvxs","qty":"2"}] I need to validate the data and run the ...
user avatar
  • 177
1 vote
2 answers
365 views

Shipping Address Verification Magento2

Can someone help me in guiding available API's or any suitable extension for shipping address verification in magento 2 commerce website.
user avatar
1 vote
1 answer
403 views

Magento 2: How to integrate Pay Pal Payment gateway with Magento 2 REST API for Android?

We are trying to build the generic android mobile app which can be used by magento 2 owners using REST API for Magento2 and have implemented the basic features for the app. As most of the people ...
user avatar
1 vote
0 answers
520 views

Magento2 - How to get estimate shipping rates for guest users using js?

I have followd this link to get estimate shipping rates, its working fine for logged in user. But I need to implement this with guest user as well. I have changed service url for guest user as ...
user avatar
  • 109
1 vote
0 answers
85 views

How can I add a custom Middleware for header validation in Rest API?

I have added 2 new Web APIs for the customer, but I want to add a new HTTP Header authentication with parallel to Authorization token. My customer header is AppToken. How can I add a middleware to ...
user avatar
  • 1,484
1 vote
0 answers
145 views

How to correctly use "self" resource in Magento 2 webapi.xml

I have created some endpoints in a module that have a resource of "self" When I call the request using a jQuery ($.post) I get an Not allowed to accesses resource "self". These requests are done on ...
user avatar
4 votes
2 answers
2k views

Magento 2.3.3 Getting issue in custom module GraphQL

I would like to create custom GraphQL for a custom module. but I am facing an issue. see below GraphQL response. In the above image, you can see I am able to get the response of days and **details** ...
user avatar
  • 5,856
0 votes
1 answer
75 views

Magento 2.2.2 Custom Api

I have created a custom api and add some getters and setter, I'm looking to find out if it's possible to pass key pair values in the post without having to set the setters. When I call the api I get ...
user avatar
0 votes
1 answer
168 views

How to override vendor/Magento/Module-customer/etc/webapi.xml

To prevent spammers to create accounts in Magento 2.2.4. I want to change resource ref= in vendor/Magento/Module-customer/etc/webapi.xml How can I override this core xml ??
user avatar
0 votes
1 answer
363 views

Indexer configured as update on save, get triggered after an update through web api?

Documentation says: Configure indexers Use this command to set the following indexer options: Update on save (realtime): Indexed data is updated as soon as a change is made in the Admin. (...
user avatar
2 votes
2 answers
3k 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.
user avatar
  • 171
0 votes
1 answer
96 views

API url for instant purchase in magento 2.2.6

I am new for Magento and want to create REST API of instant purchase functionality for mobile application using Magento version 2.2.6. I have configured instant purchase option for site and it's ...
user avatar
  • 101
1 vote
0 answers
279 views

JSON Serialize DateTime in Web API

A lot of my Web API interfaces use DateTime return types or parameters as follows. interface TestInterface { /** * @param \DateTime $value * @return void */ public function ...
user avatar
  • 11
1 vote
0 answers
224 views

Magento 2 - How to configure REST API?

I want to create REST API in Magento 2.3.2 for Mobile Application but I have few confusions regarding REST API. Can anyone guide me on this, please? Is there any quick start or say ready-made API ...
user avatar
  • 2,164
0 votes
1 answer
443 views

How to set Rest API oAuth token expire in minutes or seconds

How to set Rest API oAuth token expire in minutes or seconds in admin. Currently it's showing hours and it will not accept like 0.5(for 30 minute etc) magento2. Any One know about this, please help me ...
user avatar
1 vote
0 answers
42 views

Saving only one field from REST web API

Alright, I am just not getting my head around it. Trying to save the only title of existing CMS Page from web API, but looks when I do that all other fields are gone null. I am using postman: PUT ...
user avatar
4 votes
0 answers
38 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) ...
user avatar
  • 1,745
1 vote
0 answers
22 views

Authorization on webapi

I have built a custom webapi endpoind with which a customer can get details of their personalised item. <route url="/V1/personalizations/get/:personalizationId" method="GET"> <...
user avatar
1 vote
0 answers
11 views

Best practices for webapi data manipulation

I am building a custom subscription module. I have exposed a number of APIs for the frontend to consume. I have the API hooked into standard repository endpoints: public function getList(\Magento\...
user avatar
1 vote
0 answers
15 views

Web API interface theory

I am writing a frontend that lists some custom data. It calls an endpoint /rest/v1/custom/get that hooks into my CustomListInterface defined in the webapi.xml, this then returns a list of records in a ...
user avatar
1 vote
0 answers
104 views

Magento 2: Adding Extra Parameters to Exception

I need to return error codes instead of messages in the exception. For example, what I am looking for is below throw new \Magento\Framework\Exception\LocalizedException(__("number is incorrect"),"...
user avatar
  • 1,935
1 vote
1 answer
640 views

Magento 2 how to receive a webhook body?

I'm doing an integration with a system called Sift Science. What I need to accomplish is to receive a response whenever someone in Sift Science performs an action (for example> Approve account, ban ...
user avatar
0 votes
2 answers
1k views

Magento 2 WebAPI json encode

I'm returning JSON via an endpoint in Magento 2 this bit of JSON looks like the following: $new_json = [ 'component_1' => '[{....}]', 'component_2' => '[{...}]' ]; ...
user avatar
  • 1,353
1 vote
1 answer
163 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" ...
user avatar
0 votes
1 answer
2k views

MAGENTO 2 REST API: PUT through POSTMAN [Resolved]

I'm trying a PUT on Magento 2 REST API through POSTMAN like this: https://domain/rest/V1/products/IP_X With only a price change on the json content. getting the following error message: { "...
user avatar
0 votes
1 answer
36 views

How to Create Token based Router in Magento2?

I want to create Custom API through controller action. How i can authenticate using token to make secure API. Example: http://www.example.com/webapiv1/getItems http://www.example.com/webapiv1/...
user avatar
1 vote
0 answers
426 views

Error during rate request at Dhl/Express/Webservice/Soap/RateServiceAdapter.php:77

I have upgraded magento 2.2.4 to 2.3.2. After upgrade version we have enabled MSI modules. After Enabling MSI modules we are getting below error when we try to create shipment. We are not able to ...
user avatar
  • 31
6 votes
2 answers
5k views

Magento 2 : How to create custom webapi?

How to implement web API in custom extension in magento2?
user avatar
4 votes
2 answers
4k views

How to 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 can I do that ? interface ProductsInterface { /** * Returns greeting message to user * ...
user avatar
  • 964
1 vote
0 answers
35 views

Magento 2x web rest api: Anyone can tell me about endpoint to get order status from store configuration?

I wonder if there is endpoint to get orderstatus by using api in magento 2x. As I check there is issue that created since 2016 but closed because report in github link
user avatar
2 votes
0 answers
274 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 ...
user avatar
23 votes
7 answers
34k 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 ...
user avatar
  • 231
3 votes
3 answers
6k 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:...
user avatar
1 vote
1 answer
1k views

How to call Web API call inside custom module Magento 2

How can we call Web API in a custom module? I have a third party module, in which they are sending a request with API calls. I have custom functionality where I have to redirect my page to that Web ...
user avatar
  • 630
1 vote
0 answers
79 views

Headless Magento

Please let me know the best practices to be followed while creating an e-commerce solution which uses the headless approach. Whether Magento or frontend-side need to implement custom business logic ...
user avatar