Questions tagged [rest]

Denotes questions related to the REST API on Magento

Filter by
Sorted by
Tagged with
0
votes
1answer
891 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
312 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 ...
6
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
852 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
517 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
423 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
153 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
377 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
345 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
536 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
580 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
140 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
314 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
242 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
326 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
918 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
410 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
493 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?
2
votes
1answer
140 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
1k 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
976 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
3k 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
578 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
946 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
112 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
1answer
279 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 ...
2
votes
1answer
4k views

Get list of ALL customers using REST API

I know I can get a specific customer by running: curl -X GET "http://127.0.0.1:32769/index.php/rest/V1/customers/2" -H "Authorization: Bearer token" How do I get the list of ALL customers?.. GET "...
2
votes
1answer
214 views

Is it safe to send admin credentials to rest API

I am getting data from magento2 REST api. I send admin credentials to get the token then I use the token to get the data and everything is working fine. Is it a safe way to do that? Should I create ...
3
votes
2answers
2k views

How to get Custom HTTP header in Magento2 controller?

I'm accessing my controller via postman tool (Postman) I've passed custom header as shown in image and trying to access it in controller through this code: $this->_response->getHeader('APP_ID'...
0
votes
1answer
1k views

Magento 1.9 REST API - updating/creating products with custom attributes

Is it possible to use Magento 1.9 REST API to create or update products that have custom attributes? example: http://magentohost/api/rest/products/8 Request Example: JSON { "...
11
votes
3answers
13k views

Magento 2 REST API usage with examples

need to call Magento2 rest api in code level how to call default magento REST APIS
1
vote
1answer
564 views

Is possible to create REST API with Basic Auth?

I've created REST API in Magento2 but everyone can use it. How can I add basic auth to my API?
1
vote
2answers
3k views

Add multiple products in single API call in magento2

I have to migrate data from RMS to magento. There are thousands of records that needs to be migrated. I am using REST API to save product. http://localhost:89/index.php/rest/all/V1/products This is ...
0
votes
1answer
678 views

pulling order IDs via REST API in magento 2.0

we are seeing a big dependency between the order ID that we are getting from Magento via REST and the order ID that we see in the order confirmation email. for example REST returns 45, the email has ...
2
votes
2answers
4k views

Adding regions in addresses other than US in Magento 2

We are running Magento 2.1.6. We want to set predefined regions and areas as drop down lists in addresses, just like when you select country us, you have the states pre selected, etc.. For example, ...
2
votes
1answer
153 views

Custom file attribute Rest Api

I'm using the Magento 2 rest API to read out the orders in to our system. If an order line product have a custom file option we want to download this file. From the order items we get the following ...
3
votes
3answers
10k views

Magento 2: Update order status using rest API

Guys I want to update order status using API. I am using this api to change the order status but it's not working: http://dev-jawed.com/index.php/rest/V1/orders { "status" : "Out-for-delivery", "...
0
votes
0answers
2k views

{“message”:“%fieldName is a required field.”,“parameters”:{“fieldName”:“criteria”}}

I am trying to get all slides, but I have an error: {"message":"%fieldName is a required field.","parameters":{"fieldName":"criteria"}} when I call this API: /V1/jeffSliderSlide/search: Any ...
2
votes
1answer
1k views

class [] does not exist for custom extension_attributes over webapi

I created a custom module to store the details of discount per items. I have a custom tables to store informations (quote items, order items, invoice items), and I use a extension attributes to link ...
0
votes
0answers
74 views

fedex not working india as origin magento 1.9

I tried almost all available methods to sort out but nothing happens. For the USA as origin, it works perfect in testing mode but when I change origin to India with same details as I registered to ...
3
votes
1answer
974 views

Get Countries and related Cities REST API

I have a form in my mobile app for shipping information. I am looking for REST API to get countries and its related cities. I found only an API: V1/directory/countries How can I get cities for ...
1
vote
1answer
299 views

home page banner res api magento 2

I am trying to get an API for banners in home page to list in my mobile app. Is there is a module for that? Ex: https://{{magento-host}}/index.php/rest/V1/banners
2
votes
1answer
2k views

magento rest api V1/products endpoint

I use following code to call rest api in magento 2.1.5 $consumerKey = 'aca1rh9env59axm0ob48xfu62t9s4a5e'; $consumerSecret = 'dgn4y1ejfu9aixb5mrio4kbsor5tq208'; $accessToken = '...
1
vote
1answer
2k views

How to add cutom customer attribute field to call rest api via create new customer

I have created a custom customer attribute(mobile_number) and set default value of customer create account. I added mobile number to customer_attribute: $customerSetup->addAttribute(Customer::...
1
vote
2answers
238 views

Creating an API to communicate directly with Magento DB

We have been using the Magento Rest API to communicate between external systems and Magento. Painfully, we have discovered that the REST API does not scale well. Specifically, often times requests ...
0
votes
1answer
866 views

Get pending, completed, processing orders REST API problem

I have an API module to get orders with any status for a specific customer. I am calling the API as : https://{{magento-store}}/index.php/rest/V1/order/myorder?status=processing and authoriaztion : ...

1 5 6 7 8 9 16