EcritureService :: GetListAnalytiqueBySection

The POST method, is used to retrieve data.

The list of necessary parameters for sending a query:

  • int idPlanAnalytique,
  • string section

Returns data as JSON, for use in PHP, you need to convert JSON in StdClass PHP (PHP function: json_decode ()).

Input parameters:

{"idPlanAnalytique":1,"section":"929ZZ9"}

Example:

require (__DIR__ . '/service/WebServices100.php');

use services\WebServices100;

$url = 'http://<Your ip>:<Your Port>/WebServices100/<Your environment>/EcritureService/rest/GetListAnalytiqueBySection';

// add parameters
$data = new stdClass();
$data->idPlanAnalytique = 1;
$data->section = "929ZZ9";

$json_data = json_encode($data);

// Send requests to receive data
$result = WebServices100::getData($url, $json_data);

$response = json_decode($result);

Result:

Array
(
    [0] => stdClass Object
        (
            [IdEcriture] => 527
            [IdPlanAnalytique] => 1
            [Section] => 929ZZ9
            [Montant] => 19842.73
        )

    [1] => stdClass Object
        (
            [IdEcriture] => 530
            [IdPlanAnalytique] => 1
            [Section] => 929ZZ9
            [Montant] => 54776.8
        )

    [2] => stdClass Object
        (
            [IdEcriture] => 441
            [IdPlanAnalytique] => 1
            [Section] => 929ZZ9
            [Montant] => 1617.27
        )

    [3] => stdClass Object
        (
            [IdEcriture] => 444
            [IdPlanAnalytique] => 1
            [Section] => 929ZZ9
            [Montant] => 18284.17
        )
)