CompteGeneralService :: Insert

The POST method, is used to retrieve data.

The list of necessary parameters for sending a query:

  • array ( string Intitule, string NumeroCompte).
  • boolean useSageProcess.

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

Input parameters:

{"compte":{"Intitule":"TestInsert_WebService","NumeroCompte":"5454545"},"useSageProcess ":"true"}

Example:

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

use services\WebServices100;

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

// add parameters
$data = [
    'compte' => [
        "Intitule" => "TestInsert_WebService",
        "NumeroCompte" => "5454545",
    ],
    'useSageProcess ' => "true",
];
$json_data = json_encode($data);

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

$response = json_decode($result);

Result:

stdClass Object
(
    [NumeroCompte] => 5454545
    [Intitule] => TestInsert_WebService
    [TypeCompte] => 0
    [NatureCompte] => 0
    [ReportCompte] => 1
    [EstAnalytique] => 
    [EstEnSommeil] => 
    [InfosLibres] => Array
        (
            [0] => stdClass Object
                (
                    [Name] => Derniere ecriture
                    [Type] => 1
                    [Size] => 0
                    [EstCalculee] => 1
                    [Value] => 
                )

            [1] => stdClass Object
                (
                    [Name] => Nb ecritures
                    [Type] => 3
                    [Size] => 0
                    [EstCalculee] => 1
                    [Value] => 
                )

        )

)