Child pages
  • Chapter 8 - Advanced Use

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Rendering Options

Include all fields from the "products" resource.
URL :
« Store URL » « Store URL » /api/products/?display=full PHP 

PHP :

$opt = array('resource' => 'products', 'display' => 'full');

Include only the ID of all carriers "carriers" URL 

URL :
« Store URL  » « Store URL » /api/products/

PHP PHP :
$opt = array('resource' => 'products');

Wiki Markup\\ \\ *Only include the "name" and "value" fields from the "configurations" resource.* \\ URL : « Store URL  »

Wiki Markup
URL :
« Store URL  » /api/configurations/?display=\[enEN:name,value\]

Wiki Markup
\\
\\
PHP PHP :
$opt = array('resource' =>'configurations', 'display' => '\[enEN:name,value\]');

Rendering Filters

Wiki Markup
\\
\\
\\
<span style="color: #0070c0">Rendering Filters</span>
\\
Only include the first and last names of customers "customers" whose ids are between 1 and 5
« Store« URL »Store URL » /api/customers/?display=\[enEN:firstname,lastname\]&filter\[enEN:id\]=\[1|enEN:5\]
\\
\\

*
Wiki Markup
PHP :
$opt = array('resource' =>'customers', 'display' => '\[enEN:firstname,lastname\]', 'filter\[enEN:id\]' => '\[1|enEN:5\]');
Wiki Markup

Only include the first and last names of customers "customers" whose ids are between 1 and 10* \\ « Store URL »10

Wiki Markup
« Store URL » /api/customers/?display=\[enEN:lastname\]&filter\[enEN:id\]=\[enEN:1,10\]
\\
\\
\\

\\ \\ \\ *
Wiki Markup
       PHP    PHP :
$opt = array('resource' =>'customers', 'display' => '\[enEN:lastname\]', 'filter\[enEN:id\]' => '\[enEN:1,10\]');
Wiki Markup

Only include the birthday of clients whose name is "John" and whose last name is "Doe"* \\ « Store URL »

Wiki Markup
« Store URL » 
/api/customers/?display=\[enEN:birthday\]&filter\[enEN:firstname\]=\[enEN:John\]&filter\[enEN:lastname\]=\[enEN:DOE\]
\\
\\
\\
    PHP 

Wiki Markup
    PHP :
$opt = array('resource' =>'customers', 'display' => '\[enEN:birthday\]', 'filter\[enEN:firstname\]' => '\[enEN:John\]', 'filter\[enEN:lastname\]' => '\[enEN:DOE\]');

Wiki Markup
\\ \\ \\     *Only include the names of manufacturers "manufacturers" whose name begins with "Appl"*
« Store« Store URL » /api/manufacturers/?display=\[enEN:name\]&filter\[enEN:name\]=\[enEN:appl\]%
\\
\\
\\
    PHP 

Wiki Markup
    PHP :
$opt = array('resource' => 'manufacturers', 'display' => '\[enEN:name\]', 'filter\[enEN:name\]' => '\[enEN:appl\]%');

Sorting Filters

Wiki Markup
\\
\\
\\
\\
<span style="color: #0070c0">Sorting Filters</span>
\\
Filter the customers "customers" in alphabetical order according to last name
« Store« URL »Store URL » /api/customers?display=full&sort=\[enEN:lastname_ASC\]
\\
\\
PHP 

Wiki Markup
PHP :
$opt = array('resource' => 'customers', 'display' => 'full', 'sort' => '\[enEN:lastname_ASC\]');

Filters to limit rendering

Only include the first 5 states "states"
« Store URL » « Store URL » /api/states/?display=full&limit=5

PHP PHP :
$opt = array('resource' => 'states', 'display' => 'full', 'limit' => '5');

Only include the first 5 elements starting from the 10th element from the states resource "states" « Store URL »

« Store URL » /api/states/?display=full&limit=9,5

PHP PHP :
$opt = array('resource' => 'states', 'display' => 'full', 'limit' => '9,5');