Questions tagged [rest]

Denotes questions related to the REST API on Magento

Filter by
Sorted by
Tagged with
1
vote
1answer
506 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
706 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
4k 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: "{...
3
votes
0answers
168 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
544 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
880 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
447 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
572 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
119 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, "...
4
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
519 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
429 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
731 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
428 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?
1
vote
1answer
581 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
634 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
739 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
254 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
857 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
755 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
445 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
360 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
4k 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
135 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
345 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>...
0
votes
1answer
303 views

Magento2 post to products/SKU changes website

I am using Magento 2.1.2 and when I update tier price information using the REST api, the product in website value is modified. For instance, I issue a POST request on /{website}/V1/products/{sku}/...
1
vote
1answer
463 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 ...
0
votes
1answer
463 views

magento 2 rest api accessing products based on store code giving same products

I'm using below url to access products which are specific to store http://<magento_host>/rest/<store_code>/V1/products/product_name but in output, i can see all other products as well. ...
0
votes
1answer
127 views

Magento Integration with Solr

I have integrated Solr with Magento EE. Solr logs whatever I search in Magento fronted search box. I'd like to know if Magento will also use Solr engine if the search REST API is called? Endpoints- ...
0
votes
1answer
281 views

Magento2 soap/rest api for third-party consumer

I'm trying to create a webservice client for Magento2 api. I would like to know whether Magento2 supports oauth2 or oauth1.0. Could someone clarify if Magento2 SOAP API also requires oauth process?
0
votes
0answers
62 views

Add order pragmatically REST API

I'm supposed to: Receive payment tokenization from mobile. Save tokenize for the customer. Use tokenize to add an order. Do payment process. How can I achieve these steps? Please help.
2
votes
0answers
199 views

Magento2 rest api error on product search on extension attribute

I've an extension attribute on products, declared in the following way: <attribute code="stock_item" type="Magento\CatalogInventory\Api\Data\StockItemInterface"> <resources> &...
2
votes
2answers
1k views

Add product to different website using rest API in magento 2

I want to add product to different website in magento 2 using rest api. I am able to add product to the store but I am not getting any information as how to add product to different websites inside ...
1
vote
0answers
267 views

Rest API - Online partial refund with multiple products error

I want to partial refund (for example 5$) with the rest API for an invoice paid with PayPal. I am using this endpoint: /invoice/{id}/refund And this body: { "items": [ { "order_item_id"...
1
vote
1answer
743 views

Magento2 REST API products list and out of stock

In the api call V1/products i get also out of stock products, even though I've set in Stores->configuration->catalog->inventory "Display out of stock products" to No. there's a way to get rid of this ...
0
votes
1answer
389 views

What would be authorization endpoint for oauth in magento 2

I am trying to build an api that delivers magento resources to a third party and for that I am using oauth for authentication purpose. On the third-party side the application asks for a authorization ...
0
votes
0answers
476 views

How to place order through rest API magento 1

I want to place an order as a guest user through rest API in Magento 1.Can anyone help me on this?
1
vote
1answer
106 views

Move HTTP GET request into a JSON array in Magento 2 REST API (V1/customers/search)

Is it possible to put the content of this rest api in a json array to put in GET parameters instead ? And if yes, what should the code look like ? curl_init("http://my.website.com/index.php/rest/V1/...
1
vote
1answer
970 views

Magento 2.1.5 : Reviews REST API

I looked for reviews REST API and I found this link: http://www.ipragmatech.com/products/reviews-rest-api-magento/ I tried to add review via it using : POST http://domain.com/index.php/rest/V1/...
1
vote
1answer
791 views

Magento2 Rest Api Search Criteria not working properly!

I am trying to get the sales orders from magento2 REST API. I am using the below query to get the complete orders within entity_id range: $ch = curl_init( Helper::getURL() . "orders?searchCriteria[...
0
votes
2answers
2k views

Magento 2: Problem creating search request with REST API : V1/customers/search

I'm trying to make a search request which returns all the customers, but the php script below returns : [message] => %fieldName is a required field. [parameters] => Array ( [...
4
votes
1answer
2k views

Magento2: Add a New Customer Address

I'm trying to add a new customer address using Magento 2 REST API in C#. I'm using POST /V1/customers/:id. I keep getting the below error. Where do I find the regionId? Is there another API I can use ...
1
vote
1answer
367 views

Handling OPTIONS for pre-flight request [duplicate]

I'm attempting to send a POST request to a Magento 2 API that my co-worker launched. It's up and working. I've been able to get a response via curl, but because of pre-flight requests from the client ...
3
votes
1answer
822 views

Magento 2: SMS Integration REST API

I have an API URL of SMS Gateway : https://smsexample.net/test/api.php?username=xxxx&password=xxxx&from=xxxx&to=xxxx&text=xxxx How can I make REST API using this gateway, so can call ...
2
votes
0answers
86 views

Error Using HTTPS to get the authentication token for Magento2 Rest

I am using Magento2 Rest API with token-based authentication. http://example.com/index.php/rest/V1/integration/admin/token It is working when using HTTP. However it doesnot work with HTTPS. SSL ...
1
vote
0answers
232 views

Shopping cart REST API and frontend synchronization

I was able to sign in using /rest/V1/integration/customer/token and add items to cart. How do I view the cart (items I added using REST API) as a customer from front-end? I want synchronize api cart ...