JSON responses on this page contributed by Tim Reynolds
Some requests use GET parameters in the URL. These are as follows:
- filter - specifies the filters for returned data
- page - specifies the page number which items will be returned
- e.g., http://magentohost/api/rest/products?page=1
- order, dir - specifies the sort order of returned items and the order direction: 'asc' - returns items in the ascending order; 'dsc' - returns items in the descending order.
- e.g., http://magentohost/api/rest/products?order=name&dir=dsc
- e.g., http://magentohost/api/rest/products?order=name&dir=asc
- limit - limits the number of returned items in the response. Note that by default, 10 items are returned in the response. The maximum number is 100 items.
- e.g., http://magentohost/api/rest/products?limit=2
- neq - "not equal to" - returns items with the specified attribute that is not equal to the defined value
- in - "equals any of" - returns items that are equal to the item(s) with the specified attribute(s)
- nin - "not equals any of" - returns items excluding the item with the specified attribute
- gt - "greater than" - returns items with the specified attribute that is greater than the defined value
- lt - "less than" - returns items with the specified attribute that is less than the defined value
- from, to - specifies the range of attributes according to which items will be returned
If the attribute value consists of several words separated by a whitespace, the '%20' sign is used:
For example, to filter products with the description equal to simple01:
To filter customers by email address:
http://magentohost/api/rest/customers?filter[1][attribute]=email&filter[1][in][0][email protected]