Additional list parameters
Previous tutorials only use simple list that returns the IDs of the resources, but you can actually get more details, sort and filter the list.
Display parameter
You can specify which fields you want for each resource using the display parameter.
| Key | Value | Result | 
| display | full | Returns all the fields of the resource | 
|  | [field1,field2,...] | Returns only the fields specified in this array | 
| Result | API call | PHP Webservice lib options | 
| Include all fields from the productsresource | /api/products/?display=full | $opt = [
    'resource' => 'products',
    'display'  => 'full'
];
 | 
| Include only the ID from the carriersresource | /api/carriers/?display=[id] | $opt = [
    'resource' => 'carriers',
    'display'  => '[id]'
];
 | 
| Only include the name and value fields from the configurationsresource | /api/configurations/?display=[name,value] | $opt = [
    'resource' => 'configurations',
    'display'  => '[name,value]'
];
 | 
Filter parameter
You can filter the expected result with the filter parameter
| Key | Value | Result | 
| filter[field] | [1|5] | ORoperator: list of possible values | 
|  | [1,10] | Intervaloperator: define interval of possible values | 
|  | [John] | Literalvalue (not case sensitive) | 
|  | [Jo]% | Beginoperator: fields begins with the value (not case sensitive) | 
|  | %[hn] | Endoperator: fields ends with the value (not case sensitive) | 
|  | %[oh]% | Containsoperator: fields contains the value (not case sensitive) | 
| Result | API call | PHP Webservice lib options | 
| Only the customerswhose ids are 1 or 5 | /api/customers/?filter[id]=[1|5] | $opt = [
    'resource' => 'customers',
    'filter[id]'  => '[1|5]'
];
 | 
| Only the customerswhose ids are between 1 and 10 | /api/customers/?filter[id]=[1,10] | $opt = [
    'resource' => 'customers',
    'filter[id]'  => '[1,10]'
];
 | 
| Only the customerswhose first name is “John” | /api/customers/?filter[firstname]=[John] | $opt = [
    'resource' => 'customers',
    'filter[firstname]' => '[John]',
];
 | 
| Only the manufacturerswhose name begins with “Appl” | /api/manufacturers/?filter[name]=[appl]% | $opt = [
    'resource' => 'manufacturers',
    'filter[name]' => '[appl]%',
];
 | 
Sort parameter
You can sort the expected result with the sort parameter
| Key | Value | Result | 
| sort | [{fieldname}_{ASC|DESC}] | The sortvalue is composed of a field name and the expected order separated by a_ | 
| Result | API call | PHP Webservice lib options | 
| Sort the customersin alphabetical order according to last name | /api/customers/?sort=[lastname_ASC] | $opt = [
    'resource' => 'customers',
    'sort'  => '[lastname_ASC]'
];
 | 
| Sort the customersin alphabetical order according to last name, then by biggest ID first | /api/customers/?sort=[lastname_ASC,id_DESC] | $opt = [
    'resource' => 'customers',
    'sort'  => '[lastname_ASC,id_DESC]'
];
 | 
If you need to sort by the date field you need to add &date=1 in your request.
Final request will be: /api/customers/?sort=[date_add_DESC]&date=1
Limit parameter
You can define a limit to the expected result with the limit parameter (which may allow you to perform pagination)
| Key | Value | Result | 
| limit | [offset,]limit | Either define offsetandlimitseparated by a,(ex:1,5) or the limit only (offsetis 0-indexed) | 
| Result | API call | PHP Webservice lib options | 
| Only include the first 5 states | /api/states/?limit=5 | $opt = [
    'resource' => 'states',
    'limit'  => '5'
];
 | 
| Only include the first 5 statesstarting from the 10th element | /api/states/?limit=9,5 | $opt = [
    'resource' => 'states',
    'limit'  => '9,5'
];
 |