JournalService :: 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": "CodeJournal",
"Operator": "0",
"Value": "ACH"
}
"Operator":0
}
}
- orders
{"orders":[{"TypeJournal":"Asc"}]}- pageNumber
{pageNumber: 1}- rowsPerPage
{rowsPerPage: 10}
Example:
require (__DIR__ . '/service/WebServices100.php'); use services\WebServices100; $url = 'http://<Your ip>:<Your Port>/WebServices100/<Your environment>/JournalService/rest/GetList'; // Send requests to receive data $result = WebServices100::getData($url, $data))); $response = json_decode($result);
Result:
Array
(
[0] => stdClass Object
(
[CodeJournal] => ACH
[Intitule] => Achats
[TypeJournal] => 0
[TypeNumerotationPiece] => 2
[CompteGeneral] =>
[EstAnalytique] => 1
[EstEnSommeil] =>
)
[1] => stdClass Object
(
[CodeJournal] => BEU
[Intitule] => Banque Européenne Ltd
[TypeJournal] => 2
[TypeNumerotationPiece] => 2
[CompteGeneral] => 5125
[EstAnalytique] =>
[EstEnSommeil] =>
)
[2] => stdClass Object
(
[CodeJournal] => BRD
[Intitule] => Banque Rivas & Duras
[TypeJournal] => 2
[TypeNumerotationPiece] => 2
[CompteGeneral] => 5120
[EstAnalytique] =>
[EstEnSommeil] =>
)
)