StockService :: StockDepots

The GET method, is used to retrieve data.

The list of parameters is not mandatory to request:

  • 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:

?pageNumber=1&rowsPerPage=2

Example:

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

use services\WebServices100;

$url = 'http://<Your ip>:<Your Port>/WebServices100/<Your environment>/StockService/rest/StockDepot?pageNumber=1&rowsPerPage=2';

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

$response = json_decode($result);

Result:

Array
(
[0] => stdClass Object
(
[IdDepot] => 1
[RefArticle] => BAAR01
[IdGamme1] => 0
[IdGamme2] => 0
[QteStock] => 1064
[StockPrepare] => 22
[QteReserve] => 47
[QteCommmande] => 400
[QteMini] => 5
[QteMaxi] => 10
[EstPrincipal] =>
[IdEmplacementPrincipal] => 14
[MontantStock] => 127903.06
[StockMouvemente] =>
[Createur] => COLU
[DateModification] => /Date(1537945080000+0200)/
)
[1] => stdClass Object
(
[IdDepot] => 2
[RefArticle] => BAAR01
[IdGamme1] => 0
[IdGamme2] => 0
[QteStock] => 1
[StockPrepare] => 0
[QteReserve] => 7
[QteCommmande] => 0
[QteMini] => 5
[QteMaxi] => 10
[EstPrincipal] => 1
[IdEmplacementPrincipal] => 79
[MontantStock] => 174.84
[StockMouvemente] =>
[Createur] => COLU
[DateModification] => /Date(1522842540000+0200)/
)
)