Questions tagged [webapi]
The webapi tag has no usage guidance.
117
questions
1
vote
0
answers
44
views
Magento 2.4.3-p2 error with rest/V1/customers/me webapi
I upgraded to 2.4.3-p2 from 2.4.3 and I am suddenly getting this error when call the rest/V1/customers/me api: "message": "Internal Error. Details are available in Magento log file. ...
0
votes
1
answer
212
views
Set Maximum SearchCriteria pageSize to 500
How set Maximum SearchCriteria pageSize to 500.
In documentation Magento is present this page but not found these options
https://experienceleague.adobe.com/docs/commerce-admin/config/services/magento-...
0
votes
1
answer
144
views
How to stop create customer via rest API in magento 2?
I do not know how to stop to create customers via REST API in magento 2. I have magento 2 instance in 2.4.0 version
I found a below code in vendor/magento/module-customer/etc/webapi.xml path
<route ...
0
votes
2
answers
311
views
How to include a custom attribute in the Customer object when calling through API
I made a custom attribute using this code in the Setup/Patch/Data, everything works just fine except when calling the API to get the customer object, it comes without the new custom attribute included,...
0
votes
1
answer
323
views
Content-Type HTTP application/x-www-form-urlencoded is return error
When i am using Content-Type: "application/x-www-form-urlencoded" in API i getting the error:
{
"message": "Server cannot understand Content-Type HTTP header media type ...
1
vote
0
answers
108
views
Magento 2 API: How to set custom shipping rate for order?
I'm creating the order via API requests to Magento's REST endpoints. I would like to set a custom shipping rate for the order. I want to preserve the shipping carrier name and method but have a custom ...
0
votes
0
answers
144
views
OpenAPI (Swagger) specification for bulk endpoints
We are integrating with a Magento webshop via its REST API. We are generating a client based on the OpenAPI (Swagger) specification (via /rest/schema).
Now, we want to use the bulk api. However, these ...
0
votes
1
answer
100
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="...
0
votes
1
answer
162
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:...
1
vote
1
answer
1k
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 ...
0
votes
1
answer
183
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 ...
0
votes
1
answer
118
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 ...
0
votes
2
answers
256
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: ...
0
votes
4
answers
840
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 ...
1
vote
2
answers
2k
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 ...
1
vote
1
answer
2k
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 ...
1
vote
1
answer
2k
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 ...
1
vote
1
answer
424
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 ...
1
vote
2
answers
73
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 ...
0
votes
1
answer
729
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 ...
3
votes
3
answers
582
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.
1
vote
1
answer
467
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 ...
1
vote
0
answers
730
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 ...
1
vote
0
answers
231
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 ...
2
votes
0
answers
198
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 ...
4
votes
2
answers
3k
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** ...
0
votes
1
answer
84
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 ...
0
votes
1
answer
305
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 ??
0
votes
1
answer
876
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. (...
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.
0
votes
1
answer
123
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 ...
1
vote
0
answers
363
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 ...
1
vote
0
answers
260
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 ...
0
votes
1
answer
614
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 ...
1
vote
0
answers
54
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 ...
4
votes
0
answers
39
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) ...
1
vote
0
answers
23
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">
<...
1
vote
0
answers
13
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\...
1
vote
0
answers
17
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 ...
1
vote
0
answers
179
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"),"...
1
vote
1
answer
893
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 ...
0
votes
2
answers
2k
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' => '[{...}]'
];
...
1
vote
1
answer
225
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" ...
0
votes
2
answers
2k
views
PUT request on Magento 2 REST API through Postman
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.
I'm getting the following error message:
{
&...
0
votes
1
answer
55
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/...
1
vote
0
answers
458
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 ...
7
votes
2
answers
7k
views
Magento 2 : How to create custom webapi?
How to implement web API in custom extension in magento2?
4
votes
2
answers
5k
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
*
...
1
vote
0
answers
45
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
2
votes
0
answers
308
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 ...