ArticleService :: GetList
The POST method, is used to retrieve data.
The list of parameters is not mandatory to request:
- Criteria criteria,
- array orders,
- int pageNumber,
- int rowsPerPage.
Returns data as JSON, for use in PHP, you need to convert JSON in StdClass PHP (PHP function: json_decode ()).
Input parameters:
- Criteria
{"criteria":
{
"__type":"CriteriaLogical:http://www.proconsult.lu/WebServices100",
"Operand1":
{
"__type":"CriteriaComparison:http://www.proconsult.lu/WebServices100",
"FieldName": "Langue1",
"Operator": "0",
"Value": "Silver ring"
},
"Operator":0
}
}
- orders
{"orders":[{"CodeFamille":"Asc"}]}
- pageNumber
{pageNumber: 1}- rowsPerPage
{rowsPerPage: 10}
Example:
require (__DIR__ . '/service/WebServices100.php'); use services\WebServices100; // add parameters $data = new stdClass(); $data->criteria = null; $json_data = json_encode($data); $url = 'http://<Your ip>:<Your Port>/WebServices100/<Your environment>/ArticleService/rest/GetList'; // Send requests to receive data $result = WebServices100::getData($url, $json_data); $response = json_decode($result);
Result:
Array
(
[0] => stdClass Object
(
[__type] => ArticleStandard:http://www.proconsult.lu/WebServices100
[Reference] => BAAR01
[Intitule] => Bague Argent
[CodeFamille] => BIJOUXARG
[TypeArticle] => 0
[TypeNomenclature] => 0
[TypeSuiviStock] => 2
[TypeEscompte] => 0
[UnitePoids] => 0
[PoidsNet] => 4.23
[PoidsBrut] => 15
[IdUniteVente] => 1
[DelaiLivraison] => 0
[Garantie] => 12
[PrixAchat] => 186
[PrixUnitaireNet] => 0
[PrixVente] => 372
[Coefficient] => 2
[Statistique1] => Automne/Hiver
[Statistique2] => Classique
[Statistique3] =>
[Statistique4] =>
[Statistique5] =>
[EstEnSommeil] =>
[Langue1] => Silver ring
[Langue2] =>
[CodeEDI] =>
[CodeBarres] => 21731006
[Photo] => .\Multimedia\BAAR01.jpg
[IdCatalogue1] => 5
[IdCatalogue2] => 6
[IdCatalogue3] => 7
[IdCatalogue4] => 0
[HorsStatistique] =>
[VenteAuDebit] =>
[NonImpression] =>
[Contremarque] =>
[FacturationPoids] =>
[FacturationForfait] =>
[Transfere] =>
[Publie] => 1
[InfosLibres] => Array
(
[0] => stdClass Object
(
[Name] => 1ère commercialisation
[Type] => 1
[Size] => 0
[EstCalculee] =>
[Value] => /Date(237067200000+0400)/
)
[1] => stdClass Object
(
[Name] => Marque commerciale
[Type] => 0
[Size] => 35
[EstCalculee] =>
[Value] => Bijoux d'Argentières
)
[2] => stdClass Object
(
[Name] => Objectif / Qtés vendues
[Type] => 3
[Size] => 0
[EstCalculee] =>
[Value] => 500
)
[3] => stdClass Object
(
[Name] => Pourcentage teneur en or
[Type] => 3
[Size] => 0
[EstCalculee] =>
[Value] => 0
)
)
)
)