Child pages
  • Chapter 8 - Advanced Use

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Only include the "name" and "value" fields from the "configurations" resource

Wiki MarkupURL: (Store URL)/api/configurations/?display=\[name,value\]

PHP:

Code Block
$opt = array(
	'resource' => 'configurations', 
	'display'  => '[name,value]'
);

...

Only include the first and last names of customers "customers" whose ids are between 1 and 5

Wiki MarkupURL: (Store URL)/api/customers/?display=\[firstname,lastname\]&filter\[id\]=\[1|5\]

PHP:

Code Block
$opt = array(
	'resource'   => 'customers', 
	'display'    => '[firstname,lastname]', 
	'filter[id]' => '[1|5]'
);

Only include the first and last names of customers "customers" whose ids are between 1 and 10

Wiki MarkupURL: (Store URL)/api/customers/?display=\[lastname\]&filter\[id\]=\[1,10\]

PHP:

Code Block
$opt = array(
	'resource'   =>'customers', 
	'display'    => '[lastname]', 
	'filter[id]' => '[1,1]'
);

Only include the birthday of clients whose name is "John" and whose last name is "Doe"

Wiki MarkupURL: (Store URL)/api/customers/?display=\[birthday\]&filter\[firstname\]=\[John\]&filter\[lastname\]=\[DOE\]

PHP:

Code Block
$opt = array(
	'resource'          =>'customers', 
	'display'           => '[birthday]', 
	'filter[firstname]' => '[John]', 
	'filter[lastname]'  => '[DOE]'
);

Only include the names of manufacturers "manufacturers" whose name begins with "Appl"

Wiki MarkupURL: (Store URL)/api/manufacturers/?display=\[name\]&filter\[name\]=\[appl\]%

PHP:

Code Block
$opt = array(
	'resource'     => 'manufacturers', 
	'display'      => '[name]', 
	'filter[name]' => '[appl]%'
);

...

Filter the customers "customers" in alphabetical order according to last name

Wiki MarkupURL: Store URL/api/customers?display=full&sort=\[lastname_ASC\]

PHP:

Code Block
$opt = array(
	'resource' => 'customers', 
	'display'  => 'full', 
	'sort'     => '[lastname_ASC]'
);

...