Chapter 8 - Advanced Use
Table of contents
/*<![CDATA[*/ div.rbtoc1597330883291 {padding: 0px;} div.rbtoc1597330883291 ul {list-style: disc;margin-left: 0px;} div.rbtoc1597330883291 li {margin-left: 0px;padding-left: 0px;} /*]]>*/
Advanced Use
Rendering Options
Include all fields from the "products" resource.
URL: (Store URL)/api/products/?display=full
PHP:
Include only the ID of all carriers "carriers"
URL: (Store URL)/api/products/
PHP :
Only include the "name" and "value" fields from the "configurations" resource.
URL: (Store URL)/api/configurations/?display=[name,value]
PHP:
Rendering Filters
Only include the first and last names of customers "customers" whose ids are between 1 and 5
URL: (Store URL)/api/customers/?display=[firstname,lastname]&filter[id]=[1|5]
PHP:
Only include the first and last names of customers "customers" whose ids are between 1 and 10
URL: (Store URL)/api/customers/?display=[lastname]&filter[id]=[1,10]
PHP:
Only include the birthday of clients whose name is "John" and whose last name is "Doe"
URL: (Store URL)/api/customers/?display=[birthday]&filter[firstname]=[John]&filter[lastname]=[DOE]
PHP:
Only include the names of manufacturers "manufacturers" whose name begins with "Appl"
URL: (Store URL)/api/manufacturers/?display=[name]&filter[name]=[appl]%
PHP:
Sorting Filters
Filter the customers "customers" in alphabetical order according to last name
URL: Store URL/api/customers?display=full&sort=[lastname_ASC]
PHP:
Filters to limit rendering
Only include the first 5 states "states"
URL: (Store URL)/api/states/?display=full&limit=5
PHP:
Only include the first 5 elements starting from the 10th element from the states resource "states"
URL: (Store URL)/api/states/?display=full&limit=9,5
PHP:
Last updated