cancel
Showing results for 
Search instead for 
Did you mean: 

How to alter the parameters returned in the magento 2.0 API response

How to alter the parameters returned in the magento 2.0 API response

I am trying to search magento products by name using the REST API in an iOS app.

API: http://192.168.1.180/magento/index.php/rest/V1/products?searchCriteria[filter_groups][0][filters][0]...

The response contains all the information about the product. What if I only needed the SKU and name to be returned in the API response?

3 REPLIES

Re: How to alter the parameters returned in the magento 2.0 API response

You can either extend the API on the Magento side and return on SKU or you can select just the SKU on your call to the Magento application. 

 

What is the criteria you are using to do you select in Magento?

Magento Moderator since 2009
Keep Calm and Clear Cache!

Re: How to alter the parameters returned in the magento 2.0 API response

I was trying to access thev1/search api using the search_term field name:

 

http://192.168.1.180/magento/index.php/rest/V1/search?searchCriteria[filter_groups][0][filters][0][s...

Re: How to alter the parameters returned in the magento 2.0 API response

@Brent W Peterson Can you throw some light on search_term parameter? I read somewhere, you can choose the response parameters of an API request using the V1/search API and search_term parameter. I tired many iterations of this API but non of them worked.

 

I am using the below API:

 

http://192.168.1.180/magento/index.php/rest/V1/search?searchCriteria[filter_groups][0][filters][0][s...

 

but it gives error !