The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [rest]

Denotes questions related to the REST API on Magento

Filter by
Sorted by
Tagged with
0
votes
1answer
933 views

Get Latest Products REST API

How can I get latest products as a REST API to display in mobile application home screen ?
8
votes
2answers
7k views

Magento 2 Api Getting Error '%fieldName is a required field'?

I am not getting result (id) while using POST method using url is rest/V1/hello/test/3 Screenshot: I have followed this link For Reference Please Click Here 1) webapi.xml <?xml version="1.0"...
1
vote
1answer
1k views

Retreive ALL Product details in Search REST API

Dears, I am using this API in search: GET http://domain.com/index.php/rest/V1/search Parameters: searchCriteria[requestName]= quick_search_container searchCriteria[filterGroups][0][filters][0][...
0
votes
1answer
762 views

Magento 2: How to create API rest for users CRUD

I know that Magento has CLI for creating new users, but I need to do that via API rest. And extending all CRUD functionalities. So I tried to create a new module for do that, but it's not working: ...
3
votes
1answer
1k views

Sign Up With Avatar REST API Validation Error : Magento 2

I have this code for image attribute (avatar). app/code/Ibnab/CustomerPut/Setup/InstallData.php : <?php namespace Ibnab\CustomerPut\Setup; use Magento\Framework\Module\Setup\Migration; use ...
2
votes
2answers
2k views

Magento 2 Rest API: Generate Auth Token for guest user

I need to generate authentication Token for guest user. I have checked in documentation, we can only generate Auth Token for customer and admin. Other resource can be accessed using anonymous role. ...
2
votes
0answers
242 views

Magento 2 REST API: What's the difference between carts and guest-carts?

Our team is developing a store using Magento 2 as the backend, with a decoupled client-side layer using Node.js/Express/React/Redux. So obviously we are relying heavily on the REST API, which is far ...
2
votes
1answer
659 views

Return order details in REST API Magento-2

I am writing a custom API which will use a customer token in authorization header and will able to fetch the order details. Below is my code: File : CustomerOrderRepositoryInterface.php <?php ...
1
vote
1answer
441 views

Sort Products REST API : Magento 2

I did a sort for product by price through API: http://domain.com/index.php/rest/V1/search?searchCriteria[requestName]=quick_search_container&searchCriteria[filterGroups][0][filters][0][field]=...
0
votes
1answer
589 views

API Access denied and 403 error

api/rest/customers is not working. I am Error 403 access denied though its working for products but not for orders.
1
vote
2answers
149 views

Unable to create customer using curl command

I am new to magento. I am facing an issue will trying to create customer using curl command. I am passing the correct json values as customer data as well, but still getting decoding error.Can some ...
4
votes
1answer
758 views

I need to add a extra field in product rest api response - Magento 2

I want to add a field "slider" in /rest/V1/products/:sku I created a custom module and in my di.xml i have added the following code <?xml version="1.0"?> <config xmlns:xsi="http://www.w3....
0
votes
1answer
827 views

Magento 1.9 Order Rest API Order Data

Using magento rest API i can see the data of product, category etc using https://magentohost/api/rest/products, Here is can see list of products but when i access https://magentohost/api/rest/orders ...
2
votes
3answers
999 views

Magento 2 - Category Save Event is not called when save category via rest api

I have created one observer CategorySaveAfter.php file in my custom module. And calling this observer on catalog_category_save_after event define in events.xml But somehow its not calling when i ...
5
votes
3answers
2k views

How to Get Customer data by telephone number in Magento2?

I have a telephone number which is given in Default address..by using this telephone number i need to get Customer Full data.Data like customer id, customer full name..etc
0
votes
1answer
2k views

Magento 2 Rest API: getting error “Invalid attribute name: %1”

Trying to get product with id using rest api search criteria: Request: http://magento_host/rest/V1/products?searchCriteria[filter_groups][0][filters][0][field]=id&searchCriteria[filter_groups][0][...
0
votes
1answer
358 views

Consistent 403 Error from REST API on v 1.9.3.2

The Setup I've been through every post I can find on this and still no luck. I've got code for authorizing with and connecting to the REST API. In a test environment running 1.9.1.1 this all works ...
3
votes
1answer
2k views

Magento2: Save Product Data for global scope using Rest API

I am trying to add product using Rest API. Adding product is working fine. But I am facing issue in assign in the product information only for Default values instead of copying data for store view. ...
1
vote
1answer
107 views

How to add Unirest to Magento 1.9.3.2?

I am trying to integrate Prompt Cloud API with magento. For it the basic requirement is to install Unirest library. I am trying to install using composer: composer require mashape/unirest-php And ...
2
votes
1answer
5k views

Magento 2 REST API returns only default category and its children

I am using "rest/V1/categories/" (Magento 2 Rest API). In documentation(devdocs.magento.com/swagger/#) it says "Retrieve list of categories" but it only returns default category(and its all children) ...
3
votes
4answers
7k views

Magento 2: How to generate Product URL Key when creating Product from Rest API?

I am creating Product in magento usign Rest API. Using the below format: { "product": { "name": "Product Name", "sku": "product_name_1498227094", "attribute_set_id": "18", "status": 1, "visibility": ...
1
vote
1answer
551 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 ...
2
votes
1answer
775 views

Magento custom attribute over the REST API

I tried to get full list of order item attributes by this url: api/rest/orders/25/items . There are: "item_id": "62", "parent_item_id": null, "product_type": "simple", "sku": "...
5
votes
1answer
5k views

Magento 2: How to authorize REST API call of customer after login?

I am using rest API to login in customer account usig the below URL and details: URL: https://magento.host/index.php/rest/V1/integration/customer/token Header: "Content-Type:application/json" Data: "{...
4
votes
0answers
170 views

Magento - Create order using REST API

I need to create place order using REST API. I want to help someone to create API. If you have any reference URL for perfect code please let me know.
1
vote
0answers
580 views

Magento 2 API - Update Product Custom Attribute to Blank/Null

I am trying to update a product via the Magento 2 Rest API. If an attribute already has a value I can update that value with another value with no problems. However if I want to delete the value and ...
1
vote
0answers
975 views

Injecting Guzzle with Parameters Magento 2

Writing some REST API bits and going to use Guzzle, which I have used many times before. The issue I am coming across is, I know Guzzle has to take the configuration via parameters when constructing ...
0
votes
1answer
48 views

Front End and Backend Login Doesnt work Magento 1.9.3

My magento site is at this link: http://frisbeemarketing.com/mom2b/customer/account/login/ the login page does not work and it does not send an error it just reloads It seems like a problem with ...
0
votes
2answers
2k views

Unable to access rest api : http://localhost/magento2/index.php/rest/V1/products

I am new to Magento. Please help me understand how to fetch the products. I believe there are some changes to be made in .htaccess file present in the root folder for this url: http://localhost/...
2
votes
2answers
2k views

Magento 2 Rest Api V1/products missing extension attributes

I am calling the Rest API V1/products to get the product list from Magento 2 store Request: http://{myMagentohost}/Magento/index.php/rest/V1/products?searchCriteria[currentPage]=1&...
2
votes
1answer
486 views

Cannot Create OAuth Consumer

I am trying to set up OAuth access to an API for a site running 1.9.3.2. All of the Magento instructions say: You can register your application by selecting System > Web Services > REST - OAuth ...
9
votes
1answer
626 views

Magento 2: Creating configurable product using the REST API

In order to create configurable product I need to create configurable product, virtual product and finally connect them. Example of json request got from here: How do I create a configurable product ...
0
votes
1answer
135 views

Magento 2.1 Rest API save attribute group does not change attribute_set_id

Preconditions Magento 2.1.7 PHP 7.0.18 Steps to reproduce 1. Having a test attribute group: { "attribute_group_id": "103", "attribute_group_name": "Test", "attribute_set_id": 4, "...
5
votes
1answer
1k views

Magento 2: Setting the product url key with REST API

Is it possible? I see no mention of a url_key in the Swagger docs. I have a large database of product I need to import, and the names (which seem to determine the url) are not unique.
0
votes
1answer
601 views

Magento 2: How to run CLI command on admin store (storeId:0)?

I have a multi-store setup with Magento 2.1.7 CE on the domain a, domain b, domain c. I want to apply images to some products programmatically. When I make an API call on any domain with the "all" ...
1
vote
1answer
512 views

How to access REST APIs as guest in Magento 2.1.x

I am building a mobile application for a Magento instance. I can use Token Based Authentication to make the API calls. However I want to enable guest access in my app. The users should be able to ...
2
votes
1answer
801 views

Setting Http Custom Header in REST Api Magento2

I want to set a custom Http header in my response in a Magento2 REST Api. I did the following: class Review implements ReviewInterface { public function __construct( \Magento\Framework\App\...
1
vote
1answer
486 views

Magento 2 : How to clear cache using REST?

How can I clear the Magento 2 page cache using REST API after updating the product quantity from 0 to 10?
2
votes
1answer
638 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
2answers
75 views

How to create REST API's in Magento 2?

I have to create a REST API that can be used in android phone to list all the products including product image using category id ?
1
vote
1answer
747 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/...
0
votes
1answer
785 views

php curl rest api token return false Magento 2

I'm trying to get an auth token with Magento 2 rest API with following code $userData = array("username" => "user", "password" => "password"); $ch = curl_init("https://domain/index.php/rest/V1/...
1
vote
2answers
282 views

Magento 1.x search product by specific value in http queryString

Been trying to search how to search item in magento 1.x to return JSON output when requesting something like. www.site.com/api/rest/product?desc=Dress&color=black Been to their doc and the ...
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) ...
0
votes
1answer
789 views

Sample files to use Magento 2 API REST and SOAP

How can I use the REST and SOAP? I'd like to have sample PHP files to use each one. I'm using the Magento 2.1. Thanks
1
vote
1answer
479 views

How to clear a custom option via REST product update

I am using product repository save() (rest POST /V1/products) to create/update products. With a single select attribute I can add an option, but can't see any way to clear the attribute option if ...
2
votes
1answer
382 views

Magento 2 : Modify Name of Product Category With API Rest

How to change name of product category with API Rest? The URL is http://localhost:8082/magento/index.php/rest/V1/categories/26 and JSON is { "category": { "id": 35, "parent_id": 34, ...
6
votes
3answers
5k views

Get Token Authentication For Customer Logged With Facebook & Twitter : Magento 2

Dears, I created a custom REST API, So customer can login Via facebook and twitter through mobile app. The API consists of one service which take some parameters and email parameter and check if this ...
0
votes
1answer
147 views

API call on */V1/products/:SKU return wrong values for yes/no fields

I have a strange Problem Magento version : 2.1.6 PHP: PHP 7.0.15-0ubuntu0.16.04.4 (cli) ( NTS ) If I send a REST call to mydomain/index.php/rest/de/V1/products/:SKU I get a result which looks fine ...
0
votes
1answer
352 views

Magento 2: Add color option to cart REST API

I am calling this API to get product details: GET https://domain.com/index.php/rest/V1/products/:SKU and get this response: <id>678</id> <sku>Mysku</sku> <name>...