Questions tagged [api]

An application programming interface (API) specifies how some software components should interact with each other.

Filter by
Sorted by
Tagged with
0
votes
2answers
416 views

First steps of creating API integration with Magento2.3

background: I'm new to Magento as I haven't used it before, but I've read through most of the API documentation now. I have an online dashboard application with various widgets that are different API ...
0
votes
0answers
29 views

How to get Image data in Magento\Quote\Api\CartTotalRepositoryInterface using extension_attributes?

GET V1/carts/mine/totals This API Returns information for the cart totals a specified customer. How to get Item Images using extension_attributes on get function of Magento\Quote\Api\...
8
votes
1answer
151 views

Magento 2: get product through api using product name

I want to get product information using product name in Magento 2
0
votes
0answers
120 views

undefined rest api checkout cart

We've multiple websites in Magento (magento2.2.4) and we've got an issue at checkout cart and checkout page. We have also enable guest checkout. "/checkout/undefinedrest/buy/V1/guest-carts/.../buy/V1/...
1
vote
0answers
18 views

How to save lines of my custom object via API?

I have the next JSON example and I need to save this with a model via POST. The problem is how to save the field lines of this JSON... { "sizeCurves": { "external_key": "...
1
vote
0answers
45 views

API issue returning object

We have this API where we save different fields, but the object $lines we have created doesn't save properly. The code below are the getters and setters for the object $lines. Save method API: ...
0
votes
0answers
20 views

How to get Timezone details in magento1.9 through magento Soap or Rest api

How to fetch Magento 1.9 store timezone using API. I am able to get store_id, code, website_id, group_id but no timezone. In Magento 2.0 and above I am able to fetch timezone but Magento1.9 API is not ...
0
votes
1answer
152 views

How to get the Admin code of an option from an attribute? REST API

I have a problem, and I want you to give me a light at the end of the tunnel. I am doing an integration REST and need to get some information from the options of an attribute, in the admin panel I ...
0
votes
0answers
9 views

Dual CMS setup login to Magento from primary site

We have a dual setup for our website, most of the site is served up on another CMS but the commerce side is all Magento 2. The primary CMS doesn't have any frontend logins for users but we need to ...
0
votes
0answers
19 views

Using product api to upload video but deletes the product custom image roles

I am using api call = rest/all/V1/products/sku/media to upload video to a product but it deletes custom image roles. Can anyone please help me out.Thanks in advance.
1
vote
1answer
612 views

Magento 2 REST API ship order tracks error

I can create a shipment for an order via REST API. But when i try to add tracks i get the error: Carrier Code can not be empty. This is my code: Array ( [items] => Array ( ) [...
0
votes
0answers
16 views

Magento 2 API authorisation error

I am trying to get API for product attributes. http://mysite/elec/rest/V1/products/attributes?&searchCriteria[filterGroups][0][filters][0][field]=attribute_code&searchCriteria[filterGroups][...
0
votes
0answers
54 views

How to solve Soap API : Could not connect to host Error?

I am using SOAP V2 : abc.com/api/v2_soap?wsdl getting details from OroCRM, after Sync most of the data syced, but few of them not sync properly. Error Message : [message] Could not connect to host [...
1
vote
0answers
595 views

Magento 2 Rest API get all products with certain attribute_set_id

I need to elaborate de URL that will bring all products with certain attribute_set_id through Magento 2 Rest api, and then change though the api the attribute_set_id of all those items. My problem ...
0
votes
1answer
36 views

what are the basis on which I should define resources tag in webapi.xml

what are the basis on which I should define resources tag in webapi.xml. for example if I build an api to return product information who can access it. I've searched for that but all I found is what ...
0
votes
0answers
30 views

How to show quote_id in response of /carts/mine/totals API in magento-2.1?

I want to show quote_id in response of /carts/mine/totals API in magento-2.1. Anybody guide me.
5
votes
1answer
356 views

How to get recently viewed products by Customer Id in Model file Magento 2?

Create Recently Viewed Products for Model file in Magento 2 ?
2
votes
1answer
668 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. ...
1
vote
1answer
256 views

Magento2 save Custom shipment field by API

I have add field track_url in table sales_shipment_track. I'm creating shipment with API http://192.168.0.105/magento2/project/rest/V1/order/1292/ship { "items": [ { "order_item_id": ...
4
votes
1answer
325 views

Get tax class ID by tax rate with REST API

I'm trying to get a tax class ID with only the tax rate value, all with the API. I found that I need a first request that returns me the tax rate ID : /rest/all/V1/taxRates/search?searchCriteria[...
1
vote
1answer
1k views

Magento 2 How to add custom attribute to Quote Item Rest API

I want to add custom attribute to >http://{{magento2}}/rest/V1/carts/mine/totals API response. I have done follwing way but it not working. >extension_attributes.xml <config xmlns:xsi="http:/...
0
votes
2answers
368 views

Magento 2 Add New Integration error

I have seen this has been posted before but but cannot find a definitive answer. When trying to add a new integration (System > Integrations > Add New Integration), the New Integration page ...
3
votes
1answer
693 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
1
vote
0answers
77 views

Magento2.2 How to get userContext into ScopeConfig

It's more a core logic issue than a technical issue! I created one new table for admin_user: admin_user_config_data |config_id|user_id|path|value And, like in core_config_data, in this new table ...
5
votes
0answers
119 views

HELP - How to convert Default SOAP-v2 API Magento Objects into XML Values?

In Magento1.9 - product collection by default return values as Magento Objects using soap v2, how can i change into XML, <?php ini_set('display_errors','On'); $proxy = new SoapClient('abc.com/api/...
2
votes
1answer
92 views

customer not logged

I'm building rest api to get data based on customer session, but it always returns false when I call isLoggedIn() function that's my module.xml: <?xml version="1.0"?> <config xmlns:xsi="...
0
votes
1answer
154 views

How to add my own Magento 2 WSDL file

Magento 1.9 I used the WSDL https://github.com/marouanbmm/magento-Apis/blob/master/code/local/Tecnifibre/SerienFlow/etc/wsdl.xml file as part of my development Delphi win 32 to have access to the ...
0
votes
1answer
351 views

Magento 2: Rest api for getting cart items is returns empty array

I need tho get current customer cart items using rest api, so I've created Cart module and Here is my interface: <?php namespace Bit68\Cart\Api\Cart; interface MyCartInterface{ /** * @api * @...
1
vote
1answer
33 views

How to download Invoice without login Magento Admin?

I need to get invoice without login Magento admin, is it possible using any CRM or API Services?
0
votes
1answer
30 views

Magento API error while creating gost account

When i'm pasing $customerObject->newsletter = $wantToSubscribe; in magento API in log there is error LogicException: Property "Newsletter" does not have corresponding setter in class public ...
1
vote
1answer
1k views

Magento 2.2: How to add a custom attribute in to Order?

I have created a custom attribute of type customer_address and I would like to have the API to return me the value as an attribute when I call the API to receive an order. Attribute: private ...
2
votes
1answer
356 views

How to solve Soap_V2 - Uncaught SoapFault exception looks like we got no XML document - SoapClient->__call('login', Array)?

After configuration SOAP_v2 for getting products info, Magento version : 1.9.2.3 Code: <?php $proxy = new SoapClient('abc.com/api/v2_soap/?wsdl'); $sessionId = $proxy->login((object)array('...
2
votes
1answer
374 views

how can I get an image to be used in mobile app by rest api

I've written the following function public function getImg($sku){ $product=$this->productRepository->get($sku); $image=$product->getImage(); return $image; } as an api method ...
0
votes
0answers
16 views

Why to build api

While I'm building rest APIs to build a mobile app, like for example getting product by its sku and find its stock status. I see that APIs are already build by Magento. So why I need to build it? Can ...
4
votes
1answer
552 views

Magento 2 Add to cart api Item price set zero in Quote Item table

I am trying to add product to cart with Magento 2 default API. POST : http://{{magento2}}/rest/V1/carts/mine/items Request : { "cartItem": { "sku": "p2", "qty": 1, "price"...
4
votes
1answer
66 views

How to create Mobile Application of Magento 2 Native?

How to create Mobile Application of Magento Native ? Using Magento 2 default REST API's how to create Front-end Magento 2 application ?
0
votes
1answer
199 views

How do I correctly access WSDL for SOAP connection?

When running this, I only get an "HTTP ERROR 500" page. As I've seen in other solutions I've added the 'index.php' before the /api section. I've also enabled WSI-Compliance mode as I've seen suggested....
2
votes
1answer
99 views

PHP Online refund in Firstdata payment gateway (Payeezy)

I have implemented the Firstdata payment gateway for online payment. It is working fine. Now I want to implement the online refund functionality. If anyone provide me the sample script for Firstdata ...
0
votes
1answer
47 views

How to check is valid token or not. Magento 2 API

I need to do API method, which return data from db table just for admin. There is my method: /** * @return array * @throws \Magento\Framework\Exception\LocalizedException */ ...
2
votes
0answers
43 views

What is the correct way to create Mock input interface in Web-Api functional test?

I've already write successfully a Web-Api unit test for a Custom API. But I'm wondering if there is a way to automatically create a Mock for input data for the API? For example, AccountManagement ...
3
votes
2answers
604 views

Rest API - magento 1.9 - Return 403 Access denied - Magento\Framework\Webapi\Exception::HTTP_FORBIDDEN - format - https://abc.in/api/rest/customers

Error : Rest API for customer return 403 access denied error. Format : website/rest/api/customer -> 403 access denied error Magento\Framework\Webapi\Exception::HTTP_FORBIDDEN
0
votes
1answer
72 views

REST API routes for blog-module

I can't seem to find the API routes for this module, while the module is available by API. How can I translate the code to API routes? https://github.com/mirasvit/module-blog
2
votes
1answer
567 views

Magento 2 Api/Data, When To Create It?

I have fairly simple REST API request to get guest country code by his ip. In my block file this works perfectly fine when using curl: $url = "http://........./".$guestIp."?access_key=".$...
0
votes
2answers
1k views

Magento2 Shipping Methods rest api

Is There any possibility to fetch all shipping methods using rest api in magento2 Thanks
1
vote
1answer
897 views

Create REST API with post params

I have below JSON Data for rest API {"region_id":"475","city":"city","item":[{"qty":"1","weight":"","price":"10.0000","sku":"test"}]} and i wann to create api class I do like this /** * @api * @...
1
vote
0answers
132 views

Customize the API error response

I need to customize the JSON response of the Magento REST services when an exception is thrown. Examples: { "message": "Request does not match any route.", "trace": null } { "messages": ...
1
vote
0answers
82 views

Magento get product link using V1 API

$storeUrl."/index.php/rest/V1/products?searchCriteria[page_size]=200&searchCriteria[currentPage]=1" It returns products list but I want to get each product link. How it is possible?
0
votes
1answer
460 views

Add No-Required params to custom REST API

I made a custom REST API on Magento 2. I want some params to be required and other to be no required or accept null. I have the next code: Api/Order/ShippingInterface /** * API00004. Envío de ...
2
votes
3answers
3k views

Consumer is not authorized to access %resources Magento_Sales::sales

I have this basic API script: <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(-1); $usr = [ 'username' => 'username', '...
2
votes
1answer
154 views

I am trying to override core interface in Vendor\magento\sales\Api\Data\OrderItemInterface.php

My di.xml code is here, is there any alternative way to override an interface for core file. <preference for="Magento\Sales\Api\Data\OrderItemInterface" type="Vendor\Name\Api\Data\...