Message-ID: <1544873832.378632.1711667787046.JavaMail.root@confluence-doc2-production> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_378631_1901408899.1711667787041" ------=_Part_378631_1901408899.1711667787041 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Chapter 8 - Advanced Use

Chapter 8 - Advanced Use

Table of content

=20 =20

Advanced Use

Rendering Options

Include all fields from the "products" resource

URL: (Store URL)/api/products/?display=3Dfull

PHP:

=20
$opt =3D=
 array(
=09'resource' =3D> 'products',=20
=09'display'  =3D> 'full'
);
=20

Include only = the ID of all carriers

URL: (Store URL)/api/carriers/?display=3D[id]

PHP :

=20
$opt =3D=
 array('resource' =3D> 'carriers', 'display' =3D> '[id]');
=20

Only include the "na= me" and "value" fields from the "configurations" resource

URL: (Store URL)/api/configurations/?display=3D[name,value]

PHP:

=20
$opt =3D=
 array(
=09'resource' =3D> 'configurations',=20
=09'display'  =3D> '[name,value]'
);
=20

Rendering Filters

Only include the first and last names o= f customers "customers" whose ids are 1 or 5

URL: (Store URL)/api/customers/?display=3D[firstname,lastname]&filte= r[id]=3D[1|5]

PHP:

=20
$opt =3D=
 array(
=09'resource'   =3D> 'customers',=20
=09'display'    =3D> '[firstname,lastname]',=20
=09'filter[id]' =3D> '[1|5]'
);
=20

Only include the last names of custome= rs "customers" whose ids are between 1 and 10

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

PHP:

=20
$opt =3D=
 array(
=09'resource'   =3D>'customers',=20
=09'display'    =3D> '[lastname]',=20
=09'filter[id]' =3D> '[1,10]'
);
=20

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

URL: (Store URL)/api/customers/?display=3D[birthday]&filter[firstnam= e]=3D[John]&filter[lastname]=3D[DOE]

PHP:

=20
$opt =3D=
 array(
=09'resource'          =3D>'customers',=20
=09'display'           =3D> '[birthday]',=20
=09'filter[firstname]' =3D> '[John]',=20
=09'filter[lastname]'  =3D> '[DOE]'
);
=20

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

URL: (Store URL)/api/manufacturers/?display=3D[name]&filter[name]=3D= [appl]%

PHP:

=20
$opt =3D=
 array(
=09'resource'     =3D> 'manufacturers',=20
=09'display'      =3D> '[name]',=20
=09'filter[name]' =3D> '[appl]%'
);
=20

Sorting Filters

Filter the customers "customers" in alph= abetical order according to last name

URL: Store URL/api/customers?display=3Dfull&sort=3D[lastname_ASC]

PHP:

=20
$opt =3D=
 array(
=09'resource' =3D> 'customers',=20
=09'display'  =3D> 'full',=20
=09'sort'     =3D> '[lastname_ASC]'
);
=20

Filters to limit re= ndering

Only include the first 5 states "states"

URL: (Store URL)/api/states/?display=3Dfull&limit=3D5

PHP:

=20
$opt =3D=
 array(
=09'resource' =3D> 'states',=20
=09'display'  =3D> 'full',=20
=09'limit'    =3D> '5'
);
=20

Only include the first 5= elements starting from the 10th element from the states resource "states"<= /h4>

URL: (Store URL)/api/states/?display=3Dfull&limit=3D9,5

PHP:

=20
$opt =3D=
 array(
=09'resource' =3D> 'states',=20
=09'display'  =3D> 'full',=20
=09'limit'    =3D> '9,5'
);
=20

------=_Part_378631_1901408899.1711667787041--